htt.h 922 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. * 3.113 Add add rx msdu,mpdu,ppdu fields in rx_ring_selection_cfg_t
  234. * 3.114 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET def.
  235. * 3.115 Add HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP and
  236. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE msg defs.
  237. */
  238. #define HTT_CURRENT_VERSION_MAJOR 3
  239. #define HTT_CURRENT_VERSION_MINOR 115
  240. #define HTT_NUM_TX_FRAG_DESC 1024
  241. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  242. #define HTT_CHECK_SET_VAL(field, val) \
  243. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  244. /* macros to assist in sign-extending fields from HTT messages */
  245. #define HTT_SIGN_BIT_MASK(field) \
  246. ((field ## _M + (1 << field ## _S)) >> 1)
  247. #define HTT_SIGN_BIT(_val, field) \
  248. (_val & HTT_SIGN_BIT_MASK(field))
  249. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  250. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  251. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  252. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  253. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  254. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  255. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  256. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  257. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  258. /*
  259. * TEMPORARY:
  260. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  261. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  262. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  263. * updated.
  264. */
  265. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  266. /*
  267. * TEMPORARY:
  268. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  269. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  270. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  271. * updated.
  272. */
  273. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  274. /**
  275. * htt_dbg_stats_type -
  276. * bit positions for each stats type within a stats type bitmask
  277. * The bitmask contains 24 bits.
  278. */
  279. enum htt_dbg_stats_type {
  280. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  281. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  282. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  283. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  284. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  285. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  286. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  287. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  288. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  289. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  290. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  291. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  292. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  293. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  294. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  295. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  296. /* bits 16-23 currently reserved */
  297. /* keep this last */
  298. HTT_DBG_NUM_STATS
  299. };
  300. /*=== HTT option selection TLVs ===
  301. * Certain HTT messages have alternatives or options.
  302. * For such cases, the host and target need to agree on which option to use.
  303. * Option specification TLVs can be appended to the VERSION_REQ and
  304. * VERSION_CONF messages to select options other than the default.
  305. * These TLVs are entirely optional - if they are not provided, there is a
  306. * well-defined default for each option. If they are provided, they can be
  307. * provided in any order. Each TLV can be present or absent independent of
  308. * the presence / absence of other TLVs.
  309. *
  310. * The HTT option selection TLVs use the following format:
  311. * |31 16|15 8|7 0|
  312. * |---------------------------------+----------------+----------------|
  313. * | value (payload) | length | tag |
  314. * |-------------------------------------------------------------------|
  315. * The value portion need not be only 2 bytes; it can be extended by any
  316. * integer number of 4-byte units. The total length of the TLV, including
  317. * the tag and length fields, must be a multiple of 4 bytes. The length
  318. * field specifies the total TLV size in 4-byte units. Thus, the typical
  319. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  320. * field, would store 0x1 in its length field, to show that the TLV occupies
  321. * a single 4-byte unit.
  322. */
  323. /*--- TLV header format - applies to all HTT option TLVs ---*/
  324. enum HTT_OPTION_TLV_TAGS {
  325. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  326. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  327. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  328. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  329. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  330. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  331. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  332. };
  333. #define HTT_TCL_METADATA_VER_SZ 4
  334. PREPACK struct htt_option_tlv_header_t {
  335. A_UINT8 tag;
  336. A_UINT8 length;
  337. } POSTPACK;
  338. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  339. #define HTT_OPTION_TLV_TAG_S 0
  340. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  341. #define HTT_OPTION_TLV_LENGTH_S 8
  342. /*
  343. * value0 - 16 bit value field stored in word0
  344. * The TLV's value field may be longer than 2 bytes, in which case
  345. * the remainder of the value is stored in word1, word2, etc.
  346. */
  347. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  348. #define HTT_OPTION_TLV_VALUE0_S 16
  349. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  350. do { \
  351. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  352. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  353. } while (0)
  354. #define HTT_OPTION_TLV_TAG_GET(word) \
  355. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  356. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  357. do { \
  358. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  359. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  360. } while (0)
  361. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  362. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  363. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  364. do { \
  365. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  366. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  367. } while (0)
  368. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  369. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  370. /*--- format of specific HTT option TLVs ---*/
  371. /*
  372. * HTT option TLV for specifying LL bus address size
  373. * Some chips require bus addresses used by the target to access buffers
  374. * within the host's memory to be 32 bits; others require bus addresses
  375. * used by the target to access buffers within the host's memory to be
  376. * 64 bits.
  377. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  378. * a suffix to the VERSION_CONF message to specify which bus address format
  379. * the target requires.
  380. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  381. * default to providing bus addresses to the target in 32-bit format.
  382. */
  383. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  384. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  385. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  386. };
  387. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  388. struct htt_option_tlv_header_t hdr;
  389. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  390. } POSTPACK;
  391. /*
  392. * HTT option TLV for specifying whether HL systems should indicate
  393. * over-the-air tx completion for individual frames, or should instead
  394. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  395. * requests an OTA tx completion for a particular tx frame.
  396. * This option does not apply to LL systems, where the TX_COMPL_IND
  397. * is mandatory.
  398. * This option is primarily intended for HL systems in which the tx frame
  399. * downloads over the host --> target bus are as slow as or slower than
  400. * the transmissions over the WLAN PHY. For cases where the bus is faster
  401. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  402. * and consequently will send one TX_COMPL_IND message that covers several
  403. * tx frames. For cases where the WLAN PHY is faster than the bus,
  404. * the target will end up transmitting very short A-MPDUs, and consequently
  405. * sending many TX_COMPL_IND messages, which each cover a very small number
  406. * of tx frames.
  407. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  408. * a suffix to the VERSION_REQ message to request whether the host desires to
  409. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  410. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  411. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  412. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  413. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  414. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  415. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  416. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  417. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  418. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  419. * TLV.
  420. */
  421. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  422. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  423. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  424. };
  425. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  426. struct htt_option_tlv_header_t hdr;
  427. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  428. } POSTPACK;
  429. /*
  430. * HTT option TLV for specifying how many tx queue groups the target
  431. * may establish.
  432. * This TLV specifies the maximum value the target may send in the
  433. * txq_group_id field of any TXQ_GROUP information elements sent by
  434. * the target to the host. This allows the host to pre-allocate an
  435. * appropriate number of tx queue group structs.
  436. *
  437. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  438. * a suffix to the VERSION_REQ message to specify whether the host supports
  439. * tx queue groups at all, and if so if there is any limit on the number of
  440. * tx queue groups that the host supports.
  441. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  442. * a suffix to the VERSION_CONF message. If the host has specified in the
  443. * VER_REQ message a limit on the number of tx queue groups the host can
  444. * support, the target shall limit its specification of the maximum tx groups
  445. * to be no larger than this host-specified limit.
  446. *
  447. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  448. * shall preallocate 4 tx queue group structs, and the target shall not
  449. * specify a txq_group_id larger than 3.
  450. */
  451. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  452. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  453. /*
  454. * values 1 through N specify the max number of tx queue groups
  455. * the sender supports
  456. */
  457. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  458. };
  459. /* TEMPORARY backwards-compatibility alias for a typo fix -
  460. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  461. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  462. * to support the old name (with the typo) until all references to the
  463. * old name are replaced with the new name.
  464. */
  465. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  466. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  467. struct htt_option_tlv_header_t hdr;
  468. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  469. } POSTPACK;
  470. /*
  471. * HTT option TLV for specifying whether the target supports an extended
  472. * version of the HTT tx descriptor. If the target provides this TLV
  473. * and specifies in the TLV that the target supports an extended version
  474. * of the HTT tx descriptor, the target must check the "extension" bit in
  475. * the HTT tx descriptor, and if the extension bit is set, to expect a
  476. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  477. * descriptor. Furthermore, the target must provide room for the HTT
  478. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  479. * This option is intended for systems where the host needs to explicitly
  480. * control the transmission parameters such as tx power for individual
  481. * tx frames.
  482. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  483. * as a suffix to the VERSION_CONF message to explicitly specify whether
  484. * the target supports the HTT tx MSDU extension descriptor.
  485. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  486. * by the host as lack of target support for the HTT tx MSDU extension
  487. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  488. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  489. * the HTT tx MSDU extension descriptor.
  490. * The host is not required to provide the HTT tx MSDU extension descriptor
  491. * just because the target supports it; the target must check the
  492. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  493. * extension descriptor is present.
  494. */
  495. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  496. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  497. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  498. };
  499. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  500. struct htt_option_tlv_header_t hdr;
  501. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  502. } POSTPACK;
  503. /*
  504. * For the tcl data command V2 and higher support added a new
  505. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  506. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  507. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  508. * HTT option TLV for specifying which version of the TCL metadata struct
  509. * should be used:
  510. * V1 -> use htt_tx_tcl_metadata struct
  511. * V2 -> use htt_tx_tcl_metadata_v2 struct
  512. * Old FW will only support V1.
  513. * New FW will support V2. New FW will still support V1, at least during
  514. * a transition period.
  515. * Similarly, old host will only support V1, and new host will support V1 + V2.
  516. *
  517. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  518. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  519. * of TCL metadata the host supports. If the host doesn't provide a
  520. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  521. * is implicitly understood that the host only supports V1.
  522. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  523. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  524. * the host shall use. The target shall only select one of the versions
  525. * supported by the host. If the target doesn't provide a
  526. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  527. * is implicitly understood that the V1 TCL metadata shall be used.
  528. */
  529. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  530. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  531. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  532. };
  533. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  534. struct htt_option_tlv_header_t hdr;
  535. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  536. } POSTPACK;
  537. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  538. HTT_OPTION_TLV_VALUE0_SET(word, value)
  539. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  540. HTT_OPTION_TLV_VALUE0_GET(word)
  541. typedef struct {
  542. union {
  543. /* BIT [11 : 0] :- tag
  544. * BIT [23 : 12] :- length
  545. * BIT [31 : 24] :- reserved
  546. */
  547. A_UINT32 tag__length;
  548. /*
  549. * The following struct is not endian-portable.
  550. * It is suitable for use within the target, which is known to be
  551. * little-endian.
  552. * The host should use the above endian-portable macros to access
  553. * the tag and length bitfields in an endian-neutral manner.
  554. */
  555. struct {
  556. A_UINT32 tag : 12, /* BIT [11 : 0] */
  557. length : 12, /* BIT [23 : 12] */
  558. reserved : 8; /* BIT [31 : 24] */
  559. };
  560. };
  561. } htt_tlv_hdr_t;
  562. /** HTT stats TLV tag values */
  563. typedef enum {
  564. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  565. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  566. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  567. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  568. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  569. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  570. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  571. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  572. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  573. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  574. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  575. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  576. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  577. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  578. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  579. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  580. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  581. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  582. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  583. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  584. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  585. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  586. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  587. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  588. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  589. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  590. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  591. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  592. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  593. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  594. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  595. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  596. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  597. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  598. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  599. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  600. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  601. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  602. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  603. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  604. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  605. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  606. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  607. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  608. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  609. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  610. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  611. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  612. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  613. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  614. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  615. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  616. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  617. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  618. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  619. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  620. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  621. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  622. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  623. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  624. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  625. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  626. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  627. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  628. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  629. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  630. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  631. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  632. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  633. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  634. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  635. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  636. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  637. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  638. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  639. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  640. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  641. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  642. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  643. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  644. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  645. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  646. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  647. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  648. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  649. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  650. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  651. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  652. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  653. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  654. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  655. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  656. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  657. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  658. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  659. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  660. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  661. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  662. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  663. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  664. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  665. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  666. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  667. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  668. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  669. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  670. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  671. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  672. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  673. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  674. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  675. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  676. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  677. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  678. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  679. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  680. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  681. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  682. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  683. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  684. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  685. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  686. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  687. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  688. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  689. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  690. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  691. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  692. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  693. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  694. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  695. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  696. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  697. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  698. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  699. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  700. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  701. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  702. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  703. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  704. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  705. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  706. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  707. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  708. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  709. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  710. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  711. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  712. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  713. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  714. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  715. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  716. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  717. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  718. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  719. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  720. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  721. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  722. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  723. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  724. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  725. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  726. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  727. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  728. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  729. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  730. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  731. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  732. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  733. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  734. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  735. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  736. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  737. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  738. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  739. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  740. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  741. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  742. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  743. HTT_STATS_MAX_TAG,
  744. } htt_stats_tlv_tag_t;
  745. /* retain deprecated enum name as an alias for the current enum name */
  746. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  747. #define HTT_STATS_TLV_TAG_M 0x00000fff
  748. #define HTT_STATS_TLV_TAG_S 0
  749. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  750. #define HTT_STATS_TLV_LENGTH_S 12
  751. #define HTT_STATS_TLV_TAG_GET(_var) \
  752. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  753. HTT_STATS_TLV_TAG_S)
  754. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  755. do { \
  756. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  757. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  758. } while (0)
  759. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  760. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  761. HTT_STATS_TLV_LENGTH_S)
  762. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  763. do { \
  764. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  765. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  766. } while (0)
  767. /*=== host -> target messages ===============================================*/
  768. enum htt_h2t_msg_type {
  769. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  770. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  771. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  772. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  773. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  774. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  775. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  776. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  777. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  778. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  779. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  780. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  781. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  782. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  783. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  784. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  785. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  786. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  787. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  788. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  789. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  790. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  791. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  792. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  793. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  794. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  795. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  796. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  797. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  798. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  799. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  800. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  801. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  802. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  803. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  804. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  805. /* keep this last */
  806. HTT_H2T_NUM_MSGS
  807. };
  808. /*
  809. * HTT host to target message type -
  810. * stored in bits 7:0 of the first word of the message
  811. */
  812. #define HTT_H2T_MSG_TYPE_M 0xff
  813. #define HTT_H2T_MSG_TYPE_S 0
  814. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  815. do { \
  816. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  817. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  818. } while (0)
  819. #define HTT_H2T_MSG_TYPE_GET(word) \
  820. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  821. /**
  822. * @brief host -> target version number request message definition
  823. *
  824. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  825. *
  826. *
  827. * |31 24|23 16|15 8|7 0|
  828. * |----------------+----------------+----------------+----------------|
  829. * | reserved | msg type |
  830. * |-------------------------------------------------------------------|
  831. * : option request TLV (optional) |
  832. * :...................................................................:
  833. *
  834. * The VER_REQ message may consist of a single 4-byte word, or may be
  835. * extended with TLVs that specify which HTT options the host is requesting
  836. * from the target.
  837. * The following option TLVs may be appended to the VER_REQ message:
  838. * - HL_SUPPRESS_TX_COMPL_IND
  839. * - HL_MAX_TX_QUEUE_GROUPS
  840. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  841. * may be appended to the VER_REQ message (but only one TLV of each type).
  842. *
  843. * Header fields:
  844. * - MSG_TYPE
  845. * Bits 7:0
  846. * Purpose: identifies this as a version number request message
  847. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  848. */
  849. #define HTT_VER_REQ_BYTES 4
  850. /* TBDXXX: figure out a reasonable number */
  851. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  852. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  853. /**
  854. * @brief HTT tx MSDU descriptor
  855. *
  856. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  857. *
  858. * @details
  859. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  860. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  861. * the target firmware needs for the FW's tx processing, particularly
  862. * for creating the HW msdu descriptor.
  863. * The same HTT tx descriptor is used for HL and LL systems, though
  864. * a few fields within the tx descriptor are used only by LL or
  865. * only by HL.
  866. * The HTT tx descriptor is defined in two manners: by a struct with
  867. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  868. * definitions.
  869. * The target should use the struct def, for simplicitly and clarity,
  870. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  871. * neutral. Specifically, the host shall use the get/set macros built
  872. * around the mask + shift defs.
  873. */
  874. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  875. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  876. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  877. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  878. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  879. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  880. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  881. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  882. #define HTT_TX_VDEV_ID_WORD 0
  883. #define HTT_TX_VDEV_ID_MASK 0x3f
  884. #define HTT_TX_VDEV_ID_SHIFT 16
  885. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  886. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  887. #define HTT_TX_MSDU_LEN_DWORD 1
  888. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  889. /*
  890. * HTT_VAR_PADDR macros
  891. * Allow physical / bus addresses to be either a single 32-bit value,
  892. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  893. */
  894. #define HTT_VAR_PADDR32(var_name) \
  895. A_UINT32 var_name
  896. #define HTT_VAR_PADDR64_LE(var_name) \
  897. struct { \
  898. /* little-endian: lo precedes hi */ \
  899. A_UINT32 lo; \
  900. A_UINT32 hi; \
  901. } var_name
  902. /*
  903. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  904. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  905. * addresses are stored in a XXX-bit field.
  906. * This macro is used to define both htt_tx_msdu_desc32_t and
  907. * htt_tx_msdu_desc64_t structs.
  908. */
  909. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  910. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  911. { \
  912. /* DWORD 0: flags and meta-data */ \
  913. A_UINT32 \
  914. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  915. \
  916. /* pkt_subtype - \
  917. * Detailed specification of the tx frame contents, extending the \
  918. * general specification provided by pkt_type. \
  919. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  920. * pkt_type | pkt_subtype \
  921. * ============================================================== \
  922. * 802.3 | bit 0:3 - Reserved \
  923. * | bit 4: 0x0 - Copy-Engine Classification Results \
  924. * | not appended to the HTT message \
  925. * | 0x1 - Copy-Engine Classification Results \
  926. * | appended to the HTT message in the \
  927. * | format: \
  928. * | [HTT tx desc, frame header, \
  929. * | CE classification results] \
  930. * | The CE classification results begin \
  931. * | at the next 4-byte boundary after \
  932. * | the frame header. \
  933. * ------------+------------------------------------------------- \
  934. * Eth2 | bit 0:3 - Reserved \
  935. * | bit 4: 0x0 - Copy-Engine Classification Results \
  936. * | not appended to the HTT message \
  937. * | 0x1 - Copy-Engine Classification Results \
  938. * | appended to the HTT message. \
  939. * | See the above specification of the \
  940. * | CE classification results location. \
  941. * ------------+------------------------------------------------- \
  942. * native WiFi | bit 0:3 - Reserved \
  943. * | bit 4: 0x0 - Copy-Engine Classification Results \
  944. * | not appended to the HTT message \
  945. * | 0x1 - Copy-Engine Classification Results \
  946. * | appended to the HTT message. \
  947. * | See the above specification of the \
  948. * | CE classification results location. \
  949. * ------------+------------------------------------------------- \
  950. * mgmt | 0x0 - 802.11 MAC header absent \
  951. * | 0x1 - 802.11 MAC header present \
  952. * ------------+------------------------------------------------- \
  953. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  954. * | 0x1 - 802.11 MAC header present \
  955. * | bit 1: 0x0 - allow aggregation \
  956. * | 0x1 - don't allow aggregation \
  957. * | bit 2: 0x0 - perform encryption \
  958. * | 0x1 - don't perform encryption \
  959. * | bit 3: 0x0 - perform tx classification / queuing \
  960. * | 0x1 - don't perform tx classification; \
  961. * | insert the frame into the "misc" \
  962. * | tx queue \
  963. * | bit 4: 0x0 - Copy-Engine Classification Results \
  964. * | not appended to the HTT message \
  965. * | 0x1 - Copy-Engine Classification Results \
  966. * | appended to the HTT message. \
  967. * | See the above specification of the \
  968. * | CE classification results location. \
  969. */ \
  970. pkt_subtype: 5, \
  971. \
  972. /* pkt_type - \
  973. * General specification of the tx frame contents. \
  974. * The htt_pkt_type enum should be used to specify and check the \
  975. * value of this field. \
  976. */ \
  977. pkt_type: 3, \
  978. \
  979. /* vdev_id - \
  980. * ID for the vdev that is sending this tx frame. \
  981. * For certain non-standard packet types, e.g. pkt_type == raw \
  982. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  983. * This field is used primarily for determining where to queue \
  984. * broadcast and multicast frames. \
  985. */ \
  986. vdev_id: 6, \
  987. /* ext_tid - \
  988. * The extended traffic ID. \
  989. * If the TID is unknown, the extended TID is set to \
  990. * HTT_TX_EXT_TID_INVALID. \
  991. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  992. * value of the QoS TID. \
  993. * If the tx frame is non-QoS data, then the extended TID is set to \
  994. * HTT_TX_EXT_TID_NON_QOS. \
  995. * If the tx frame is multicast or broadcast, then the extended TID \
  996. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  997. */ \
  998. ext_tid: 5, \
  999. \
  1000. /* postponed - \
  1001. * This flag indicates whether the tx frame has been downloaded to \
  1002. * the target before but discarded by the target, and now is being \
  1003. * downloaded again; or if this is a new frame that is being \
  1004. * downloaded for the first time. \
  1005. * This flag allows the target to determine the correct order for \
  1006. * transmitting new vs. old frames. \
  1007. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1008. * This flag only applies to HL systems, since in LL systems, \
  1009. * the tx flow control is handled entirely within the target. \
  1010. */ \
  1011. postponed: 1, \
  1012. \
  1013. /* extension - \
  1014. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1015. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1016. * \
  1017. * 0x0 - no extension MSDU descriptor is present \
  1018. * 0x1 - an extension MSDU descriptor immediately follows the \
  1019. * regular MSDU descriptor \
  1020. */ \
  1021. extension: 1, \
  1022. \
  1023. /* cksum_offload - \
  1024. * This flag indicates whether checksum offload is enabled or not \
  1025. * for this frame. Target FW use this flag to turn on HW checksumming \
  1026. * 0x0 - No checksum offload \
  1027. * 0x1 - L3 header checksum only \
  1028. * 0x2 - L4 checksum only \
  1029. * 0x3 - L3 header checksum + L4 checksum \
  1030. */ \
  1031. cksum_offload: 2, \
  1032. \
  1033. /* tx_comp_req - \
  1034. * This flag indicates whether Tx Completion \
  1035. * from fw is required or not. \
  1036. * This flag is only relevant if tx completion is not \
  1037. * universally enabled. \
  1038. * For all LL systems, tx completion is mandatory, \
  1039. * so this flag will be irrelevant. \
  1040. * For HL systems tx completion is optional, but HL systems in which \
  1041. * the bus throughput exceeds the WLAN throughput will \
  1042. * probably want to always use tx completion, and thus \
  1043. * would not check this flag. \
  1044. * This flag is required when tx completions are not used universally, \
  1045. * but are still required for certain tx frames for which \
  1046. * an OTA delivery acknowledgment is needed by the host. \
  1047. * In practice, this would be for HL systems in which the \
  1048. * bus throughput is less than the WLAN throughput. \
  1049. * \
  1050. * 0x0 - Tx Completion Indication from Fw not required \
  1051. * 0x1 - Tx Completion Indication from Fw is required \
  1052. */ \
  1053. tx_compl_req: 1; \
  1054. \
  1055. \
  1056. /* DWORD 1: MSDU length and ID */ \
  1057. A_UINT32 \
  1058. len: 16, /* MSDU length, in bytes */ \
  1059. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1060. * and this id is used to calculate fragmentation \
  1061. * descriptor pointer inside the target based on \
  1062. * the base address, configured inside the target. \
  1063. */ \
  1064. \
  1065. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1066. /* frags_desc_ptr - \
  1067. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1068. * where the tx frame's fragments reside in memory. \
  1069. * This field only applies to LL systems, since in HL systems the \
  1070. * (degenerate single-fragment) fragmentation descriptor is created \
  1071. * within the target. \
  1072. */ \
  1073. _paddr__frags_desc_ptr_; \
  1074. \
  1075. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1076. /* \
  1077. * Peer ID : Target can use this value to know which peer-id packet \
  1078. * destined to. \
  1079. * It's intended to be specified by host in case of NAWDS. \
  1080. */ \
  1081. A_UINT16 peerid; \
  1082. \
  1083. /* \
  1084. * Channel frequency: This identifies the desired channel \
  1085. * frequency (in mhz) for tx frames. This is used by FW to help \
  1086. * determine when it is safe to transmit or drop frames for \
  1087. * off-channel operation. \
  1088. * The default value of zero indicates to FW that the corresponding \
  1089. * VDEV's home channel (if there is one) is the desired channel \
  1090. * frequency. \
  1091. */ \
  1092. A_UINT16 chanfreq; \
  1093. \
  1094. /* Reason reserved is commented is increasing the htt structure size \
  1095. * leads to some weird issues. \
  1096. * A_UINT32 reserved_dword3_bits0_31; \
  1097. */ \
  1098. } POSTPACK
  1099. /* define a htt_tx_msdu_desc32_t type */
  1100. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1101. /* define a htt_tx_msdu_desc64_t type */
  1102. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1103. /*
  1104. * Make htt_tx_msdu_desc_t be an alias for either
  1105. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1106. */
  1107. #if HTT_PADDR64
  1108. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1109. #else
  1110. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1111. #endif
  1112. /* decriptor information for Management frame*/
  1113. /*
  1114. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1115. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1116. */
  1117. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1118. extern A_UINT32 mgmt_hdr_len;
  1119. PREPACK struct htt_mgmt_tx_desc_t {
  1120. A_UINT32 msg_type;
  1121. #if HTT_PADDR64
  1122. A_UINT64 frag_paddr; /* DMAble address of the data */
  1123. #else
  1124. A_UINT32 frag_paddr; /* DMAble address of the data */
  1125. #endif
  1126. A_UINT32 desc_id; /* returned to host during completion
  1127. * to free the meory*/
  1128. A_UINT32 len; /* Fragment length */
  1129. A_UINT32 vdev_id; /* virtual device ID*/
  1130. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1131. } POSTPACK;
  1132. PREPACK struct htt_mgmt_tx_compl_ind {
  1133. A_UINT32 desc_id;
  1134. A_UINT32 status;
  1135. } POSTPACK;
  1136. /*
  1137. * This SDU header size comes from the summation of the following:
  1138. * 1. Max of:
  1139. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1140. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1141. * b. 802.11 header, for raw frames: 36 bytes
  1142. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1143. * QoS header, HT header)
  1144. * c. 802.3 header, for ethernet frames: 14 bytes
  1145. * (destination address, source address, ethertype / length)
  1146. * 2. Max of:
  1147. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1148. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1149. * 3. 802.1Q VLAN header: 4 bytes
  1150. * 4. LLC/SNAP header: 8 bytes
  1151. */
  1152. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1153. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1154. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1155. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1156. A_COMPILE_TIME_ASSERT(
  1157. htt_encap_hdr_size_max_check_nwifi,
  1158. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1159. A_COMPILE_TIME_ASSERT(
  1160. htt_encap_hdr_size_max_check_enet,
  1161. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1162. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1163. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1164. #define HTT_TX_HDR_SIZE_802_1Q 4
  1165. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1166. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1167. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1168. HTT_TX_HDR_SIZE_802_1Q + \
  1169. HTT_TX_HDR_SIZE_LLC_SNAP)
  1170. #define HTT_HL_TX_FRM_HDR_LEN \
  1171. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1172. #define HTT_LL_TX_FRM_HDR_LEN \
  1173. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1174. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1175. /* dword 0 */
  1176. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1177. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1178. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1179. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1180. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1181. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1182. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1183. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1184. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1185. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1186. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1187. #define HTT_TX_DESC_PKT_TYPE_S 13
  1188. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1189. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1190. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1191. #define HTT_TX_DESC_VDEV_ID_S 16
  1192. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1193. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1194. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1195. #define HTT_TX_DESC_EXT_TID_S 22
  1196. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1197. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1198. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1199. #define HTT_TX_DESC_POSTPONED_S 27
  1200. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1201. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1202. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1203. #define HTT_TX_DESC_EXTENSION_S 28
  1204. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1205. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1206. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1207. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1208. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1209. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1210. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1211. #define HTT_TX_DESC_TX_COMP_S 31
  1212. /* dword 1 */
  1213. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1214. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1215. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1216. #define HTT_TX_DESC_FRM_LEN_S 0
  1217. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1218. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1219. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1220. #define HTT_TX_DESC_FRM_ID_S 16
  1221. /* dword 2 */
  1222. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1223. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1224. /* for systems using 64-bit format for bus addresses */
  1225. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1226. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1227. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1228. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1229. /* for systems using 32-bit format for bus addresses */
  1230. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1231. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1232. /* dword 3 */
  1233. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1234. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1235. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1236. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1237. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1238. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1239. #if HTT_PADDR64
  1240. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1241. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1242. #else
  1243. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1244. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1245. #endif
  1246. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1247. #define HTT_TX_DESC_PEER_ID_S 0
  1248. /*
  1249. * TEMPORARY:
  1250. * The original definitions for the PEER_ID fields contained typos
  1251. * (with _DESC_PADDR appended to this PEER_ID field name).
  1252. * Retain deprecated original names for PEER_ID fields until all code that
  1253. * refers to them has been updated.
  1254. */
  1255. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1256. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1257. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1258. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1259. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1260. HTT_TX_DESC_PEER_ID_M
  1261. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1262. HTT_TX_DESC_PEER_ID_S
  1263. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1264. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1265. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1266. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1267. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1268. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1269. #if HTT_PADDR64
  1270. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1271. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1272. #else
  1273. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1274. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1275. #endif
  1276. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1277. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1278. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1279. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1280. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1283. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1284. } while (0)
  1285. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1286. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1287. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1288. do { \
  1289. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1290. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1291. } while (0)
  1292. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1293. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1294. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1295. do { \
  1296. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1297. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1298. } while (0)
  1299. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1300. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1301. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1302. do { \
  1303. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1304. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1305. } while (0)
  1306. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1307. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1308. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1312. } while (0)
  1313. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1314. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1315. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1316. do { \
  1317. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1318. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1319. } while (0)
  1320. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1321. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1322. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1323. do { \
  1324. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1325. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1326. } while (0)
  1327. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1328. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1329. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1330. do { \
  1331. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1332. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1333. } while (0)
  1334. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1335. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1336. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1337. do { \
  1338. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1339. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1340. } while (0)
  1341. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1342. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1343. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1344. do { \
  1345. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1346. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1347. } while (0)
  1348. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1349. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1350. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1354. } while (0)
  1355. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1356. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1357. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1360. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1361. } while (0)
  1362. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1363. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1364. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1365. do { \
  1366. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1367. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1368. } while (0)
  1369. /* enums used in the HTT tx MSDU extension descriptor */
  1370. enum {
  1371. htt_tx_guard_interval_regular = 0,
  1372. htt_tx_guard_interval_short = 1,
  1373. };
  1374. enum {
  1375. htt_tx_preamble_type_ofdm = 0,
  1376. htt_tx_preamble_type_cck = 1,
  1377. htt_tx_preamble_type_ht = 2,
  1378. htt_tx_preamble_type_vht = 3,
  1379. };
  1380. enum {
  1381. htt_tx_bandwidth_5MHz = 0,
  1382. htt_tx_bandwidth_10MHz = 1,
  1383. htt_tx_bandwidth_20MHz = 2,
  1384. htt_tx_bandwidth_40MHz = 3,
  1385. htt_tx_bandwidth_80MHz = 4,
  1386. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1387. };
  1388. /**
  1389. * @brief HTT tx MSDU extension descriptor
  1390. * @details
  1391. * If the target supports HTT tx MSDU extension descriptors, the host has
  1392. * the option of appending the following struct following the regular
  1393. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1394. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1395. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1396. * tx specs for each frame.
  1397. */
  1398. PREPACK struct htt_tx_msdu_desc_ext_t {
  1399. /* DWORD 0: flags */
  1400. A_UINT32
  1401. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1402. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1403. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1404. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1405. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1406. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1407. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1408. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1409. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1410. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1411. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1412. /* DWORD 1: tx power, tx rate, tx BW */
  1413. A_UINT32
  1414. /* pwr -
  1415. * Specify what power the tx frame needs to be transmitted at.
  1416. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1417. * The value needs to be appropriately sign-extended when extracting
  1418. * the value from the message and storing it in a variable that is
  1419. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1420. * automatically handles this sign-extension.)
  1421. * If the transmission uses multiple tx chains, this power spec is
  1422. * the total transmit power, assuming incoherent combination of
  1423. * per-chain power to produce the total power.
  1424. */
  1425. pwr: 8,
  1426. /* mcs_mask -
  1427. * Specify the allowable values for MCS index (modulation and coding)
  1428. * to use for transmitting the frame.
  1429. *
  1430. * For HT / VHT preamble types, this mask directly corresponds to
  1431. * the HT or VHT MCS indices that are allowed. For each bit N set
  1432. * within the mask, MCS index N is allowed for transmitting the frame.
  1433. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1434. * rates versus OFDM rates, so the host has the option of specifying
  1435. * that the target must transmit the frame with CCK or OFDM rates
  1436. * (not HT or VHT), but leaving the decision to the target whether
  1437. * to use CCK or OFDM.
  1438. *
  1439. * For CCK and OFDM, the bits within this mask are interpreted as
  1440. * follows:
  1441. * bit 0 -> CCK 1 Mbps rate is allowed
  1442. * bit 1 -> CCK 2 Mbps rate is allowed
  1443. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1444. * bit 3 -> CCK 11 Mbps rate is allowed
  1445. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1446. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1447. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1448. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1449. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1450. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1451. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1452. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1453. *
  1454. * The MCS index specification needs to be compatible with the
  1455. * bandwidth mask specification. For example, a MCS index == 9
  1456. * specification is inconsistent with a preamble type == VHT,
  1457. * Nss == 1, and channel bandwidth == 20 MHz.
  1458. *
  1459. * Furthermore, the host has only a limited ability to specify to
  1460. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1461. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1462. */
  1463. mcs_mask: 12,
  1464. /* nss_mask -
  1465. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1466. * Each bit in this mask corresponds to a Nss value:
  1467. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1468. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1469. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1470. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1471. * The values in the Nss mask must be suitable for the recipient, e.g.
  1472. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1473. * recipient which only supports 2x2 MIMO.
  1474. */
  1475. nss_mask: 4,
  1476. /* guard_interval -
  1477. * Specify a htt_tx_guard_interval enum value to indicate whether
  1478. * the transmission should use a regular guard interval or a
  1479. * short guard interval.
  1480. */
  1481. guard_interval: 1,
  1482. /* preamble_type_mask -
  1483. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1484. * may choose from for transmitting this frame.
  1485. * The bits in this mask correspond to the values in the
  1486. * htt_tx_preamble_type enum. For example, to allow the target
  1487. * to transmit the frame as either CCK or OFDM, this field would
  1488. * be set to
  1489. * (1 << htt_tx_preamble_type_ofdm) |
  1490. * (1 << htt_tx_preamble_type_cck)
  1491. */
  1492. preamble_type_mask: 4,
  1493. reserved1_31_29: 3; /* unused, set to 0x0 */
  1494. /* DWORD 2: tx chain mask, tx retries */
  1495. A_UINT32
  1496. /* chain_mask - specify which chains to transmit from */
  1497. chain_mask: 4,
  1498. /* retry_limit -
  1499. * Specify the maximum number of transmissions, including the
  1500. * initial transmission, to attempt before giving up if no ack
  1501. * is received.
  1502. * If the tx rate is specified, then all retries shall use the
  1503. * same rate as the initial transmission.
  1504. * If no tx rate is specified, the target can choose whether to
  1505. * retain the original rate during the retransmissions, or to
  1506. * fall back to a more robust rate.
  1507. */
  1508. retry_limit: 4,
  1509. /* bandwidth_mask -
  1510. * Specify what channel widths may be used for the transmission.
  1511. * A value of zero indicates "don't care" - the target may choose
  1512. * the transmission bandwidth.
  1513. * The bits within this mask correspond to the htt_tx_bandwidth
  1514. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1515. * The bandwidth_mask must be consistent with the preamble_type_mask
  1516. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1517. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1518. */
  1519. bandwidth_mask: 6,
  1520. reserved2_31_14: 18; /* unused, set to 0x0 */
  1521. /* DWORD 3: tx expiry time (TSF) LSBs */
  1522. A_UINT32 expire_tsf_lo;
  1523. /* DWORD 4: tx expiry time (TSF) MSBs */
  1524. A_UINT32 expire_tsf_hi;
  1525. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1526. } POSTPACK;
  1527. /* DWORD 0 */
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1548. /* DWORD 1 */
  1549. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1550. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1551. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1552. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1553. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1554. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1555. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1556. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1557. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1558. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1559. /* DWORD 2 */
  1560. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1561. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1562. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1563. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1564. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1565. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1566. /* DWORD 0 */
  1567. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1568. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1569. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1571. do { \
  1572. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1573. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1574. } while (0)
  1575. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1576. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1577. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1579. do { \
  1580. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1581. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1582. } while (0)
  1583. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1584. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1585. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1586. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1587. do { \
  1588. HTT_CHECK_SET_VAL( \
  1589. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1590. ((_var) |= ((_val) \
  1591. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1592. } while (0)
  1593. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1594. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1595. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1596. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1597. do { \
  1598. HTT_CHECK_SET_VAL( \
  1599. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1600. ((_var) |= ((_val) \
  1601. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1605. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1606. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1613. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1614. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1621. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1622. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1625. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1626. } while (0)
  1627. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1628. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1629. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1630. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1631. do { \
  1632. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1633. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1634. } while (0)
  1635. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1637. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1638. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1641. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1642. } while (0)
  1643. /* DWORD 1 */
  1644. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1646. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1647. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1648. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1649. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1650. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1651. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1652. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1653. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1655. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1656. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1659. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1663. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1664. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1667. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1668. } while (0)
  1669. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1670. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1671. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1672. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1673. do { \
  1674. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1675. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1676. } while (0)
  1677. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1678. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1679. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1680. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1683. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1684. } while (0)
  1685. /* DWORD 2 */
  1686. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1687. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1688. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1689. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1690. do { \
  1691. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1692. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1693. } while (0)
  1694. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1695. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1696. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1697. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1698. do { \
  1699. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1700. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1701. } while (0)
  1702. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1703. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1704. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1705. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1706. do { \
  1707. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1708. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1709. } while (0)
  1710. typedef enum {
  1711. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1712. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1713. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1714. } htt_11ax_ltf_subtype_t;
  1715. typedef enum {
  1716. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1717. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1718. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1719. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1720. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1721. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1722. } htt_tx_ext2_preamble_type_t;
  1723. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1725. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1726. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1727. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1729. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1730. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1731. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1732. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1733. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1735. /**
  1736. * @brief HTT tx MSDU extension descriptor v2
  1737. * @details
  1738. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1739. * is received as tcl_exit_base->host_meta_info in firmware.
  1740. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1741. * are already part of tcl_exit_base.
  1742. */
  1743. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1744. /* DWORD 0: flags */
  1745. A_UINT32
  1746. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1747. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1748. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1749. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1750. valid_retries : 1, /* if set, tx retries spec is valid */
  1751. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1752. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1753. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1754. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1755. valid_key_flags : 1, /* if set, key flags is valid */
  1756. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1757. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1758. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1759. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1760. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1761. 1 = ENCRYPT,
  1762. 2 ~ 3 - Reserved */
  1763. /* retry_limit -
  1764. * Specify the maximum number of transmissions, including the
  1765. * initial transmission, to attempt before giving up if no ack
  1766. * is received.
  1767. * If the tx rate is specified, then all retries shall use the
  1768. * same rate as the initial transmission.
  1769. * If no tx rate is specified, the target can choose whether to
  1770. * retain the original rate during the retransmissions, or to
  1771. * fall back to a more robust rate.
  1772. */
  1773. retry_limit : 4,
  1774. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1775. * Valid only for 11ax preamble types HE_SU
  1776. * and HE_EXT_SU
  1777. */
  1778. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1779. * Valid only for 11ax preamble types HE_SU
  1780. * and HE_EXT_SU
  1781. */
  1782. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1783. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1784. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1785. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1786. */
  1787. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1788. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1789. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1790. * Use cases:
  1791. * Any time firmware uses TQM-BYPASS for Data
  1792. * TID, firmware expect host to set this bit.
  1793. */
  1794. /* DWORD 1: tx power, tx rate */
  1795. A_UINT32
  1796. power : 8, /* unit of the power field is 0.5 dbm
  1797. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1798. * signed value ranging from -64dbm to 63.5 dbm
  1799. */
  1800. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1801. * Setting more than one MCS isn't currently
  1802. * supported by the target (but is supported
  1803. * in the interface in case in the future
  1804. * the target supports specifications of
  1805. * a limited set of MCS values.
  1806. */
  1807. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1808. * Setting more than one Nss isn't currently
  1809. * supported by the target (but is supported
  1810. * in the interface in case in the future
  1811. * the target supports specifications of
  1812. * a limited set of Nss values.
  1813. */
  1814. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1815. update_peer_cache : 1; /* When set these custom values will be
  1816. * used for all packets, until the next
  1817. * update via this ext header.
  1818. * This is to make sure not all packets
  1819. * need to include this header.
  1820. */
  1821. /* DWORD 2: tx chain mask, tx retries */
  1822. A_UINT32
  1823. /* chain_mask - specify which chains to transmit from */
  1824. chain_mask : 8,
  1825. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1826. * TODO: Update Enum values for key_flags
  1827. */
  1828. /*
  1829. * Channel frequency: This identifies the desired channel
  1830. * frequency (in MHz) for tx frames. This is used by FW to help
  1831. * determine when it is safe to transmit or drop frames for
  1832. * off-channel operation.
  1833. * The default value of zero indicates to FW that the corresponding
  1834. * VDEV's home channel (if there is one) is the desired channel
  1835. * frequency.
  1836. */
  1837. chanfreq : 16;
  1838. /* DWORD 3: tx expiry time (TSF) LSBs */
  1839. A_UINT32 expire_tsf_lo;
  1840. /* DWORD 4: tx expiry time (TSF) MSBs */
  1841. A_UINT32 expire_tsf_hi;
  1842. /* DWORD 5: flags to control routing / processing of the MSDU */
  1843. A_UINT32
  1844. /* learning_frame
  1845. * When this flag is set, this frame will be dropped by FW
  1846. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1847. */
  1848. learning_frame : 1,
  1849. /* send_as_standalone
  1850. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1851. * i.e. with no A-MSDU or A-MPDU aggregation.
  1852. * The scope is extended to other use-cases.
  1853. */
  1854. send_as_standalone : 1,
  1855. /* is_host_opaque_valid
  1856. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1857. * with valid information.
  1858. */
  1859. is_host_opaque_valid : 1,
  1860. traffic_end_indication: 1,
  1861. rsvd0 : 28;
  1862. /* DWORD 6 : Host opaque cookie for special frames */
  1863. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1864. rsvd1 : 16;
  1865. /*
  1866. * This structure can be expanded further up to 40 bytes
  1867. * by adding further DWORDs as needed.
  1868. */
  1869. } POSTPACK;
  1870. /* DWORD 0 */
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1897. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1898. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1899. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1900. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1901. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1902. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1903. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1904. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1905. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1906. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1907. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1908. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1909. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1910. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1911. /* DWORD 1 */
  1912. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1913. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1914. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1915. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1916. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1917. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1918. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1919. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1920. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1921. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1922. /* DWORD 2 */
  1923. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1924. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1925. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1926. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1927. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1928. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1929. /* DWORD 5 */
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1936. /* DWORD 6 */
  1937. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1938. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1939. /* DWORD 0 */
  1940. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1941. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1942. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1944. do { \
  1945. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1946. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1947. } while (0)
  1948. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1949. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1950. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1952. do { \
  1953. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1954. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1955. } while (0)
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1957. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1958. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1960. do { \
  1961. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1962. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1963. } while (0)
  1964. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1965. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1966. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1968. do { \
  1969. HTT_CHECK_SET_VAL( \
  1970. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1971. ((_var) |= ((_val) \
  1972. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1973. } while (0)
  1974. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1975. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1976. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1977. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1980. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1981. } while (0)
  1982. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1983. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1984. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1985. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1988. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1989. } while (0)
  1990. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1991. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1992. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1993. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1994. do { \
  1995. HTT_CHECK_SET_VAL( \
  1996. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1997. ((_var) |= ((_val) \
  1998. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1999. } while (0)
  2000. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2001. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2002. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2003. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2004. do { \
  2005. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2006. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2007. } while (0)
  2008. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2009. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2010. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2011. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2014. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2015. } while (0)
  2016. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2017. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2018. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2019. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2020. do { \
  2021. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2022. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2023. } while (0)
  2024. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2025. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2026. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2027. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2028. do { \
  2029. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2030. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2031. } while (0)
  2032. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2033. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2034. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2035. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2036. do { \
  2037. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2038. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2039. } while (0)
  2040. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2041. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2042. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2043. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2044. do { \
  2045. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2046. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2047. } while (0)
  2048. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2049. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2050. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2051. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2052. do { \
  2053. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2054. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2055. } while (0)
  2056. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2057. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2058. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2059. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2063. } while (0)
  2064. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2065. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2066. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2067. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2071. } while (0)
  2072. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2073. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2074. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2075. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2078. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2079. } while (0)
  2080. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2081. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2082. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2083. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2087. } while (0)
  2088. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2089. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2090. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2091. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2095. } while (0)
  2096. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2097. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2098. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2099. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2103. } while (0)
  2104. /* DWORD 1 */
  2105. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2106. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2107. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2108. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2109. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2110. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2111. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2112. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2113. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2114. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2115. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2116. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2117. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2118. do { \
  2119. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2120. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2121. } while (0)
  2122. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2123. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2124. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2125. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2126. do { \
  2127. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2128. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2129. } while (0)
  2130. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2131. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2132. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2133. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2134. do { \
  2135. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2136. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2137. } while (0)
  2138. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2139. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2140. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2141. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2142. do { \
  2143. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2144. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2145. } while (0)
  2146. /* DWORD 2 */
  2147. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2148. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2149. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2150. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2151. do { \
  2152. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2153. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2154. } while (0)
  2155. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2156. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2157. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2158. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2162. } while (0)
  2163. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2164. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2165. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2166. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2170. } while (0)
  2171. /* DWORD 5 */
  2172. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2173. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2174. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2175. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2178. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2179. } while (0)
  2180. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2181. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2182. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2183. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2186. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2187. } while (0)
  2188. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2189. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2190. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2191. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2192. do { \
  2193. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2194. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2195. } while (0)
  2196. /* DWORD 6 */
  2197. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2198. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2199. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2200. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2201. do { \
  2202. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2203. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2204. } while (0)
  2205. typedef enum {
  2206. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2207. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2208. } htt_tcl_metadata_type;
  2209. /**
  2210. * @brief HTT TCL command number format
  2211. * @details
  2212. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2213. * available to firmware as tcl_exit_base->tcl_status_number.
  2214. * For regular / multicast packets host will send vdev and mac id and for
  2215. * NAWDS packets, host will send peer id.
  2216. * A_UINT32 is used to avoid endianness conversion problems.
  2217. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2218. */
  2219. typedef struct {
  2220. A_UINT32
  2221. type: 1, /* vdev_id based or peer_id based */
  2222. rsvd: 31;
  2223. } htt_tx_tcl_vdev_or_peer_t;
  2224. typedef struct {
  2225. A_UINT32
  2226. type: 1, /* vdev_id based or peer_id based */
  2227. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2228. vdev_id: 8,
  2229. pdev_id: 2,
  2230. host_inspected:1,
  2231. rsvd: 19;
  2232. } htt_tx_tcl_vdev_metadata;
  2233. typedef struct {
  2234. A_UINT32
  2235. type: 1, /* vdev_id based or peer_id based */
  2236. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2237. peer_id: 14,
  2238. rsvd: 16;
  2239. } htt_tx_tcl_peer_metadata;
  2240. PREPACK struct htt_tx_tcl_metadata {
  2241. union {
  2242. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2243. htt_tx_tcl_vdev_metadata vdev_meta;
  2244. htt_tx_tcl_peer_metadata peer_meta;
  2245. };
  2246. } POSTPACK;
  2247. /* DWORD 0 */
  2248. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2249. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2250. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2251. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2252. /* VDEV metadata */
  2253. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2254. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2255. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2256. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2257. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2258. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2259. /* PEER metadata */
  2260. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2261. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2262. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2263. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2264. HTT_TX_TCL_METADATA_TYPE_S)
  2265. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2269. } while (0)
  2270. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2271. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2272. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2273. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2277. } while (0)
  2278. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2279. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2280. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2281. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2285. } while (0)
  2286. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2287. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2288. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2289. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2290. do { \
  2291. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2292. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2293. } while (0)
  2294. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2295. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2296. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2297. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2298. do { \
  2299. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2300. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2301. } while (0)
  2302. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2303. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2304. HTT_TX_TCL_METADATA_PEER_ID_S)
  2305. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2306. do { \
  2307. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2308. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2309. } while (0)
  2310. /*------------------------------------------------------------------
  2311. * V2 Version of TCL Data Command
  2312. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2313. * MLO global_seq all flavours of TCL Data Cmd.
  2314. *-----------------------------------------------------------------*/
  2315. typedef enum {
  2316. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2317. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2318. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2319. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2320. } htt_tcl_metadata_type_v2;
  2321. /**
  2322. * @brief HTT TCL command number format
  2323. * @details
  2324. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2325. * available to firmware as tcl_exit_base->tcl_status_number.
  2326. * A_UINT32 is used to avoid endianness conversion problems.
  2327. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2328. */
  2329. typedef struct {
  2330. A_UINT32
  2331. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2332. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2333. vdev_id: 8,
  2334. pdev_id: 2,
  2335. host_inspected:1,
  2336. rsvd: 2,
  2337. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2338. } htt_tx_tcl_vdev_metadata_v2;
  2339. typedef struct {
  2340. A_UINT32
  2341. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2342. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2343. peer_id: 13,
  2344. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2345. } htt_tx_tcl_peer_metadata_v2;
  2346. typedef struct {
  2347. A_UINT32
  2348. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2349. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2350. svc_class_id: 8,
  2351. rsvd: 5,
  2352. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2353. } htt_tx_tcl_svc_class_id_metadata;
  2354. typedef struct {
  2355. A_UINT32
  2356. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2357. host_inspected: 1,
  2358. global_seq_no: 12,
  2359. rsvd: 1,
  2360. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2361. } htt_tx_tcl_global_seq_metadata;
  2362. PREPACK struct htt_tx_tcl_metadata_v2 {
  2363. union {
  2364. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2365. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2366. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2367. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2368. };
  2369. } POSTPACK;
  2370. /* DWORD 0 */
  2371. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2372. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2373. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2374. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2375. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2376. /* VDEV V2 metadata */
  2377. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2378. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2379. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2380. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2381. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2382. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2383. /* PEER V2 metadata */
  2384. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2385. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2386. /* SVC_CLASS_ID metadata */
  2387. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2388. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2389. /* Global Seq no metadata */
  2390. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2391. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2392. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2393. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2394. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2395. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2396. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2397. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2398. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2399. do { \
  2400. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2401. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2402. } while (0)
  2403. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2404. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2405. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2406. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2407. do { \
  2408. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2409. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2410. } while (0)
  2411. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2412. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2413. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2414. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2415. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2416. do { \
  2417. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2418. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2419. } while (0)
  2420. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2421. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2422. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2423. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2426. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2427. } while (0)
  2428. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2429. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2430. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2431. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2435. } while (0)
  2436. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2437. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2438. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2439. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2440. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2441. do { \
  2442. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2443. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2444. } while (0)
  2445. /*----- Get and Set V2 type field in Service Class fields ----*/
  2446. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2447. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2448. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2449. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2452. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2453. } while (0)
  2454. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2455. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2456. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2457. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2458. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2459. do { \
  2460. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2461. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2462. } while (0)
  2463. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2464. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2465. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2466. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2467. do { \
  2468. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2469. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2470. } while (0)
  2471. /*------------------------------------------------------------------
  2472. * End V2 Version of TCL Data Command
  2473. *-----------------------------------------------------------------*/
  2474. typedef enum {
  2475. HTT_TX_FW2WBM_TX_STATUS_OK,
  2476. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2477. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2478. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2479. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2480. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2481. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2482. HTT_TX_FW2WBM_TX_STATUS_MAX
  2483. } htt_tx_fw2wbm_tx_status_t;
  2484. typedef enum {
  2485. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2486. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2487. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2488. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2489. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2490. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2491. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2492. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2493. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2494. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2495. } htt_tx_fw2wbm_reinject_reason_t;
  2496. /**
  2497. * @brief HTT TX WBM Completion from firmware to host
  2498. * @details
  2499. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2500. * DWORD 3 and 4 for software based completions (Exception frames and
  2501. * TQM bypass frames)
  2502. * For software based completions, wbm_release_ring->release_source_module will
  2503. * be set to release_source_fw
  2504. */
  2505. PREPACK struct htt_tx_wbm_completion {
  2506. A_UINT32
  2507. sch_cmd_id: 24,
  2508. exception_frame: 1, /* If set, this packet was queued via exception path */
  2509. rsvd0_31_25: 7;
  2510. A_UINT32
  2511. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2512. * reception of an ACK or BA, this field indicates
  2513. * the RSSI of the received ACK or BA frame.
  2514. * When the frame is removed as result of a direct
  2515. * remove command from the SW, this field is set
  2516. * to 0x0 (which is never a valid value when real
  2517. * RSSI is available).
  2518. * Units: dB w.r.t noise floor
  2519. */
  2520. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2521. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2522. rsvd1_31_16: 16;
  2523. } POSTPACK;
  2524. /* DWORD 0 */
  2525. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2526. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2527. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2528. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2529. /* DWORD 1 */
  2530. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2531. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2532. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2533. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2534. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2535. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2536. /* DWORD 0 */
  2537. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2538. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2539. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2540. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2541. do { \
  2542. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2543. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2544. } while (0)
  2545. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2546. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2547. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2548. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2549. do { \
  2550. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2551. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2552. } while (0)
  2553. /* DWORD 1 */
  2554. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2555. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2556. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2557. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2558. do { \
  2559. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2560. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2561. } while (0)
  2562. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2563. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2564. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2565. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2566. do { \
  2567. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2568. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2569. } while (0)
  2570. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2571. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2572. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2573. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2574. do { \
  2575. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2576. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2577. } while (0)
  2578. /**
  2579. * @brief HTT TX WBM Completion from firmware to host
  2580. * @details
  2581. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2582. * (WBM) offload HW.
  2583. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2584. * For software based completions, release_source_module will
  2585. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2586. * struct wbm_release_ring and then switch to this after looking at
  2587. * release_source_module.
  2588. */
  2589. PREPACK struct htt_tx_wbm_completion_v2 {
  2590. A_UINT32
  2591. used_by_hw0; /* Refer to struct wbm_release_ring */
  2592. A_UINT32
  2593. used_by_hw1; /* Refer to struct wbm_release_ring */
  2594. A_UINT32
  2595. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2596. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2597. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2598. exception_frame: 1,
  2599. rsvd0: 12, /* For future use */
  2600. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2601. rsvd1: 1; /* For future use */
  2602. A_UINT32
  2603. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2604. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2605. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2606. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2607. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2608. */
  2609. A_UINT32
  2610. data1: 32;
  2611. A_UINT32
  2612. data2: 32;
  2613. A_UINT32
  2614. used_by_hw3; /* Refer to struct wbm_release_ring */
  2615. } POSTPACK;
  2616. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2617. /* DWORD 3 */
  2618. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2619. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2620. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2621. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2622. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2623. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2624. /* DWORD 3 */
  2625. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2626. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2627. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2628. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2629. do { \
  2630. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2631. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2632. } while (0)
  2633. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2634. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2635. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2636. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2637. do { \
  2638. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2639. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2640. } while (0)
  2641. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2642. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2643. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2644. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2645. do { \
  2646. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2647. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2648. } while (0)
  2649. /**
  2650. * @brief HTT TX WBM Completion from firmware to host (V3)
  2651. * @details
  2652. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2653. * (WBM) offload HW.
  2654. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2655. * For software based completions, release_source_module will
  2656. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2657. * struct wbm_release_ring and then switch to this after looking at
  2658. * release_source_module.
  2659. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2660. * by new generations of targets.
  2661. */
  2662. PREPACK struct htt_tx_wbm_completion_v3 {
  2663. A_UINT32
  2664. used_by_hw0; /* Refer to struct wbm_release_ring */
  2665. A_UINT32
  2666. used_by_hw1; /* Refer to struct wbm_release_ring */
  2667. A_UINT32
  2668. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2669. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2670. used_by_hw3: 15;
  2671. A_UINT32
  2672. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2673. exception_frame: 1,
  2674. rsvd0: 27; /* For future use */
  2675. A_UINT32
  2676. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2677. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2678. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2679. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2680. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2681. */
  2682. A_UINT32
  2683. data1: 32;
  2684. A_UINT32
  2685. data2: 32;
  2686. A_UINT32
  2687. rsvd1: 20,
  2688. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2689. } POSTPACK;
  2690. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2691. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2692. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2693. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2694. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2695. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2696. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2697. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2698. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2699. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2700. do { \
  2701. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2702. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2703. } while (0)
  2704. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2705. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2706. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2707. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2708. do { \
  2709. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2710. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2711. } while (0)
  2712. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2713. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2714. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2715. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2716. do { \
  2717. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2718. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2719. } while (0)
  2720. typedef enum {
  2721. TX_FRAME_TYPE_UNDEFINED = 0,
  2722. TX_FRAME_TYPE_EAPOL = 1,
  2723. } htt_tx_wbm_status_frame_type;
  2724. /**
  2725. * @brief HTT TX WBM transmit status from firmware to host
  2726. * @details
  2727. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2728. * (WBM) offload HW.
  2729. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2730. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2731. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2732. */
  2733. PREPACK struct htt_tx_wbm_transmit_status {
  2734. A_UINT32
  2735. sch_cmd_id: 24,
  2736. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2737. * reception of an ACK or BA, this field indicates
  2738. * the RSSI of the received ACK or BA frame.
  2739. * When the frame is removed as result of a direct
  2740. * remove command from the SW, this field is set
  2741. * to 0x0 (which is never a valid value when real
  2742. * RSSI is available).
  2743. * Units: dB w.r.t noise floor
  2744. */
  2745. A_UINT32
  2746. sw_peer_id: 16,
  2747. tid_num: 5,
  2748. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2749. * and tid_num fields contain valid data.
  2750. * If this "valid" flag is not set, the
  2751. * sw_peer_id and tid_num fields must be ignored.
  2752. */
  2753. mcast: 1,
  2754. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2755. * contains valid data.
  2756. */
  2757. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2758. reserved: 4;
  2759. A_UINT32
  2760. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2761. * packets in the wbm completion path
  2762. */
  2763. } POSTPACK;
  2764. /* DWORD 4 */
  2765. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2766. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2767. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2768. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2769. /* DWORD 5 */
  2770. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2771. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2772. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2773. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2774. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2775. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2776. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2777. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2778. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2779. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2780. /* DWORD 4 */
  2781. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2782. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2783. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2784. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2785. do { \
  2786. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2787. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2788. } while (0)
  2789. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2790. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2791. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2792. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2793. do { \
  2794. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2795. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2796. } while (0)
  2797. /* DWORD 5 */
  2798. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2799. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2800. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2801. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2802. do { \
  2803. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2804. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2805. } while (0)
  2806. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2807. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2808. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2809. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2812. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2813. } while (0)
  2814. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2815. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2816. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2817. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2818. do { \
  2819. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2820. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2821. } while (0)
  2822. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2823. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2824. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2825. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2826. do { \
  2827. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2828. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2829. } while (0)
  2830. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2831. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2832. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2833. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2834. do { \
  2835. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2836. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2837. } while (0)
  2838. /**
  2839. * @brief HTT TX WBM reinject status from firmware to host
  2840. * @details
  2841. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2842. * (WBM) offload HW.
  2843. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2844. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2845. */
  2846. PREPACK struct htt_tx_wbm_reinject_status {
  2847. A_UINT32
  2848. reserved0: 32;
  2849. A_UINT32
  2850. reserved1: 32;
  2851. A_UINT32
  2852. reserved2: 32;
  2853. } POSTPACK;
  2854. /**
  2855. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2856. * @details
  2857. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2858. * (WBM) offload HW.
  2859. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2860. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2861. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2862. * STA side.
  2863. */
  2864. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2865. A_UINT32
  2866. mec_sa_addr_31_0;
  2867. A_UINT32
  2868. mec_sa_addr_47_32: 16,
  2869. sa_ast_index: 16;
  2870. A_UINT32
  2871. vdev_id: 8,
  2872. reserved0: 24;
  2873. } POSTPACK;
  2874. /* DWORD 4 - mec_sa_addr_31_0 */
  2875. /* DWORD 5 */
  2876. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2877. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2878. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2879. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2880. /* DWORD 6 */
  2881. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2882. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2883. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2884. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2885. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2886. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2887. do { \
  2888. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2889. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2890. } while (0)
  2891. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2892. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2893. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2894. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2895. do { \
  2896. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2897. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2898. } while (0)
  2899. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2900. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2901. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2902. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2903. do { \
  2904. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2905. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2906. } while (0)
  2907. typedef enum {
  2908. TX_FLOW_PRIORITY_BE,
  2909. TX_FLOW_PRIORITY_HIGH,
  2910. TX_FLOW_PRIORITY_LOW,
  2911. } htt_tx_flow_priority_t;
  2912. typedef enum {
  2913. TX_FLOW_LATENCY_SENSITIVE,
  2914. TX_FLOW_LATENCY_INSENSITIVE,
  2915. } htt_tx_flow_latency_t;
  2916. typedef enum {
  2917. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2918. TX_FLOW_INTERACTIVE_TRAFFIC,
  2919. TX_FLOW_PERIODIC_TRAFFIC,
  2920. TX_FLOW_BURSTY_TRAFFIC,
  2921. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2922. } htt_tx_flow_traffic_pattern_t;
  2923. /**
  2924. * @brief HTT TX Flow search metadata format
  2925. * @details
  2926. * Host will set this metadata in flow table's flow search entry along with
  2927. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2928. * firmware and TQM ring if the flow search entry wins.
  2929. * This metadata is available to firmware in that first MSDU's
  2930. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2931. * to one of the available flows for specific tid and returns the tqm flow
  2932. * pointer as part of htt_tx_map_flow_info message.
  2933. */
  2934. PREPACK struct htt_tx_flow_metadata {
  2935. A_UINT32
  2936. rsvd0_1_0: 2,
  2937. tid: 4,
  2938. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2939. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2940. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2941. * Else choose final tid based on latency, priority.
  2942. */
  2943. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2944. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2945. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2946. } POSTPACK;
  2947. /* DWORD 0 */
  2948. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2949. #define HTT_TX_FLOW_METADATA_TID_S 2
  2950. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2951. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2952. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2953. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2954. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2955. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2956. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2957. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2958. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2959. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2960. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2961. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2962. /* DWORD 0 */
  2963. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2964. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2965. HTT_TX_FLOW_METADATA_TID_S)
  2966. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2969. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2970. } while (0)
  2971. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2972. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2973. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2974. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2975. do { \
  2976. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2977. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2978. } while (0)
  2979. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2980. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2981. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2982. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2983. do { \
  2984. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2985. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2986. } while (0)
  2987. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2988. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2989. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2990. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2991. do { \
  2992. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2993. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2994. } while (0)
  2995. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2996. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2997. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2998. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2999. do { \
  3000. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3001. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3002. } while (0)
  3003. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3004. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3005. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3006. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3007. do { \
  3008. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3009. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3010. } while (0)
  3011. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3012. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3013. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3014. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3015. do { \
  3016. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3017. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3018. } while (0)
  3019. /**
  3020. * @brief host -> target ADD WDS Entry
  3021. *
  3022. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3023. *
  3024. * @brief host -> target DELETE WDS Entry
  3025. *
  3026. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3027. *
  3028. * @details
  3029. * HTT wds entry from source port learning
  3030. * Host will learn wds entries from rx and send this message to firmware
  3031. * to enable firmware to configure/delete AST entries for wds clients.
  3032. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3033. * and when SA's entry is deleted, firmware removes this AST entry
  3034. *
  3035. * The message would appear as follows:
  3036. *
  3037. * |31 30|29 |17 16|15 8|7 0|
  3038. * |----------------+----------------+----------------+----------------|
  3039. * | rsvd0 |PDVID| vdev_id | msg_type |
  3040. * |-------------------------------------------------------------------|
  3041. * | sa_addr_31_0 |
  3042. * |-------------------------------------------------------------------|
  3043. * | | ta_peer_id | sa_addr_47_32 |
  3044. * |-------------------------------------------------------------------|
  3045. * Where PDVID = pdev_id
  3046. *
  3047. * The message is interpreted as follows:
  3048. *
  3049. * dword0 - b'0:7 - msg_type: This will be set to
  3050. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3051. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3052. *
  3053. * dword0 - b'8:15 - vdev_id
  3054. *
  3055. * dword0 - b'16:17 - pdev_id
  3056. *
  3057. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3058. *
  3059. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3060. *
  3061. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3062. *
  3063. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3064. */
  3065. PREPACK struct htt_wds_entry {
  3066. A_UINT32
  3067. msg_type: 8,
  3068. vdev_id: 8,
  3069. pdev_id: 2,
  3070. rsvd0: 14;
  3071. A_UINT32 sa_addr_31_0;
  3072. A_UINT32
  3073. sa_addr_47_32: 16,
  3074. ta_peer_id: 14,
  3075. rsvd2: 2;
  3076. } POSTPACK;
  3077. /* DWORD 0 */
  3078. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3079. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3080. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3081. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3082. /* DWORD 2 */
  3083. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3084. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3085. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3086. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3087. /* DWORD 0 */
  3088. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3089. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3090. HTT_WDS_ENTRY_VDEV_ID_S)
  3091. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3092. do { \
  3093. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3094. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3095. } while (0)
  3096. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3097. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3098. HTT_WDS_ENTRY_PDEV_ID_S)
  3099. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3100. do { \
  3101. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3102. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3103. } while (0)
  3104. /* DWORD 2 */
  3105. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3106. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3107. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3108. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3109. do { \
  3110. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3111. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3112. } while (0)
  3113. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3114. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3115. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3116. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3117. do { \
  3118. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3119. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3120. } while (0)
  3121. /**
  3122. * @brief MAC DMA rx ring setup specification
  3123. *
  3124. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3125. *
  3126. * @details
  3127. * To allow for dynamic rx ring reconfiguration and to avoid race
  3128. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3129. * it uses. Instead, it sends this message to the target, indicating how
  3130. * the rx ring used by the host should be set up and maintained.
  3131. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3132. * specifications.
  3133. *
  3134. * |31 16|15 8|7 0|
  3135. * |---------------------------------------------------------------|
  3136. * header: | reserved | num rings | msg type |
  3137. * |---------------------------------------------------------------|
  3138. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3139. #if HTT_PADDR64
  3140. * | FW_IDX shadow register physical address (bits 63:32) |
  3141. #endif
  3142. * |---------------------------------------------------------------|
  3143. * | rx ring base physical address (bits 31:0) |
  3144. #if HTT_PADDR64
  3145. * | rx ring base physical address (bits 63:32) |
  3146. #endif
  3147. * |---------------------------------------------------------------|
  3148. * | rx ring buffer size | rx ring length |
  3149. * |---------------------------------------------------------------|
  3150. * | FW_IDX initial value | enabled flags |
  3151. * |---------------------------------------------------------------|
  3152. * | MSDU payload offset | 802.11 header offset |
  3153. * |---------------------------------------------------------------|
  3154. * | PPDU end offset | PPDU start offset |
  3155. * |---------------------------------------------------------------|
  3156. * | MPDU end offset | MPDU start offset |
  3157. * |---------------------------------------------------------------|
  3158. * | MSDU end offset | MSDU start offset |
  3159. * |---------------------------------------------------------------|
  3160. * | frag info offset | rx attention offset |
  3161. * |---------------------------------------------------------------|
  3162. * payload 2, if present, has the same format as payload 1
  3163. * Header fields:
  3164. * - MSG_TYPE
  3165. * Bits 7:0
  3166. * Purpose: identifies this as an rx ring configuration message
  3167. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3168. * - NUM_RINGS
  3169. * Bits 15:8
  3170. * Purpose: indicates whether the host is setting up one rx ring or two
  3171. * Value: 1 or 2
  3172. * Payload:
  3173. * for systems using 64-bit format for bus addresses:
  3174. * - IDX_SHADOW_REG_PADDR_LO
  3175. * Bits 31:0
  3176. * Value: lower 4 bytes of physical address of the host's
  3177. * FW_IDX shadow register
  3178. * - IDX_SHADOW_REG_PADDR_HI
  3179. * Bits 31:0
  3180. * Value: upper 4 bytes of physical address of the host's
  3181. * FW_IDX shadow register
  3182. * - RING_BASE_PADDR_LO
  3183. * Bits 31:0
  3184. * Value: lower 4 bytes of physical address of the host's rx ring
  3185. * - RING_BASE_PADDR_HI
  3186. * Bits 31:0
  3187. * Value: uppper 4 bytes of physical address of the host's rx ring
  3188. * for systems using 32-bit format for bus addresses:
  3189. * - IDX_SHADOW_REG_PADDR
  3190. * Bits 31:0
  3191. * Value: physical address of the host's FW_IDX shadow register
  3192. * - RING_BASE_PADDR
  3193. * Bits 31:0
  3194. * Value: physical address of the host's rx ring
  3195. * - RING_LEN
  3196. * Bits 15:0
  3197. * Value: number of elements in the rx ring
  3198. * - RING_BUF_SZ
  3199. * Bits 31:16
  3200. * Value: size of the buffers referenced by the rx ring, in byte units
  3201. * - ENABLED_FLAGS
  3202. * Bits 15:0
  3203. * Value: 1-bit flags to show whether different rx fields are enabled
  3204. * bit 0: 802.11 header enabled (1) or disabled (0)
  3205. * bit 1: MSDU payload enabled (1) or disabled (0)
  3206. * bit 2: PPDU start enabled (1) or disabled (0)
  3207. * bit 3: PPDU end enabled (1) or disabled (0)
  3208. * bit 4: MPDU start enabled (1) or disabled (0)
  3209. * bit 5: MPDU end enabled (1) or disabled (0)
  3210. * bit 6: MSDU start enabled (1) or disabled (0)
  3211. * bit 7: MSDU end enabled (1) or disabled (0)
  3212. * bit 8: rx attention enabled (1) or disabled (0)
  3213. * bit 9: frag info enabled (1) or disabled (0)
  3214. * bit 10: unicast rx enabled (1) or disabled (0)
  3215. * bit 11: multicast rx enabled (1) or disabled (0)
  3216. * bit 12: ctrl rx enabled (1) or disabled (0)
  3217. * bit 13: mgmt rx enabled (1) or disabled (0)
  3218. * bit 14: null rx enabled (1) or disabled (0)
  3219. * bit 15: phy data rx enabled (1) or disabled (0)
  3220. * - IDX_INIT_VAL
  3221. * Bits 31:16
  3222. * Purpose: Specify the initial value for the FW_IDX.
  3223. * Value: the number of buffers initially present in the host's rx ring
  3224. * - OFFSET_802_11_HDR
  3225. * Bits 15:0
  3226. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3227. * - OFFSET_MSDU_PAYLOAD
  3228. * Bits 31:16
  3229. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3230. * - OFFSET_PPDU_START
  3231. * Bits 15:0
  3232. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3233. * - OFFSET_PPDU_END
  3234. * Bits 31:16
  3235. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3236. * - OFFSET_MPDU_START
  3237. * Bits 15:0
  3238. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3239. * - OFFSET_MPDU_END
  3240. * Bits 31:16
  3241. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3242. * - OFFSET_MSDU_START
  3243. * Bits 15:0
  3244. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3245. * - OFFSET_MSDU_END
  3246. * Bits 31:16
  3247. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3248. * - OFFSET_RX_ATTN
  3249. * Bits 15:0
  3250. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3251. * - OFFSET_FRAG_INFO
  3252. * Bits 31:16
  3253. * Value: offset in QUAD-bytes of frag info table
  3254. */
  3255. /* header fields */
  3256. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3257. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3258. /* payload fields */
  3259. /* for systems using a 64-bit format for bus addresses */
  3260. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3261. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3262. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3263. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3264. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3265. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3266. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3267. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3268. /* for systems using a 32-bit format for bus addresses */
  3269. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3270. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3271. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3272. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3273. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3274. #define HTT_RX_RING_CFG_LEN_S 0
  3275. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3276. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3277. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3278. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3279. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3280. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3281. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3282. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3283. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3284. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3285. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3286. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3287. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3288. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3289. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3290. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3291. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3292. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3293. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3294. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3295. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3296. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3297. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3298. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3299. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3300. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3301. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3302. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3303. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3304. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3305. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3306. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3307. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3308. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3309. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3310. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3311. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3312. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3313. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3314. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3315. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3316. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3317. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3318. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3319. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3320. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3321. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3322. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3323. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3324. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3325. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3326. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3327. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3328. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3329. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3330. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3331. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3332. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3333. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3334. #if HTT_PADDR64
  3335. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3336. #else
  3337. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3338. #endif
  3339. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3340. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3341. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3342. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3343. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3344. do { \
  3345. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3346. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3347. } while (0)
  3348. /* degenerate case for 32-bit fields */
  3349. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3350. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3351. ((_var) = (_val))
  3352. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3353. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3354. ((_var) = (_val))
  3355. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3356. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3357. ((_var) = (_val))
  3358. /* degenerate case for 32-bit fields */
  3359. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3360. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3361. ((_var) = (_val))
  3362. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3363. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3364. ((_var) = (_val))
  3365. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3366. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3367. ((_var) = (_val))
  3368. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3369. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3370. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3371. do { \
  3372. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3373. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3374. } while (0)
  3375. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3376. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3377. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3378. do { \
  3379. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3380. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3381. } while (0)
  3382. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3383. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3384. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3385. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3386. do { \
  3387. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3388. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3389. } while (0)
  3390. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3391. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3392. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3393. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3394. do { \
  3395. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3396. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3397. } while (0)
  3398. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3399. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3400. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3401. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3402. do { \
  3403. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3404. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3405. } while (0)
  3406. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3407. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3408. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3409. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3410. do { \
  3411. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3412. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3413. } while (0)
  3414. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3415. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3416. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3417. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3418. do { \
  3419. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3420. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3421. } while (0)
  3422. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3423. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3424. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3425. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3426. do { \
  3427. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3428. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3429. } while (0)
  3430. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3431. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3432. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3433. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3434. do { \
  3435. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3436. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3437. } while (0)
  3438. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3439. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3440. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3441. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3442. do { \
  3443. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3444. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3445. } while (0)
  3446. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3447. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3448. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3449. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3450. do { \
  3451. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3452. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3453. } while (0)
  3454. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3455. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3456. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3457. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3458. do { \
  3459. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3460. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3461. } while (0)
  3462. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3463. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3464. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3465. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3466. do { \
  3467. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3468. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3469. } while (0)
  3470. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3471. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3472. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3473. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3474. do { \
  3475. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3476. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3477. } while (0)
  3478. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3479. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3480. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3481. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3482. do { \
  3483. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3484. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3485. } while (0)
  3486. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3487. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3488. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3489. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3490. do { \
  3491. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3492. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3493. } while (0)
  3494. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3495. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3496. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3497. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3498. do { \
  3499. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3500. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3501. } while (0)
  3502. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3503. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3504. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3505. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3506. do { \
  3507. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3508. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3509. } while (0)
  3510. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3511. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3512. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3513. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3514. do { \
  3515. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3516. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3517. } while (0)
  3518. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3519. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3520. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3521. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3522. do { \
  3523. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3524. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3525. } while (0)
  3526. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3527. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3528. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3529. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3530. do { \
  3531. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3532. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3533. } while (0)
  3534. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3535. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3536. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3537. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3538. do { \
  3539. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3540. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3541. } while (0)
  3542. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3543. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3544. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3545. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3546. do { \
  3547. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3548. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3549. } while (0)
  3550. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3551. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3552. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3553. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3554. do { \
  3555. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3556. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3557. } while (0)
  3558. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3559. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3560. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3561. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3562. do { \
  3563. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3564. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3565. } while (0)
  3566. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3567. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3568. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3569. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3570. do { \
  3571. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3572. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3573. } while (0)
  3574. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3575. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3576. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3577. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3578. do { \
  3579. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3580. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3581. } while (0)
  3582. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3583. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3584. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3585. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3586. do { \
  3587. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3588. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3589. } while (0)
  3590. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3591. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3592. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3593. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3594. do { \
  3595. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3596. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3597. } while (0)
  3598. /**
  3599. * @brief host -> target FW statistics retrieve
  3600. *
  3601. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3602. *
  3603. * @details
  3604. * The following field definitions describe the format of the HTT host
  3605. * to target FW stats retrieve message. The message specifies the type of
  3606. * stats host wants to retrieve.
  3607. *
  3608. * |31 24|23 16|15 8|7 0|
  3609. * |-----------------------------------------------------------|
  3610. * | stats types request bitmask | msg type |
  3611. * |-----------------------------------------------------------|
  3612. * | stats types reset bitmask | reserved |
  3613. * |-----------------------------------------------------------|
  3614. * | stats type | config value |
  3615. * |-----------------------------------------------------------|
  3616. * | cookie LSBs |
  3617. * |-----------------------------------------------------------|
  3618. * | cookie MSBs |
  3619. * |-----------------------------------------------------------|
  3620. * Header fields:
  3621. * - MSG_TYPE
  3622. * Bits 7:0
  3623. * Purpose: identifies this is a stats upload request message
  3624. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3625. * - UPLOAD_TYPES
  3626. * Bits 31:8
  3627. * Purpose: identifies which types of FW statistics to upload
  3628. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3629. * - RESET_TYPES
  3630. * Bits 31:8
  3631. * Purpose: identifies which types of FW statistics to reset
  3632. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3633. * - CFG_VAL
  3634. * Bits 23:0
  3635. * Purpose: give an opaque configuration value to the specified stats type
  3636. * Value: stats-type specific configuration value
  3637. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3638. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3639. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3640. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3641. * - CFG_STAT_TYPE
  3642. * Bits 31:24
  3643. * Purpose: specify which stats type (if any) the config value applies to
  3644. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3645. * a valid configuration specification
  3646. * - COOKIE_LSBS
  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: LSBs of the opaque cookie specified by the host-side requestor
  3651. * - COOKIE_MSBS
  3652. * Bits 31:0
  3653. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3654. * message with its preceding host->target stats request message.
  3655. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3656. */
  3657. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3658. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3659. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3660. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3661. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3662. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3663. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3664. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3665. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3666. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3667. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3668. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3669. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3670. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3673. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3674. } while (0)
  3675. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3676. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3677. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3678. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3681. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3682. } while (0)
  3683. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3684. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3685. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3686. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3687. do { \
  3688. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3689. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3690. } while (0)
  3691. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3692. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3693. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3694. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3695. do { \
  3696. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3697. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3698. } while (0)
  3699. /**
  3700. * @brief host -> target HTT out-of-band sync request
  3701. *
  3702. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3703. *
  3704. * @details
  3705. * The HTT SYNC tells the target to suspend processing of subsequent
  3706. * HTT host-to-target messages until some other target agent locally
  3707. * informs the target HTT FW that the current sync counter is equal to
  3708. * or greater than (in a modulo sense) the sync counter specified in
  3709. * the SYNC message.
  3710. * This allows other host-target components to synchronize their operation
  3711. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3712. * security key has been downloaded to and activated by the target.
  3713. * In the absence of any explicit synchronization counter value
  3714. * specification, the target HTT FW will use zero as the default current
  3715. * sync value.
  3716. *
  3717. * |31 24|23 16|15 8|7 0|
  3718. * |-----------------------------------------------------------|
  3719. * | reserved | sync count | msg type |
  3720. * |-----------------------------------------------------------|
  3721. * Header fields:
  3722. * - MSG_TYPE
  3723. * Bits 7:0
  3724. * Purpose: identifies this as a sync message
  3725. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3726. * - SYNC_COUNT
  3727. * Bits 15:8
  3728. * Purpose: specifies what sync value the HTT FW will wait for from
  3729. * an out-of-band specification to resume its operation
  3730. * Value: in-band sync counter value to compare against the out-of-band
  3731. * counter spec.
  3732. * The HTT target FW will suspend its host->target message processing
  3733. * as long as
  3734. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3735. */
  3736. #define HTT_H2T_SYNC_MSG_SZ 4
  3737. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3738. #define HTT_H2T_SYNC_COUNT_S 8
  3739. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3740. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3741. HTT_H2T_SYNC_COUNT_S)
  3742. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3743. do { \
  3744. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3745. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3746. } while (0)
  3747. /**
  3748. * @brief host -> target HTT aggregation configuration
  3749. *
  3750. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3751. */
  3752. #define HTT_AGGR_CFG_MSG_SZ 4
  3753. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3754. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3755. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3756. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3757. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3758. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3759. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3760. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3761. do { \
  3762. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3763. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3764. } while (0)
  3765. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3766. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3767. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3768. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3769. do { \
  3770. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3771. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3772. } while (0)
  3773. /**
  3774. * @brief host -> target HTT configure max amsdu info per vdev
  3775. *
  3776. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3777. *
  3778. * @details
  3779. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3780. *
  3781. * |31 21|20 16|15 8|7 0|
  3782. * |-----------------------------------------------------------|
  3783. * | reserved | vdev id | max amsdu | msg type |
  3784. * |-----------------------------------------------------------|
  3785. * Header fields:
  3786. * - MSG_TYPE
  3787. * Bits 7:0
  3788. * Purpose: identifies this as a aggr cfg ex message
  3789. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3790. * - MAX_NUM_AMSDU_SUBFRM
  3791. * Bits 15:8
  3792. * Purpose: max MSDUs per A-MSDU
  3793. * - VDEV_ID
  3794. * Bits 20:16
  3795. * Purpose: ID of the vdev to which this limit is applied
  3796. */
  3797. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3798. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3799. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3800. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3801. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3802. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3803. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3804. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3805. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3806. do { \
  3807. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3808. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3809. } while (0)
  3810. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3811. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3812. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3813. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3814. do { \
  3815. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3816. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3817. } while (0)
  3818. /**
  3819. * @brief HTT WDI_IPA Config Message
  3820. *
  3821. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3822. *
  3823. * @details
  3824. * The HTT WDI_IPA config message is created/sent by host at driver
  3825. * init time. It contains information about data structures used on
  3826. * WDI_IPA TX and RX path.
  3827. * TX CE ring is used for pushing packet metadata from IPA uC
  3828. * to WLAN FW
  3829. * TX Completion ring is used for generating TX completions from
  3830. * WLAN FW to IPA uC
  3831. * RX Indication ring is used for indicating RX packets from FW
  3832. * to IPA uC
  3833. * RX Ring2 is used as either completion ring or as second
  3834. * indication ring. when Ring2 is used as completion ring, IPA uC
  3835. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3836. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3837. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3838. * indicated in RX Indication ring. Please see WDI_IPA specification
  3839. * for more details.
  3840. * |31 24|23 16|15 8|7 0|
  3841. * |----------------+----------------+----------------+----------------|
  3842. * | tx pkt pool size | Rsvd | msg_type |
  3843. * |-------------------------------------------------------------------|
  3844. * | tx comp ring base (bits 31:0) |
  3845. #if HTT_PADDR64
  3846. * | tx comp ring base (bits 63:32) |
  3847. #endif
  3848. * |-------------------------------------------------------------------|
  3849. * | tx comp ring size |
  3850. * |-------------------------------------------------------------------|
  3851. * | tx comp WR_IDX physical address (bits 31:0) |
  3852. #if HTT_PADDR64
  3853. * | tx comp WR_IDX physical address (bits 63:32) |
  3854. #endif
  3855. * |-------------------------------------------------------------------|
  3856. * | tx CE WR_IDX physical address (bits 31:0) |
  3857. #if HTT_PADDR64
  3858. * | tx CE WR_IDX physical address (bits 63:32) |
  3859. #endif
  3860. * |-------------------------------------------------------------------|
  3861. * | rx indication ring base (bits 31:0) |
  3862. #if HTT_PADDR64
  3863. * | rx indication ring base (bits 63:32) |
  3864. #endif
  3865. * |-------------------------------------------------------------------|
  3866. * | rx indication ring size |
  3867. * |-------------------------------------------------------------------|
  3868. * | rx ind RD_IDX physical address (bits 31:0) |
  3869. #if HTT_PADDR64
  3870. * | rx ind RD_IDX physical address (bits 63:32) |
  3871. #endif
  3872. * |-------------------------------------------------------------------|
  3873. * | rx ind WR_IDX physical address (bits 31:0) |
  3874. #if HTT_PADDR64
  3875. * | rx ind WR_IDX physical address (bits 63:32) |
  3876. #endif
  3877. * |-------------------------------------------------------------------|
  3878. * |-------------------------------------------------------------------|
  3879. * | rx ring2 base (bits 31:0) |
  3880. #if HTT_PADDR64
  3881. * | rx ring2 base (bits 63:32) |
  3882. #endif
  3883. * |-------------------------------------------------------------------|
  3884. * | rx ring2 size |
  3885. * |-------------------------------------------------------------------|
  3886. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3887. #if HTT_PADDR64
  3888. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3889. #endif
  3890. * |-------------------------------------------------------------------|
  3891. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3892. #if HTT_PADDR64
  3893. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3894. #endif
  3895. * |-------------------------------------------------------------------|
  3896. *
  3897. * Header fields:
  3898. * Header fields:
  3899. * - MSG_TYPE
  3900. * Bits 7:0
  3901. * Purpose: Identifies this as WDI_IPA config message
  3902. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3903. * - TX_PKT_POOL_SIZE
  3904. * Bits 15:0
  3905. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3906. * WDI_IPA TX path
  3907. * For systems using 32-bit format for bus addresses:
  3908. * - TX_COMP_RING_BASE_ADDR
  3909. * Bits 31:0
  3910. * Purpose: TX Completion Ring base address in DDR
  3911. * - TX_COMP_RING_SIZE
  3912. * Bits 31:0
  3913. * Purpose: TX Completion Ring size (must be power of 2)
  3914. * - TX_COMP_WR_IDX_ADDR
  3915. * Bits 31:0
  3916. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3917. * updates the Write Index for WDI_IPA TX completion ring
  3918. * - TX_CE_WR_IDX_ADDR
  3919. * Bits 31:0
  3920. * Purpose: DDR address where IPA uC
  3921. * updates the WR Index for TX CE ring
  3922. * (needed for fusion platforms)
  3923. * - RX_IND_RING_BASE_ADDR
  3924. * Bits 31:0
  3925. * Purpose: RX Indication Ring base address in DDR
  3926. * - RX_IND_RING_SIZE
  3927. * Bits 31:0
  3928. * Purpose: RX Indication Ring size
  3929. * - RX_IND_RD_IDX_ADDR
  3930. * Bits 31:0
  3931. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3932. * RX indication ring
  3933. * - RX_IND_WR_IDX_ADDR
  3934. * Bits 31:0
  3935. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3936. * updates the Write Index for WDI_IPA RX indication ring
  3937. * - RX_RING2_BASE_ADDR
  3938. * Bits 31:0
  3939. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3940. * - RX_RING2_SIZE
  3941. * Bits 31:0
  3942. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3943. * - RX_RING2_RD_IDX_ADDR
  3944. * Bits 31:0
  3945. * Purpose: If Second RX ring is Indication ring, DDR address where
  3946. * IPA uC updates the Read Index for Ring2.
  3947. * If Second RX ring is completion ring, this is NOT used
  3948. * - RX_RING2_WR_IDX_ADDR
  3949. * Bits 31:0
  3950. * Purpose: If Second RX ring is Indication ring, DDR address where
  3951. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3952. * If second RX ring is completion ring, DDR address where
  3953. * IPA uC updates the Write Index for Ring 2.
  3954. * For systems using 64-bit format for bus addresses:
  3955. * - TX_COMP_RING_BASE_ADDR_LO
  3956. * Bits 31:0
  3957. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3958. * - TX_COMP_RING_BASE_ADDR_HI
  3959. * Bits 31:0
  3960. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3961. * - TX_COMP_RING_SIZE
  3962. * Bits 31:0
  3963. * Purpose: TX Completion Ring size (must be power of 2)
  3964. * - TX_COMP_WR_IDX_ADDR_LO
  3965. * Bits 31:0
  3966. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3967. * Lower 4 bytes of DDR address where WIFI FW
  3968. * updates the Write Index for WDI_IPA TX completion ring
  3969. * - TX_COMP_WR_IDX_ADDR_HI
  3970. * Bits 31:0
  3971. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3972. * Higher 4 bytes of DDR address where WIFI FW
  3973. * updates the Write Index for WDI_IPA TX completion ring
  3974. * - TX_CE_WR_IDX_ADDR_LO
  3975. * Bits 31:0
  3976. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3977. * updates the WR Index for TX CE ring
  3978. * (needed for fusion platforms)
  3979. * - TX_CE_WR_IDX_ADDR_HI
  3980. * Bits 31:0
  3981. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3982. * updates the WR Index for TX CE ring
  3983. * (needed for fusion platforms)
  3984. * - RX_IND_RING_BASE_ADDR_LO
  3985. * Bits 31:0
  3986. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3987. * - RX_IND_RING_BASE_ADDR_HI
  3988. * Bits 31:0
  3989. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3990. * - RX_IND_RING_SIZE
  3991. * Bits 31:0
  3992. * Purpose: RX Indication Ring size
  3993. * - RX_IND_RD_IDX_ADDR_LO
  3994. * Bits 31:0
  3995. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3996. * for WDI_IPA RX indication ring
  3997. * - RX_IND_RD_IDX_ADDR_HI
  3998. * Bits 31:0
  3999. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4000. * for WDI_IPA RX indication ring
  4001. * - RX_IND_WR_IDX_ADDR_LO
  4002. * Bits 31:0
  4003. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4004. * Lower 4 bytes of DDR address where WIFI FW
  4005. * updates the Write Index for WDI_IPA RX indication ring
  4006. * - RX_IND_WR_IDX_ADDR_HI
  4007. * Bits 31:0
  4008. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4009. * Higher 4 bytes of DDR address where WIFI FW
  4010. * updates the Write Index for WDI_IPA RX indication ring
  4011. * - RX_RING2_BASE_ADDR_LO
  4012. * Bits 31:0
  4013. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4014. * - RX_RING2_BASE_ADDR_HI
  4015. * Bits 31:0
  4016. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4017. * - RX_RING2_SIZE
  4018. * Bits 31:0
  4019. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4020. * - RX_RING2_RD_IDX_ADDR_LO
  4021. * Bits 31:0
  4022. * Purpose: If Second RX ring is Indication ring, lower 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_RD_IDX_ADDR_HI
  4026. * Bits 31:0
  4027. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4028. * DDR address where IPA uC updates the Read Index for Ring2.
  4029. * If Second RX ring is completion ring, this is NOT used
  4030. * - RX_RING2_WR_IDX_ADDR_LO
  4031. * Bits 31:0
  4032. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4033. * DDR address where WIFI FW updates the Write Index
  4034. * for WDI_IPA RX ring2
  4035. * If second RX ring is completion ring, lower 4 bytes of
  4036. * DDR address where IPA uC updates the Write Index for Ring 2.
  4037. * - RX_RING2_WR_IDX_ADDR_HI
  4038. * Bits 31:0
  4039. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4040. * DDR address where WIFI FW updates the Write Index
  4041. * for WDI_IPA RX ring2
  4042. * If second RX ring is completion ring, higher 4 bytes of
  4043. * DDR address where IPA uC updates the Write Index for Ring 2.
  4044. */
  4045. #if HTT_PADDR64
  4046. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4047. #else
  4048. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4049. #endif
  4050. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4051. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4052. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4054. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4060. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4062. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4064. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4066. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4068. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4070. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4072. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4074. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4088. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4089. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4090. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4091. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4106. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4107. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4108. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4109. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4110. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4111. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4112. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4113. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4114. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4115. do { \
  4116. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4117. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4118. } while (0)
  4119. /* for systems using 32-bit format for bus addr */
  4120. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4121. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4122. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4125. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4126. } while (0)
  4127. /* for systems using 64-bit format for bus addr */
  4128. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4129. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4130. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4133. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4134. } while (0)
  4135. /* for systems using 64-bit format for bus addr */
  4136. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4137. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4138. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4139. do { \
  4140. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4141. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4142. } while (0)
  4143. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4144. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4145. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4146. do { \
  4147. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4148. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4149. } while (0)
  4150. /* for systems using 32-bit format for bus addr */
  4151. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4152. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4153. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4154. do { \
  4155. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4156. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4157. } while (0)
  4158. /* for systems using 64-bit format for bus addr */
  4159. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4160. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4161. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4164. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4165. } while (0)
  4166. /* for systems using 64-bit format for bus addr */
  4167. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4168. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4169. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4170. do { \
  4171. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4172. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4173. } while (0)
  4174. /* for systems using 32-bit format for bus addr */
  4175. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4176. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4177. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4178. do { \
  4179. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4180. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4181. } while (0)
  4182. /* for systems using 64-bit format for bus addr */
  4183. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4184. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4185. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4186. do { \
  4187. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4188. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4189. } while (0)
  4190. /* for systems using 64-bit format for bus addr */
  4191. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4192. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4193. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4194. do { \
  4195. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4196. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4197. } while (0)
  4198. /* for systems using 32-bit format for bus addr */
  4199. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4200. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4201. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4202. do { \
  4203. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4204. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4205. } while (0)
  4206. /* for systems using 64-bit format for bus addr */
  4207. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4208. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4209. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4212. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4213. } while (0)
  4214. /* for systems using 64-bit format for bus addr */
  4215. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4216. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4217. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4218. do { \
  4219. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4220. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4221. } while (0)
  4222. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4223. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4224. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4225. do { \
  4226. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4227. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4228. } while (0)
  4229. /* for systems using 32-bit format for bus addr */
  4230. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4231. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4232. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4233. do { \
  4234. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4235. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4236. } while (0)
  4237. /* for systems using 64-bit format for bus addr */
  4238. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4239. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4240. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4243. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4244. } while (0)
  4245. /* for systems using 64-bit format for bus addr */
  4246. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4247. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4248. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4249. do { \
  4250. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4251. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4252. } while (0)
  4253. /* for systems using 32-bit format for bus addr */
  4254. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4255. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4256. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4257. do { \
  4258. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4259. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4260. } while (0)
  4261. /* for systems using 64-bit format for bus addr */
  4262. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4263. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4264. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4265. do { \
  4266. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4267. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4268. } while (0)
  4269. /* for systems using 64-bit format for bus addr */
  4270. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4271. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4272. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4273. do { \
  4274. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4275. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4276. } while (0)
  4277. /* for systems using 32-bit format for bus addr */
  4278. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4279. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4280. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4281. do { \
  4282. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4283. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4284. } while (0)
  4285. /* for systems using 64-bit format for bus addr */
  4286. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4287. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4288. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4289. do { \
  4290. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4291. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4292. } while (0)
  4293. /* for systems using 64-bit format for bus addr */
  4294. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4295. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4296. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4297. do { \
  4298. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4299. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4300. } while (0)
  4301. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4302. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4303. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4306. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4307. } while (0)
  4308. /* for systems using 32-bit format for bus addr */
  4309. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4310. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4311. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4314. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4315. } while (0)
  4316. /* for systems using 64-bit format for bus addr */
  4317. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4318. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4319. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4320. do { \
  4321. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4322. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4323. } while (0)
  4324. /* for systems using 64-bit format for bus addr */
  4325. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4326. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4327. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4328. do { \
  4329. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4330. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4331. } while (0)
  4332. /* for systems using 32-bit format for bus addr */
  4333. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4334. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4335. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4336. do { \
  4337. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4338. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4339. } while (0)
  4340. /* for systems using 64-bit format for bus addr */
  4341. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4342. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4343. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4344. do { \
  4345. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4346. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4347. } while (0)
  4348. /* for systems using 64-bit format for bus addr */
  4349. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4350. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4351. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4352. do { \
  4353. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4354. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4355. } while (0)
  4356. /*
  4357. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4358. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4359. * addresses are stored in a XXX-bit field.
  4360. * This macro is used to define both htt_wdi_ipa_config32_t and
  4361. * htt_wdi_ipa_config64_t structs.
  4362. */
  4363. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4364. _paddr__tx_comp_ring_base_addr_, \
  4365. _paddr__tx_comp_wr_idx_addr_, \
  4366. _paddr__tx_ce_wr_idx_addr_, \
  4367. _paddr__rx_ind_ring_base_addr_, \
  4368. _paddr__rx_ind_rd_idx_addr_, \
  4369. _paddr__rx_ind_wr_idx_addr_, \
  4370. _paddr__rx_ring2_base_addr_,\
  4371. _paddr__rx_ring2_rd_idx_addr_,\
  4372. _paddr__rx_ring2_wr_idx_addr_) \
  4373. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4374. { \
  4375. /* DWORD 0: flags and meta-data */ \
  4376. A_UINT32 \
  4377. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4378. reserved: 8, \
  4379. tx_pkt_pool_size: 16;\
  4380. /* DWORD 1 */\
  4381. _paddr__tx_comp_ring_base_addr_;\
  4382. /* DWORD 2 (or 3)*/\
  4383. A_UINT32 tx_comp_ring_size;\
  4384. /* DWORD 3 (or 4)*/\
  4385. _paddr__tx_comp_wr_idx_addr_;\
  4386. /* DWORD 4 (or 6)*/\
  4387. _paddr__tx_ce_wr_idx_addr_;\
  4388. /* DWORD 5 (or 8)*/\
  4389. _paddr__rx_ind_ring_base_addr_;\
  4390. /* DWORD 6 (or 10)*/\
  4391. A_UINT32 rx_ind_ring_size;\
  4392. /* DWORD 7 (or 11)*/\
  4393. _paddr__rx_ind_rd_idx_addr_;\
  4394. /* DWORD 8 (or 13)*/\
  4395. _paddr__rx_ind_wr_idx_addr_;\
  4396. /* DWORD 9 (or 15)*/\
  4397. _paddr__rx_ring2_base_addr_;\
  4398. /* DWORD 10 (or 17) */\
  4399. A_UINT32 rx_ring2_size;\
  4400. /* DWORD 11 (or 18) */\
  4401. _paddr__rx_ring2_rd_idx_addr_;\
  4402. /* DWORD 12 (or 20) */\
  4403. _paddr__rx_ring2_wr_idx_addr_;\
  4404. } POSTPACK
  4405. /* define a htt_wdi_ipa_config32_t type */
  4406. 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));
  4407. /* define a htt_wdi_ipa_config64_t type */
  4408. 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));
  4409. #if HTT_PADDR64
  4410. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4411. #else
  4412. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4413. #endif
  4414. enum htt_wdi_ipa_op_code {
  4415. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4416. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4417. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4418. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4419. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4420. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4421. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4422. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4423. /* keep this last */
  4424. HTT_WDI_IPA_OPCODE_MAX
  4425. };
  4426. /**
  4427. * @brief HTT WDI_IPA Operation Request Message
  4428. *
  4429. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4430. *
  4431. * @details
  4432. * HTT WDI_IPA Operation Request message is sent by host
  4433. * to either suspend or resume WDI_IPA TX or RX path.
  4434. * |31 24|23 16|15 8|7 0|
  4435. * |----------------+----------------+----------------+----------------|
  4436. * | op_code | Rsvd | msg_type |
  4437. * |-------------------------------------------------------------------|
  4438. *
  4439. * Header fields:
  4440. * - MSG_TYPE
  4441. * Bits 7:0
  4442. * Purpose: Identifies this as WDI_IPA Operation Request message
  4443. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4444. * - OP_CODE
  4445. * Bits 31:16
  4446. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4447. * value: = enum htt_wdi_ipa_op_code
  4448. */
  4449. PREPACK struct htt_wdi_ipa_op_request_t
  4450. {
  4451. /* DWORD 0: flags and meta-data */
  4452. A_UINT32
  4453. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4454. reserved: 8,
  4455. op_code: 16;
  4456. } POSTPACK;
  4457. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4458. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4459. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4460. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4461. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4462. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4463. do { \
  4464. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4465. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4466. } while (0)
  4467. /*
  4468. * @brief host -> target HTT_MSI_SETUP message
  4469. *
  4470. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4471. *
  4472. * @details
  4473. * After target is booted up, host can send MSI setup message so that
  4474. * target sets up HW registers based on setup message.
  4475. *
  4476. * The message would appear as follows:
  4477. * |31 24|23 16|15|14 8|7 0|
  4478. * |---------------+-----------------+-----------------+-----------------|
  4479. * | reserved | msi_type | pdev_id | msg_type |
  4480. * |---------------------------------------------------------------------|
  4481. * | msi_addr_lo |
  4482. * |---------------------------------------------------------------------|
  4483. * | msi_addr_hi |
  4484. * |---------------------------------------------------------------------|
  4485. * | msi_data |
  4486. * |---------------------------------------------------------------------|
  4487. *
  4488. * The message is interpreted as follows:
  4489. * dword0 - b'0:7 - msg_type: This will be set to
  4490. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4491. * b'8:15 - pdev_id:
  4492. * 0 (for rings at SOC/UMAC level),
  4493. * 1/2/3 mac id (for rings at LMAC level)
  4494. * b'16:23 - msi_type: identify which msi registers need to be setup
  4495. * more details can be got from enum htt_msi_setup_type
  4496. * b'24:31 - reserved
  4497. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4498. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4499. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4500. */
  4501. PREPACK struct htt_msi_setup_t {
  4502. A_UINT32 msg_type: 8,
  4503. pdev_id: 8,
  4504. msi_type: 8,
  4505. reserved: 8;
  4506. A_UINT32 msi_addr_lo;
  4507. A_UINT32 msi_addr_hi;
  4508. A_UINT32 msi_data;
  4509. } POSTPACK;
  4510. enum htt_msi_setup_type {
  4511. HTT_PPDU_END_MSI_SETUP_TYPE,
  4512. /* Insert new types here*/
  4513. };
  4514. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4515. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4516. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4517. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4518. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4519. HTT_MSI_SETUP_PDEV_ID_S)
  4520. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4521. do { \
  4522. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4523. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4524. } while (0)
  4525. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4526. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4527. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4528. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4529. HTT_MSI_SETUP_MSI_TYPE_S)
  4530. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4531. do { \
  4532. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4533. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4534. } while (0)
  4535. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4536. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4537. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4538. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4539. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4540. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4541. do { \
  4542. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4543. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4544. } while (0)
  4545. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4546. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4547. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4548. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4549. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4550. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4551. do { \
  4552. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4553. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4554. } while (0)
  4555. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4556. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4557. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4558. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4559. HTT_MSI_SETUP_MSI_DATA_S)
  4560. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4561. do { \
  4562. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4563. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4564. } while (0)
  4565. /*
  4566. * @brief host -> target HTT_SRING_SETUP message
  4567. *
  4568. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4569. *
  4570. * @details
  4571. * After target is booted up, Host can send SRING setup message for
  4572. * each host facing LMAC SRING. Target setups up HW registers based
  4573. * on setup message and confirms back to Host if response_required is set.
  4574. * Host should wait for confirmation message before sending new SRING
  4575. * setup message
  4576. *
  4577. * The message would appear as follows:
  4578. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4579. * |--------------- +-----------------+-----------------+-----------------|
  4580. * | ring_type | ring_id | pdev_id | msg_type |
  4581. * |----------------------------------------------------------------------|
  4582. * | ring_base_addr_lo |
  4583. * |----------------------------------------------------------------------|
  4584. * | ring_base_addr_hi |
  4585. * |----------------------------------------------------------------------|
  4586. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4587. * |----------------------------------------------------------------------|
  4588. * | ring_head_offset32_remote_addr_lo |
  4589. * |----------------------------------------------------------------------|
  4590. * | ring_head_offset32_remote_addr_hi |
  4591. * |----------------------------------------------------------------------|
  4592. * | ring_tail_offset32_remote_addr_lo |
  4593. * |----------------------------------------------------------------------|
  4594. * | ring_tail_offset32_remote_addr_hi |
  4595. * |----------------------------------------------------------------------|
  4596. * | ring_msi_addr_lo |
  4597. * |----------------------------------------------------------------------|
  4598. * | ring_msi_addr_hi |
  4599. * |----------------------------------------------------------------------|
  4600. * | ring_msi_data |
  4601. * |----------------------------------------------------------------------|
  4602. * | intr_timer_th |IM| intr_batch_counter_th |
  4603. * |----------------------------------------------------------------------|
  4604. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4605. * |----------------------------------------------------------------------|
  4606. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4607. * |----------------------------------------------------------------------|
  4608. * Where
  4609. * IM = sw_intr_mode
  4610. * RR = response_required
  4611. * PTCF = prefetch_timer_cfg
  4612. * IP = IPA drop flag
  4613. *
  4614. * The message is interpreted as follows:
  4615. * dword0 - b'0:7 - msg_type: This will be set to
  4616. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4617. * b'8:15 - pdev_id:
  4618. * 0 (for rings at SOC/UMAC level),
  4619. * 1/2/3 mac id (for rings at LMAC level)
  4620. * b'16:23 - ring_id: identify which ring is to setup,
  4621. * more details can be got from enum htt_srng_ring_id
  4622. * b'24:31 - ring_type: identify type of host rings,
  4623. * more details can be got from enum htt_srng_ring_type
  4624. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4625. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4626. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4627. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4628. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4629. * SW_TO_HW_RING.
  4630. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4631. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4632. * Lower 32 bits of memory address of the remote variable
  4633. * storing the 4-byte word offset that identifies the head
  4634. * element within the ring.
  4635. * (The head offset variable has type A_UINT32.)
  4636. * Valid for HW_TO_SW and SW_TO_SW rings.
  4637. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4638. * Upper 32 bits of memory address of the remote variable
  4639. * storing the 4-byte word offset that identifies the head
  4640. * element within the ring.
  4641. * (The head offset variable has type A_UINT32.)
  4642. * Valid for HW_TO_SW and SW_TO_SW rings.
  4643. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4644. * Lower 32 bits of memory address of the remote variable
  4645. * storing the 4-byte word offset that identifies the tail
  4646. * element within the ring.
  4647. * (The tail offset variable has type A_UINT32.)
  4648. * Valid for HW_TO_SW and SW_TO_SW rings.
  4649. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4650. * Upper 32 bits of memory address of the remote variable
  4651. * storing the 4-byte word offset that identifies the tail
  4652. * element within the ring.
  4653. * (The tail offset variable has type A_UINT32.)
  4654. * Valid for HW_TO_SW and SW_TO_SW rings.
  4655. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4656. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4657. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4658. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4659. * dword10 - b'0:31 - ring_msi_data: MSI data
  4660. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4661. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4662. * dword11 - b'0:14 - intr_batch_counter_th:
  4663. * batch counter threshold is in units of 4-byte words.
  4664. * HW internally maintains and increments batch count.
  4665. * (see SRING spec for detail description).
  4666. * When batch count reaches threshold value, an interrupt
  4667. * is generated by HW.
  4668. * b'15 - sw_intr_mode:
  4669. * This configuration shall be static.
  4670. * Only programmed at power up.
  4671. * 0: generate pulse style sw interrupts
  4672. * 1: generate level style sw interrupts
  4673. * b'16:31 - intr_timer_th:
  4674. * The timer init value when timer is idle or is
  4675. * initialized to start downcounting.
  4676. * In 8us units (to cover a range of 0 to 524 ms)
  4677. * dword12 - b'0:15 - intr_low_threshold:
  4678. * Used only by Consumer ring to generate ring_sw_int_p.
  4679. * Ring entries low threshold water mark, that is used
  4680. * in combination with the interrupt timer as well as
  4681. * the the clearing of the level interrupt.
  4682. * b'16:18 - prefetch_timer_cfg:
  4683. * Used only by Consumer ring to set timer mode to
  4684. * support Application prefetch handling.
  4685. * The external tail offset/pointer will be updated
  4686. * at following intervals:
  4687. * 3'b000: (Prefetch feature disabled; used only for debug)
  4688. * 3'b001: 1 usec
  4689. * 3'b010: 4 usec
  4690. * 3'b011: 8 usec (default)
  4691. * 3'b100: 16 usec
  4692. * Others: Reserved
  4693. * b'19 - response_required:
  4694. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4695. * b'20 - ipa_drop_flag:
  4696. Indicates that host will config ipa drop threshold percentage
  4697. * b'21:31 - reserved: reserved for future use
  4698. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4699. * b'8:15 - ipa drop high threshold percentage:
  4700. * b'16:31 - Reserved
  4701. */
  4702. PREPACK struct htt_sring_setup_t {
  4703. A_UINT32 msg_type: 8,
  4704. pdev_id: 8,
  4705. ring_id: 8,
  4706. ring_type: 8;
  4707. A_UINT32 ring_base_addr_lo;
  4708. A_UINT32 ring_base_addr_hi;
  4709. A_UINT32 ring_size: 16,
  4710. ring_entry_size: 8,
  4711. ring_misc_cfg_flag: 8;
  4712. A_UINT32 ring_head_offset32_remote_addr_lo;
  4713. A_UINT32 ring_head_offset32_remote_addr_hi;
  4714. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4715. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4716. A_UINT32 ring_msi_addr_lo;
  4717. A_UINT32 ring_msi_addr_hi;
  4718. A_UINT32 ring_msi_data;
  4719. A_UINT32 intr_batch_counter_th: 15,
  4720. sw_intr_mode: 1,
  4721. intr_timer_th: 16;
  4722. A_UINT32 intr_low_threshold: 16,
  4723. prefetch_timer_cfg: 3,
  4724. response_required: 1,
  4725. ipa_drop_flag: 1,
  4726. reserved1: 11;
  4727. A_UINT32 ipa_drop_low_threshold: 8,
  4728. ipa_drop_high_threshold: 8,
  4729. reserved: 16;
  4730. } POSTPACK;
  4731. enum htt_srng_ring_type {
  4732. HTT_HW_TO_SW_RING = 0,
  4733. HTT_SW_TO_HW_RING,
  4734. HTT_SW_TO_SW_RING,
  4735. /* Insert new ring types above this line */
  4736. };
  4737. enum htt_srng_ring_id {
  4738. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4739. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4740. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4741. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4742. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4743. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4744. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4745. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4746. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4747. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4748. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4749. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4750. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4751. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4752. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4753. /* Add Other SRING which can't be directly configured by host software above this line */
  4754. };
  4755. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4756. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4757. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4758. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4759. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4760. HTT_SRING_SETUP_PDEV_ID_S)
  4761. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4762. do { \
  4763. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4764. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4765. } while (0)
  4766. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4767. #define HTT_SRING_SETUP_RING_ID_S 16
  4768. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4769. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4770. HTT_SRING_SETUP_RING_ID_S)
  4771. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4772. do { \
  4773. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4774. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4775. } while (0)
  4776. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4777. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4778. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4779. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4780. HTT_SRING_SETUP_RING_TYPE_S)
  4781. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4782. do { \
  4783. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4784. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4785. } while (0)
  4786. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4787. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4788. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4789. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4790. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4791. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4792. do { \
  4793. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4794. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4795. } while (0)
  4796. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4797. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4798. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4799. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4800. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4801. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4802. do { \
  4803. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4804. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4805. } while (0)
  4806. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4807. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4808. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4809. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4810. HTT_SRING_SETUP_RING_SIZE_S)
  4811. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4812. do { \
  4813. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4814. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4815. } while (0)
  4816. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4817. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4818. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4819. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4820. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4821. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4822. do { \
  4823. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4824. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4825. } while (0)
  4826. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4827. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4828. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4829. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4830. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4831. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4832. do { \
  4833. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4834. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4835. } while (0)
  4836. /* This control bit is applicable to only Producer, which updates Ring ID field
  4837. * of each descriptor before pushing into the ring.
  4838. * 0: updates ring_id(default)
  4839. * 1: ring_id updating disabled */
  4840. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4843. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4844. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4845. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4846. do { \
  4847. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4848. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4849. } while (0)
  4850. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4851. * of each descriptor before pushing into the ring.
  4852. * 0: updates Loopcnt(default)
  4853. * 1: Loopcnt updating disabled */
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4857. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4858. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4860. do { \
  4861. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4862. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4863. } while (0)
  4864. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4865. * into security_id port of GXI/AXI. */
  4866. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4867. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4869. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4870. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4872. do { \
  4873. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4874. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4875. } while (0)
  4876. /* During MSI write operation, SRNG drives value of this register bit into
  4877. * swap bit of GXI/AXI. */
  4878. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4879. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4880. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4881. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4882. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4884. do { \
  4885. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4886. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4887. } while (0)
  4888. /* During Pointer write operation, SRNG drives value of this register bit into
  4889. * swap bit of GXI/AXI. */
  4890. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4891. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4892. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4893. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4894. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4896. do { \
  4897. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4898. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4899. } while (0)
  4900. /* During any data or TLV write operation, SRNG drives value of this register
  4901. * bit into swap bit of GXI/AXI. */
  4902. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4903. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4904. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4905. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4906. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4907. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4908. do { \
  4909. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4910. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4911. } while (0)
  4912. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4913. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4914. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4915. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4916. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4917. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4918. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4919. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4920. do { \
  4921. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4922. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4923. } while (0)
  4924. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4925. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4926. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4927. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4928. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4929. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4930. do { \
  4931. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4932. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4933. } while (0)
  4934. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4935. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4936. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4937. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4938. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4939. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4940. do { \
  4941. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4942. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4943. } while (0)
  4944. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4945. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4946. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4947. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4948. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4949. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4950. do { \
  4951. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4952. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4953. } while (0)
  4954. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4955. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4956. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4957. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4958. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4959. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4960. do { \
  4961. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4962. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4963. } while (0)
  4964. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4965. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4966. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4967. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4968. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4969. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4970. do { \
  4971. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4972. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4973. } while (0)
  4974. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4975. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4976. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4977. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4978. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4979. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4980. do { \
  4981. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4982. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4983. } while (0)
  4984. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4985. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4986. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4987. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4988. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4989. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4990. do { \
  4991. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4992. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4993. } while (0)
  4994. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4995. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4996. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4997. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4998. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4999. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5000. do { \
  5001. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5002. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5003. } while (0)
  5004. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5005. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5006. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5007. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5008. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5009. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5010. do { \
  5011. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5012. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5013. } while (0)
  5014. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5015. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5016. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5017. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5018. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5019. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5020. do { \
  5021. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5022. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5023. } while (0)
  5024. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5025. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5026. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5027. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5028. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5029. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5030. do { \
  5031. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5032. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5033. } while (0)
  5034. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5035. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5036. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5037. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5038. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5039. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5040. do { \
  5041. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5042. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5043. } while (0)
  5044. /**
  5045. * @brief host -> target RX ring selection config message
  5046. *
  5047. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5048. *
  5049. * @details
  5050. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5051. * configure RXDMA rings.
  5052. * The configuration is per ring based and includes both packet subtypes
  5053. * and PPDU/MPDU TLVs.
  5054. *
  5055. * The message would appear as follows:
  5056. *
  5057. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5058. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5059. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5060. * |-----------------------+-----+-----+--------------------------------|
  5061. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5062. * |--------------------------------------------------------------------|
  5063. * | packet_type_enable_flags_0 |
  5064. * |--------------------------------------------------------------------|
  5065. * | packet_type_enable_flags_1 |
  5066. * |--------------------------------------------------------------------|
  5067. * | packet_type_enable_flags_2 |
  5068. * |--------------------------------------------------------------------|
  5069. * | packet_type_enable_flags_3 |
  5070. * |--------------------------------------------------------------------|
  5071. * | tlv_filter_in_flags |
  5072. * |-----------------------------------+--------------------------------|
  5073. * | rx_header_offset | rx_packet_offset |
  5074. * |-----------------------------------+--------------------------------|
  5075. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5076. * |-----------------------------------+--------------------------------|
  5077. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5078. * |-----------------------------------+--------------------------------|
  5079. * | rsvd3 | rx_attention_offset |
  5080. * |--------------------------------------------------------------------|
  5081. * | rsvd4 | mo| fp| rx_drop_threshold |
  5082. * | |ndp|ndp| |
  5083. * |--------------------------------------------------------------------|
  5084. * Where:
  5085. * PS = pkt_swap
  5086. * SS = status_swap
  5087. * OV = rx_offsets_valid
  5088. * DT = drop_thresh_valid
  5089. * CLM = config_length_mgmt
  5090. * CLC = config_length_ctrl
  5091. * CLD = config_length_data
  5092. * RXHDL = rx_hdr_len
  5093. * RX = rxpcu_filter_enable_flag
  5094. * The message is interpreted as follows:
  5095. * dword0 - b'0:7 - msg_type: This will be set to
  5096. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5097. * b'8:15 - pdev_id:
  5098. * 0 (for rings at SOC/UMAC level),
  5099. * 1/2/3 mac id (for rings at LMAC level)
  5100. * b'16:23 - ring_id : Identify the ring to configure.
  5101. * More details can be got from enum htt_srng_ring_id
  5102. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5103. * BUF_RING_CFG_0 defs within HW .h files,
  5104. * e.g. wmac_top_reg_seq_hwioreg.h
  5105. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5106. * BUF_RING_CFG_0 defs within HW .h files,
  5107. * e.g. wmac_top_reg_seq_hwioreg.h
  5108. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5109. * configuration fields are valid
  5110. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5111. * rx_drop_threshold field is valid
  5112. * b'28 - rx_mon_global_en: Enable/Disable global register
  5113. 8 configuration in Rx monitor module.
  5114. * b'29:31 - rsvd1: reserved for future use
  5115. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5116. * in byte units.
  5117. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5118. * b'16:18 - config_length_mgmt (MGMT):
  5119. * Represents the length of mpdu bytes for mgmt pkt.
  5120. * valid values:
  5121. * 001 - 64bytes
  5122. * 010 - 128bytes
  5123. * 100 - 256bytes
  5124. * 111 - Full mpdu bytes
  5125. * b'19:21 - config_length_ctrl (CTRL):
  5126. * Represents the length of mpdu bytes for ctrl pkt.
  5127. * valid values:
  5128. * 001 - 64bytes
  5129. * 010 - 128bytes
  5130. * 100 - 256bytes
  5131. * 111 - Full mpdu bytes
  5132. * b'22:24 - config_length_data (DATA):
  5133. * Represents the length of mpdu bytes for data pkt.
  5134. * valid values:
  5135. * 001 - 64bytes
  5136. * 010 - 128bytes
  5137. * 100 - 256bytes
  5138. * 111 - Full mpdu bytes
  5139. * b'25:26 - rx_hdr_len:
  5140. * Specifies the number of bytes of recvd packet to copy
  5141. * into the rx_hdr tlv.
  5142. * supported values for now by host:
  5143. * 01 - 64bytes
  5144. * 10 - 128bytes
  5145. * 11 - 256bytes
  5146. * default - 128 bytes
  5147. * b'27 - rxpcu_filter_enable_flag
  5148. * For Scan Radio Host CPU utilization is very high.
  5149. * In order to reduce CPU utilization we need to filter out
  5150. * certain configured MAC frames.
  5151. * To filter out configured MAC address frames, RxPCU should
  5152. * be zero which means allow all frames for MD at RxOLE
  5153. * host wil fiter out frames.
  5154. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5155. * b'28:31 - rsvd2: Reserved for future use
  5156. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5157. * Enable MGMT packet from 0b0000 to 0b1001
  5158. * bits from low to high: FP, MD, MO - 3 bits
  5159. * FP: Filter_Pass
  5160. * MD: Monitor_Direct
  5161. * MO: Monitor_Other
  5162. * 10 mgmt subtypes * 3 bits -> 30 bits
  5163. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5164. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5165. * Enable MGMT packet from 0b1010 to 0b1111
  5166. * bits from low to high: FP, MD, MO - 3 bits
  5167. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5168. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5169. * Enable CTRL packet from 0b0000 to 0b1001
  5170. * bits from low to high: FP, MD, MO - 3 bits
  5171. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5172. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5173. * Enable CTRL packet from 0b1010 to 0b1111,
  5174. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5175. * bits from low to high: FP, MD, MO - 3 bits
  5176. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5177. * dword6 - b'0:31 - tlv_filter_in_flags:
  5178. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5179. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5180. * dword7 - b'0:15 - rx_packet_offset: rx_packet_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. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5186. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5187. * A value of 0 will be considered as ignore this config.
  5188. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5189. * e.g. wmac_top_reg_seq_hwioreg.h
  5190. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_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. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5196. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5197. * A value of 0 will be considered as ignore this config.
  5198. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5199. * e.g. wmac_top_reg_seq_hwioreg.h
  5200. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_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. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5206. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5207. * A value of 0 will be considered as ignore this config.
  5208. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5209. * e.g. wmac_top_reg_seq_hwioreg.h
  5210. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5211. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5212. * A value of 0 will be considered as ignore this config.
  5213. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5214. * e.g. wmac_top_reg_seq_hwioreg.h
  5215. * - b'16:31 - rsvd3 for future use
  5216. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5217. * to source rings. Consumer drops packets if the available
  5218. * words in the ring falls below the configured threshold
  5219. * value.
  5220. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5221. * by host. 1 -> subscribed
  5222. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5223. * by host. 1 -> subscribed
  5224. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5225. * subscribed by host. 1 -> subscribed
  5226. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5227. * selection for the FP PHY ERR status tlv.
  5228. * 0 - wbm2rxdma_buf_source_ring
  5229. * 1 - fw2rxdma_buf_source_ring
  5230. * 2 - sw2rxdma_buf_source_ring
  5231. * 3 - no_buffer_ring
  5232. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5233. * selection for the FP PHY ERR status tlv.
  5234. * 0 - rxdma_release_ring
  5235. * 1 - rxdma2fw_ring
  5236. * 2 - rxdma2sw_ring
  5237. * 3 - rxdma2reo_ring
  5238. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5239. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5240. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5241. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5242. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5243. * 0: MSDU level logging
  5244. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5245. * 0: MSDU level logging
  5246. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5247. * 0: MSDU level logging
  5248. * - b'23 - word_mask_compaction: enable/disable word mask for
  5249. * mpdu/msdu start/end tlvs
  5250. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5251. * manager override
  5252. * - b'25:28 - rbm_override_val: return buffer manager override value
  5253. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5254. * which have to be posted to host from phy.
  5255. * Corresponding to errors defined in
  5256. * phyrx_abort_request_reason enums 0 to 31.
  5257. * Refer to RXPCU register definition header files for the
  5258. * phyrx_abort_request_reason enum definition.
  5259. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5260. * errors which have to be posted to host from phy.
  5261. * Corresponding to errors defined in
  5262. * phyrx_abort_request_reason enums 32 to 63.
  5263. * Refer to RXPCU register definition header files for the
  5264. * phyrx_abort_request_reason enum definition.
  5265. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5266. * applicable if word mask enabled
  5267. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5268. * applicable if word mask enabled
  5269. * - b'19:31 - rsvd7
  5270. * dword15- b'0:16 - rx_msdu_end_word_mask
  5271. * - b'17:31 - rsvd5
  5272. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5273. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5274. * buffer
  5275. * 1: RX_PKT TLV logging at specified offset for the
  5276. * subsequent buffer
  5277. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5278. */
  5279. PREPACK struct htt_rx_ring_selection_cfg_t {
  5280. A_UINT32 msg_type: 8,
  5281. pdev_id: 8,
  5282. ring_id: 8,
  5283. status_swap: 1,
  5284. pkt_swap: 1,
  5285. rx_offsets_valid: 1,
  5286. drop_thresh_valid: 1,
  5287. rx_mon_global_en: 1,
  5288. rsvd1: 3;
  5289. A_UINT32 ring_buffer_size: 16,
  5290. config_length_mgmt:3,
  5291. config_length_ctrl:3,
  5292. config_length_data:3,
  5293. rx_hdr_len: 2,
  5294. rxpcu_filter_enable_flag:1,
  5295. rsvd2: 4;
  5296. A_UINT32 packet_type_enable_flags_0;
  5297. A_UINT32 packet_type_enable_flags_1;
  5298. A_UINT32 packet_type_enable_flags_2;
  5299. A_UINT32 packet_type_enable_flags_3;
  5300. A_UINT32 tlv_filter_in_flags;
  5301. A_UINT32 rx_packet_offset: 16,
  5302. rx_header_offset: 16;
  5303. A_UINT32 rx_mpdu_end_offset: 16,
  5304. rx_mpdu_start_offset: 16;
  5305. A_UINT32 rx_msdu_end_offset: 16,
  5306. rx_msdu_start_offset: 16;
  5307. A_UINT32 rx_attn_offset: 16,
  5308. rsvd3: 16;
  5309. A_UINT32 rx_drop_threshold: 10,
  5310. fp_ndp: 1,
  5311. mo_ndp: 1,
  5312. fp_phy_err: 1,
  5313. fp_phy_err_buf_src: 2,
  5314. fp_phy_err_buf_dest: 2,
  5315. pkt_type_enable_msdu_or_mpdu_logging:3,
  5316. dma_mpdu_mgmt: 1,
  5317. dma_mpdu_ctrl: 1,
  5318. dma_mpdu_data: 1,
  5319. word_mask_compaction_enable:1,
  5320. rbm_override_enable: 1,
  5321. rbm_override_val: 4,
  5322. rsvd4: 3;
  5323. A_UINT32 phy_err_mask;
  5324. A_UINT32 phy_err_mask_cont;
  5325. A_UINT32 rx_mpdu_start_word_mask:16,
  5326. rx_mpdu_end_word_mask: 3,
  5327. rsvd7: 13;
  5328. A_UINT32 rx_msdu_end_word_mask: 17,
  5329. rsvd5: 15;
  5330. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5331. rx_pkt_tlv_offset: 15,
  5332. rsvd6: 16;
  5333. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5334. rx_mpdu_end_word_mask_v2: 8,
  5335. rsvd8: 4;
  5336. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5337. rsvd9: 12;
  5338. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5339. rsvd10: 12;
  5340. A_UINT32 packet_type_enable_fpmo_flags0;
  5341. A_UINT32 packet_type_enable_fpmo_flags1;
  5342. } POSTPACK;
  5343. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5344. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5345. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5346. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5347. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5348. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5349. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5350. do { \
  5351. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5352. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5353. } while (0)
  5354. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5355. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5356. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5357. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5358. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5359. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5360. do { \
  5361. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5362. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5363. } while (0)
  5364. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5365. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5366. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5367. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5368. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5369. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5370. do { \
  5371. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5372. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5373. } while (0)
  5374. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5375. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5377. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5378. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5380. do { \
  5381. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5382. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5383. } while (0)
  5384. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5385. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5386. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5387. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5388. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5389. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5390. do { \
  5391. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5392. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5393. } while (0)
  5394. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5395. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5396. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5397. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5398. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5399. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5400. do { \
  5401. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5402. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5403. } while (0)
  5404. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5405. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5406. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5407. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5408. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5409. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5410. do { \
  5411. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5412. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5413. } while (0)
  5414. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5415. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5416. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5417. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5418. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5419. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5420. do { \
  5421. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5422. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5423. } while (0)
  5424. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5425. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5426. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5427. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5428. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5429. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5430. do { \
  5431. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5432. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5433. } while (0)
  5434. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5435. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5436. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5437. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5438. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5439. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5440. do { \
  5441. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5442. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5443. } while (0)
  5444. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5445. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5446. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5447. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5448. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5449. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5450. do { \
  5451. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5452. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5453. } while (0)
  5454. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5455. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5456. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5457. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5458. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5459. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5460. do { \
  5461. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5462. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5463. } while(0)
  5464. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5465. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5466. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5467. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5468. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5469. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5470. do { \
  5471. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5472. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5473. } while(0)
  5474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5477. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5478. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5480. do { \
  5481. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5482. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5483. } while (0)
  5484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5487. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5488. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5490. do { \
  5491. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5492. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5493. } while (0)
  5494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5497. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5498. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5500. do { \
  5501. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5502. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5503. } while (0)
  5504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5507. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5508. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5510. do { \
  5511. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5512. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5513. } while (0)
  5514. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5515. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5516. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5517. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5518. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5519. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5520. do { \
  5521. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5522. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5523. } while (0)
  5524. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5525. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5527. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5528. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5530. do { \
  5531. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5532. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5533. } while (0)
  5534. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5535. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5537. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5538. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5540. do { \
  5541. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5542. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5543. } while (0)
  5544. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5545. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5547. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5548. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5550. do { \
  5551. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5552. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5553. } while (0)
  5554. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5555. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5556. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5557. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5558. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5559. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5560. do { \
  5561. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5562. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5563. } while (0)
  5564. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5565. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5566. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5567. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5568. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5569. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5570. do { \
  5571. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5572. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5573. } while (0)
  5574. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5575. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5576. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5577. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5578. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5579. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5580. do { \
  5581. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5582. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5583. } while (0)
  5584. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5585. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5586. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5587. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5588. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5589. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5590. do { \
  5591. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5592. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5593. } while (0)
  5594. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5595. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5596. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5597. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5598. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5599. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5600. do { \
  5601. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5602. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5603. } while (0)
  5604. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5605. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5606. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5607. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5608. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5609. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5610. do { \
  5611. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5612. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5613. } while (0)
  5614. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5615. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5616. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5617. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5618. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5619. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5620. do { \
  5621. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5622. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5623. } while (0)
  5624. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5625. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5626. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5627. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5628. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5629. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5630. do { \
  5631. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5632. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5633. } while (0)
  5634. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5635. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5636. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5637. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5638. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5639. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5640. do { \
  5641. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5642. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5643. } while (0)
  5644. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5645. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5646. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5647. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5648. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5649. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5650. do { \
  5651. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5652. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5653. } while (0)
  5654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5657. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5658. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5660. do { \
  5661. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5662. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5663. } while (0)
  5664. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5665. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5666. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5667. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5668. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5669. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5670. do { \
  5671. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5672. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5673. } while (0)
  5674. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5675. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5676. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5677. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5678. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5679. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5680. do { \
  5681. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5682. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5683. } while (0)
  5684. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5685. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5686. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5687. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5688. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5689. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5690. do { \
  5691. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5692. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5693. } while (0)
  5694. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5695. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5696. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5697. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5698. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5699. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5700. do { \
  5701. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5702. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5703. } while (0)
  5704. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5705. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5706. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5707. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5708. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5709. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5710. do { \
  5711. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5712. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5713. } while (0)
  5714. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5715. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5716. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5717. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5718. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5719. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5720. do { \
  5721. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5722. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5723. } while (0)
  5724. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5725. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5726. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5727. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5728. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5729. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5730. do { \
  5731. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5732. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5733. } while (0)
  5734. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5735. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5736. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5737. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5738. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5739. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5740. do { \
  5741. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5742. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5743. } while (0)
  5744. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5745. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5746. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5747. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5748. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5749. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5750. do { \
  5751. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5752. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5753. } while (0)
  5754. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5755. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5756. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5757. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5758. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5759. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5760. do { \
  5761. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5762. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5763. } while (0)
  5764. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5765. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5766. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5767. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5768. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5769. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5770. do { \
  5771. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5772. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5773. } while (0)
  5774. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5775. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5776. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5777. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5778. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5779. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5780. do { \
  5781. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5782. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5783. } while (0)
  5784. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5785. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5786. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5787. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5788. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5789. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5790. do { \
  5791. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5792. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5793. } while (0)
  5794. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5795. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5796. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5797. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5798. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5799. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5800. do { \
  5801. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5802. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5803. } while (0)
  5804. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5805. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5806. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5807. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5808. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5809. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5810. do { \
  5811. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5812. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5813. } while (0)
  5814. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5815. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5816. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5817. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5818. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5819. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5820. do { \
  5821. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5822. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5823. } while (0)
  5824. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5825. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5826. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5827. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5828. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5829. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5830. do { \
  5831. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5832. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5833. } while (0)
  5834. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5835. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5836. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5837. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5838. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5839. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5840. do { \
  5841. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5842. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5843. } while (0)
  5844. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5845. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5846. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5847. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5848. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5849. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5850. do { \
  5851. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5852. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5853. } while (0)
  5854. /*
  5855. * Subtype based MGMT frames enable bits.
  5856. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5857. */
  5858. /* association request */
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5865. /* association response */
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5872. /* Reassociation request */
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5879. /* Reassociation response */
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5886. /* Probe request */
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5893. /* Probe response */
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5900. /* Timing Advertisement */
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5907. /* Reserved */
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5914. /* Beacon */
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5921. /* ATIM */
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5928. /* Disassociation */
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5935. /* Authentication */
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5942. /* Deauthentication */
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5949. /* Action */
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5956. /* Action No Ack */
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5963. /* Reserved */
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5970. /*
  5971. * Subtype based CTRL frames enable bits.
  5972. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5973. */
  5974. /* Reserved */
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5981. /* Reserved */
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5988. /* Reserved */
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5995. /* Reserved */
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6002. /* Reserved */
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6009. /* Reserved */
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6016. /* Reserved */
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6023. /* Control Wrapper */
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6030. /* Block Ack Request */
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6037. /* Block Ack*/
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6044. /* PS-POLL */
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6051. /* RTS */
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6058. /* CTS */
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6065. /* ACK */
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6072. /* CF-END */
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6079. /* CF-END + CF-ACK */
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6086. /* Multicast data */
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6093. /* Unicast data */
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6100. /* NULL data */
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6107. /* FPMO mode flags */
  6108. /* MGMT */
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6141. /* CTRL */
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6174. /* DATA */
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6186. do { \
  6187. HTT_CHECK_SET_VAL(httsym, value); \
  6188. (word) |= (value) << httsym##_S; \
  6189. } while (0)
  6190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6191. (((word) & httsym##_M) >> httsym##_S)
  6192. #define htt_rx_ring_pkt_enable_subtype_set( \
  6193. word, flag, mode, type, subtype, val) \
  6194. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6195. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6196. #define htt_rx_ring_pkt_enable_subtype_get( \
  6197. word, flag, mode, type, subtype) \
  6198. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6199. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6200. /* Definition to filter in TLVs */
  6201. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6202. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6203. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6204. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6205. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6223. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6229. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6230. do { \
  6231. HTT_CHECK_SET_VAL(httsym, enable); \
  6232. (word) |= (enable) << httsym##_S; \
  6233. } while (0)
  6234. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6235. (((word) & httsym##_M) >> httsym##_S)
  6236. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6237. HTT_RX_RING_TLV_ENABLE_SET( \
  6238. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6239. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6240. HTT_RX_RING_TLV_ENABLE_GET( \
  6241. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6242. /**
  6243. * @brief host -> target TX monitor config message
  6244. *
  6245. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6246. *
  6247. * @details
  6248. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6249. * configure RXDMA rings.
  6250. * The configuration is per ring based and includes both packet types
  6251. * and PPDU/MPDU TLVs.
  6252. *
  6253. * The message would appear as follows:
  6254. *
  6255. * |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|
  6256. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6257. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6258. * |-----------+--------+--------+-----+------------------------------------|
  6259. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6260. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6261. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6262. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6263. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6264. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6265. * |------------------------------------------------------------------------|
  6266. * | tlv_filter_mask_in0 |
  6267. * |------------------------------------------------------------------------|
  6268. * | tlv_filter_mask_in1 |
  6269. * |------------------------------------------------------------------------|
  6270. * | tlv_filter_mask_in2 |
  6271. * |------------------------------------------------------------------------|
  6272. * | tlv_filter_mask_in3 |
  6273. * |-----------------+-----------------+---------------------+--------------|
  6274. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6275. * |------------------------------------------------------------------------|
  6276. * | pcu_ppdu_setup_word_mask |
  6277. * |--------------------+--+--+--+-----+---------------------+--------------|
  6278. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6279. * |------------------------------------------------------------------------|
  6280. *
  6281. * Where:
  6282. * PS = pkt_swap
  6283. * SS = status_swap
  6284. * The message is interpreted as follows:
  6285. * dword0 - b'0:7 - msg_type: This will be set to
  6286. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6287. * b'8:15 - pdev_id:
  6288. * 0 (for rings at SOC level),
  6289. * 1/2/3 mac id (for rings at LMAC level)
  6290. * b'16:23 - ring_id : Identify the ring to configure.
  6291. * More details can be got from enum htt_srng_ring_id
  6292. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6293. * BUF_RING_CFG_0 defs within HW .h files,
  6294. * e.g. wmac_top_reg_seq_hwioreg.h
  6295. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6296. * BUF_RING_CFG_0 defs within HW .h files,
  6297. * e.g. wmac_top_reg_seq_hwioreg.h
  6298. * b'26 - tx_mon_global_en: Enable/Disable global register
  6299. * configuration in Tx monitor module.
  6300. * b'27:31 - rsvd1: reserved for future use
  6301. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6302. * in byte units.
  6303. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6304. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6305. * 64, 128, 256.
  6306. * If all 3 bits are set config length is > 256.
  6307. * if val is '0', then ignore this field.
  6308. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6309. * 64, 128, 256.
  6310. * If all 3 bits are set config length is > 256.
  6311. * if val is '0', then ignore this field.
  6312. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6313. * 64, 128, 256.
  6314. * If all 3 bits are set config length is > 256.
  6315. * If val is '0', then ignore this field.
  6316. * - b'25:31 - rsvd2: Reserved for future use
  6317. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6318. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6319. * If packet_type_enable_flags is '1' for MGMT type,
  6320. * monitor will ignore this bit and allow this TLV.
  6321. * If packet_type_enable_flags is '0' for MGMT type,
  6322. * monitor will use this bit to enable/disable logging
  6323. * of this TLV.
  6324. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6325. * If packet_type_enable_flags is '1' for CTRL type,
  6326. * monitor will ignore this bit and allow this TLV.
  6327. * If packet_type_enable_flags is '0' for CTRL type,
  6328. * monitor will use this bit to enable/disable logging
  6329. * of this TLV.
  6330. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6331. * If packet_type_enable_flags is '1' for DATA type,
  6332. * monitor will ignore this bit and allow this TLV.
  6333. * If packet_type_enable_flags is '0' for DATA type,
  6334. * monitor will use this bit to enable/disable logging
  6335. * of this TLV.
  6336. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6337. * If packet_type_enable_flags is '1' for MGMT type,
  6338. * monitor will ignore this bit and allow this TLV.
  6339. * If packet_type_enable_flags is '0' for MGMT type,
  6340. * monitor will use this bit to enable/disable logging
  6341. * of this TLV.
  6342. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6343. * If packet_type_enable_flags is '1' for CTRL type,
  6344. * monitor will ignore this bit and allow this TLV.
  6345. * If packet_type_enable_flags is '0' for CTRL type,
  6346. * monitor will use this bit to enable/disable logging
  6347. * of this TLV.
  6348. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6349. * If packet_type_enable_flags is '1' for DATA type,
  6350. * monitor will ignore this bit and allow this TLV.
  6351. * If packet_type_enable_flags is '0' for DATA type,
  6352. * monitor will use this bit to enable/disable logging
  6353. * of this TLV.
  6354. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6355. * If packet_type_enable_flags is '1' for MGMT type,
  6356. * monitor will ignore this bit and allow this TLV.
  6357. * If packet_type_enable_flags is '0' for MGMT type,
  6358. * monitor will use this bit to enable/disable logging
  6359. * of this TLV.
  6360. * If filter_in_TX_MPDU_START = 1 it is recommended
  6361. * to set this bit.
  6362. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6363. * If packet_type_enable_flags is '1' for CTRL type,
  6364. * monitor will ignore this bit and allow this TLV.
  6365. * If packet_type_enable_flags is '0' for CTRL type,
  6366. * monitor will use this bit to enable/disable logging
  6367. * of this TLV.
  6368. * If filter_in_TX_MPDU_START = 1 it is recommended
  6369. * to set this bit.
  6370. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6371. * If packet_type_enable_flags is '1' for DATA type,
  6372. * monitor will ignore this bit and allow this TLV.
  6373. * If packet_type_enable_flags is '0' for DATA type,
  6374. * monitor will use this bit to enable/disable logging
  6375. * of this TLV.
  6376. * If filter_in_TX_MPDU_START = 1 it is recommended
  6377. * to set this bit.
  6378. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6379. * If packet_type_enable_flags is '1' for MGMT type,
  6380. * monitor will ignore this bit and allow this TLV.
  6381. * If packet_type_enable_flags is '0' for MGMT type,
  6382. * monitor will use this bit to enable/disable logging
  6383. * of this TLV.
  6384. * If filter_in_TX_MSDU_START = 1 it is recommended
  6385. * to set this bit.
  6386. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6387. * If packet_type_enable_flags is '1' for CTRL type,
  6388. * monitor will ignore this bit and allow this TLV.
  6389. * If packet_type_enable_flags is '0' for CTRL type,
  6390. * monitor will use this bit to enable/disable logging
  6391. * of this TLV.
  6392. * If filter_in_TX_MSDU_START = 1 it is recommended
  6393. * to set this bit.
  6394. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6395. * If packet_type_enable_flags is '1' for DATA type,
  6396. * monitor will ignore this bit and allow this TLV.
  6397. * If packet_type_enable_flags is '0' for DATA type,
  6398. * monitor will use this bit to enable/disable logging
  6399. * of this TLV.
  6400. * If filter_in_TX_MSDU_START = 1 it is recommended
  6401. * to set this bit.
  6402. * b'15:31 - rsvd3: Reserved for future use
  6403. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6404. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6405. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6406. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6407. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6408. * - b'8:15 - tx_peer_entry_word_mask:
  6409. * - b'16:23 - tx_queue_ext_word_mask:
  6410. * - b'24:31 - tx_msdu_start_word_mask:
  6411. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6412. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6413. * - b'8:15 - rxpcu_user_setup_word_mask:
  6414. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6415. * MGMT, CTRL, DATA
  6416. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6417. * 0 -> MSDU level logging is enabled
  6418. * (valid only if bit is set in
  6419. * pkt_type_enable_msdu_or_mpdu_logging)
  6420. * 1 -> MPDU level logging is enabled
  6421. * (valid only if bit is set in
  6422. * pkt_type_enable_msdu_or_mpdu_logging)
  6423. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6424. * 0 -> MSDU level logging is enabled
  6425. * (valid only if bit is set in
  6426. * pkt_type_enable_msdu_or_mpdu_logging)
  6427. * 1 -> MPDU level logging is enabled
  6428. * (valid only if bit is set in
  6429. * pkt_type_enable_msdu_or_mpdu_logging)
  6430. * - b'21 - dma_mpdu_data(D) : For DATA
  6431. * 0 -> MSDU level logging is enabled
  6432. * (valid only if bit is set in
  6433. * pkt_type_enable_msdu_or_mpdu_logging)
  6434. * 1 -> MPDU level logging is enabled
  6435. * (valid only if bit is set in
  6436. * pkt_type_enable_msdu_or_mpdu_logging)
  6437. * - b'22:31 - rsvd4 for future use
  6438. */
  6439. PREPACK struct htt_tx_monitor_cfg_t {
  6440. A_UINT32 msg_type: 8,
  6441. pdev_id: 8,
  6442. ring_id: 8,
  6443. status_swap: 1,
  6444. pkt_swap: 1,
  6445. tx_mon_global_en: 1,
  6446. rsvd1: 5;
  6447. A_UINT32 ring_buffer_size: 16,
  6448. config_length_mgmt: 3,
  6449. config_length_ctrl: 3,
  6450. config_length_data: 3,
  6451. rsvd2: 7;
  6452. A_UINT32 pkt_type_enable_flags: 3,
  6453. filter_in_tx_mpdu_start_mgmt: 1,
  6454. filter_in_tx_mpdu_start_ctrl: 1,
  6455. filter_in_tx_mpdu_start_data: 1,
  6456. filter_in_tx_msdu_start_mgmt: 1,
  6457. filter_in_tx_msdu_start_ctrl: 1,
  6458. filter_in_tx_msdu_start_data: 1,
  6459. filter_in_tx_mpdu_end_mgmt: 1,
  6460. filter_in_tx_mpdu_end_ctrl: 1,
  6461. filter_in_tx_mpdu_end_data: 1,
  6462. filter_in_tx_msdu_end_mgmt: 1,
  6463. filter_in_tx_msdu_end_ctrl: 1,
  6464. filter_in_tx_msdu_end_data: 1,
  6465. rsvd3: 17;
  6466. A_UINT32 tlv_filter_mask_in0;
  6467. A_UINT32 tlv_filter_mask_in1;
  6468. A_UINT32 tlv_filter_mask_in2;
  6469. A_UINT32 tlv_filter_mask_in3;
  6470. A_UINT32 tx_fes_setup_word_mask: 8,
  6471. tx_peer_entry_word_mask: 8,
  6472. tx_queue_ext_word_mask: 8,
  6473. tx_msdu_start_word_mask: 8;
  6474. A_UINT32 pcu_ppdu_setup_word_mask;
  6475. A_UINT32 tx_mpdu_start_word_mask: 8,
  6476. rxpcu_user_setup_word_mask: 8,
  6477. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6478. dma_mpdu_mgmt: 1,
  6479. dma_mpdu_ctrl: 1,
  6480. dma_mpdu_data: 1,
  6481. rsvd4: 10;
  6482. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6483. tx_peer_entry_v2_word_mask: 12,
  6484. rsvd5: 10;
  6485. A_UINT32 fes_status_end_word_mask: 16,
  6486. response_end_status_word_mask: 16;
  6487. A_UINT32 fes_status_prot_word_mask: 11,
  6488. rsvd6: 21;
  6489. } POSTPACK;
  6490. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6491. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6492. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6493. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6494. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6495. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6496. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6497. do { \
  6498. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6499. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6500. } while (0)
  6501. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6502. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6503. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6504. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6505. HTT_TX_MONITOR_CFG_RING_ID_S)
  6506. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6507. do { \
  6508. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6509. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6510. } while (0)
  6511. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6512. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6513. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6514. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6515. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6516. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6517. do { \
  6518. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6519. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6520. } while (0)
  6521. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6522. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6523. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6524. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6525. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6526. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6527. do { \
  6528. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6529. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6530. } while (0)
  6531. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6532. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6533. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6534. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6535. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6536. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6539. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6540. } while (0)
  6541. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6542. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6543. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6544. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6545. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6546. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6547. do { \
  6548. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6549. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6550. } while (0)
  6551. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6552. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6553. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6554. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6555. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6556. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6557. do { \
  6558. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6559. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6560. } while (0)
  6561. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6562. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6563. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6564. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6565. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6566. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6567. do { \
  6568. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6569. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6570. } while (0)
  6571. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6572. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6573. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6574. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6575. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6576. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6577. do { \
  6578. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6579. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6580. } while (0)
  6581. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6582. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6583. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6584. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6585. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6586. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6587. do { \
  6588. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6589. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6590. } while (0)
  6591. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6592. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6593. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6594. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6595. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6596. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6597. do { \
  6598. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6599. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6600. } while (0)
  6601. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6602. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6603. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6604. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6605. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6606. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6607. do { \
  6608. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6609. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6610. } while (0)
  6611. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6612. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6613. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6614. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6615. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6616. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6617. do { \
  6618. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6619. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6620. } while (0)
  6621. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6622. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6623. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6624. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6625. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6626. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6627. do { \
  6628. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6629. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6630. } while (0)
  6631. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6632. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6633. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6634. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6635. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6636. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6637. do { \
  6638. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6639. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6640. } while (0)
  6641. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6642. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6643. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6644. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6645. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6646. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6647. do { \
  6648. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6649. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6650. } while (0)
  6651. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6652. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6653. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6654. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6655. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6656. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6657. do { \
  6658. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6659. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6660. } while (0)
  6661. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6662. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6663. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6664. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6665. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6666. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6667. do { \
  6668. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6669. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6670. } while (0)
  6671. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6672. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6673. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6674. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6675. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6676. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6677. do { \
  6678. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6679. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6680. } while (0)
  6681. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6682. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6683. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6684. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6685. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6686. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6687. do { \
  6688. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6689. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6690. } while (0)
  6691. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6692. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6693. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6694. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6695. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6696. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6697. do { \
  6698. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6699. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6700. } while (0)
  6701. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6702. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6703. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6704. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6705. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6706. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6707. do { \
  6708. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6709. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6710. } while (0)
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6714. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6715. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6717. do { \
  6718. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6719. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6720. } while (0)
  6721. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6722. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6723. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6724. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6725. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6726. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6727. do { \
  6728. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6729. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6730. } while (0)
  6731. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6732. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6733. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6734. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6735. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6736. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6737. do { \
  6738. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6739. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6740. } while (0)
  6741. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6742. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6743. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6744. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6745. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6746. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6747. do { \
  6748. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6749. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6750. } while (0)
  6751. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6752. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6753. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6754. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6755. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6756. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6757. do { \
  6758. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6759. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6760. } while (0)
  6761. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6762. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6763. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6764. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6765. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6766. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6767. do { \
  6768. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6769. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6770. } while (0)
  6771. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6772. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6773. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6774. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6775. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6776. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6777. do { \
  6778. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6779. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6780. } while (0)
  6781. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6782. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6783. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6784. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6785. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6786. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6787. do { \
  6788. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6789. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6790. } while (0)
  6791. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6792. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6793. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6794. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6795. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6796. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6797. do { \
  6798. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6799. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6800. } while (0)
  6801. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6802. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6803. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6804. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6805. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6806. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6807. do { \
  6808. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6809. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6810. } while (0)
  6811. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6812. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6813. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6814. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6815. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6816. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6817. do { \
  6818. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6819. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6820. } while (0)
  6821. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6822. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6823. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6824. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6825. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6826. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6827. do { \
  6828. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6829. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6830. } while (0)
  6831. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6832. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6833. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6834. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6835. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6836. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6837. do { \
  6838. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6839. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6840. } while (0)
  6841. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6842. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6843. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6844. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6845. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6846. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6847. do { \
  6848. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6849. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6850. } while (0)
  6851. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6852. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6853. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6854. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6855. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6856. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6857. do { \
  6858. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6859. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6860. } while (0)
  6861. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6862. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6863. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6864. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6865. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6866. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6867. do { \
  6868. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6869. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6870. } while (0)
  6871. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6872. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6873. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6874. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6875. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6876. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6877. do { \
  6878. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6879. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6880. } while (0)
  6881. /*
  6882. * pkt_type_enable_flags
  6883. */
  6884. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6885. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6886. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6887. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6888. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6889. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6890. /*
  6891. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6892. */
  6893. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6894. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6895. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6896. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6897. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6898. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6899. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6900. do { \
  6901. HTT_CHECK_SET_VAL(httsym, value); \
  6902. (word) |= (value) << httsym##_S; \
  6903. } while (0)
  6904. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6905. (((word) & httsym##_M) >> httsym##_S)
  6906. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6907. * type -> MGMT, CTRL, DATA*/
  6908. #define htt_tx_ring_pkt_type_set( \
  6909. word, mode, type, val) \
  6910. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6911. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6912. #define htt_tx_ring_pkt_type_get( \
  6913. word, mode, type) \
  6914. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6915. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6916. /* Definition to filter in TLVs */
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6981. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6982. do { \
  6983. HTT_CHECK_SET_VAL(httsym, enable); \
  6984. (word) |= (enable) << httsym##_S; \
  6985. } while (0)
  6986. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6987. (((word) & httsym##_M) >> httsym##_S)
  6988. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6989. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6990. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6991. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6992. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6993. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7058. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7059. do { \
  7060. HTT_CHECK_SET_VAL(httsym, enable); \
  7061. (word) |= (enable) << httsym##_S; \
  7062. } while (0)
  7063. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7064. (((word) & httsym##_M) >> httsym##_S)
  7065. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7066. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7067. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7068. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7069. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7070. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7135. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7136. do { \
  7137. HTT_CHECK_SET_VAL(httsym, enable); \
  7138. (word) |= (enable) << httsym##_S; \
  7139. } while (0)
  7140. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7141. (((word) & httsym##_M) >> httsym##_S)
  7142. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7143. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7144. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7145. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7146. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7147. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7192. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7193. do { \
  7194. HTT_CHECK_SET_VAL(httsym, enable); \
  7195. (word) |= (enable) << httsym##_S; \
  7196. } while (0)
  7197. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7198. (((word) & httsym##_M) >> httsym##_S)
  7199. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7200. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7201. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7202. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7203. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7204. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7205. /**
  7206. * @brief host --> target Receive Flow Steering configuration message definition
  7207. *
  7208. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7209. *
  7210. * host --> target Receive Flow Steering configuration message definition.
  7211. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7212. * The reason for this is we want RFS to be configured and ready before MAC
  7213. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7214. *
  7215. * |31 24|23 16|15 9|8|7 0|
  7216. * |----------------+----------------+----------------+----------------|
  7217. * | reserved |E| msg type |
  7218. * |-------------------------------------------------------------------|
  7219. * Where E = RFS enable flag
  7220. *
  7221. * The RFS_CONFIG message consists of a single 4-byte word.
  7222. *
  7223. * Header fields:
  7224. * - MSG_TYPE
  7225. * Bits 7:0
  7226. * Purpose: identifies this as a RFS config msg
  7227. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7228. * - RFS_CONFIG
  7229. * Bit 8
  7230. * Purpose: Tells target whether to enable (1) or disable (0)
  7231. * flow steering feature when sending rx indication messages to host
  7232. */
  7233. #define HTT_H2T_RFS_CONFIG_M 0x100
  7234. #define HTT_H2T_RFS_CONFIG_S 8
  7235. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7236. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7237. HTT_H2T_RFS_CONFIG_S)
  7238. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7239. do { \
  7240. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7241. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7242. } while (0)
  7243. #define HTT_RFS_CFG_REQ_BYTES 4
  7244. /**
  7245. * @brief host -> target FW extended statistics request
  7246. *
  7247. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7248. *
  7249. * @details
  7250. * The following field definitions describe the format of the HTT host
  7251. * to target FW extended stats retrieve message.
  7252. * The message specifies the type of stats the host wants to retrieve.
  7253. *
  7254. * |31 24|23 16|15 8|7 0|
  7255. * |-----------------------------------------------------------|
  7256. * | reserved | stats type | pdev_mask | msg type |
  7257. * |-----------------------------------------------------------|
  7258. * | config param [0] |
  7259. * |-----------------------------------------------------------|
  7260. * | config param [1] |
  7261. * |-----------------------------------------------------------|
  7262. * | config param [2] |
  7263. * |-----------------------------------------------------------|
  7264. * | config param [3] |
  7265. * |-----------------------------------------------------------|
  7266. * | reserved |
  7267. * |-----------------------------------------------------------|
  7268. * | cookie LSBs |
  7269. * |-----------------------------------------------------------|
  7270. * | cookie MSBs |
  7271. * |-----------------------------------------------------------|
  7272. * Header fields:
  7273. * - MSG_TYPE
  7274. * Bits 7:0
  7275. * Purpose: identifies this is a extended stats upload request message
  7276. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7277. * - PDEV_MASK
  7278. * Bits 8:15
  7279. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7280. * Value: This is a overloaded field, refer to usage and interpretation of
  7281. * PDEV in interface document.
  7282. * Bit 8 : Reserved for SOC stats
  7283. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7284. * Indicates MACID_MASK in DBS
  7285. * - STATS_TYPE
  7286. * Bits 23:16
  7287. * Purpose: identifies which FW statistics to upload
  7288. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7289. * - Reserved
  7290. * Bits 31:24
  7291. * - CONFIG_PARAM [0]
  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 [1]
  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 [2]
  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. * - CONFIG_PARAM [3]
  7307. * Bits 31:0
  7308. * Purpose: give an opaque configuration value to the specified stats type
  7309. * Value: stats-type specific configuration value
  7310. * Refer to htt_stats.h for interpretation for each stats sub_type
  7311. * - Reserved [31:0] for future use.
  7312. * - COOKIE_LSBS
  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: LSBs of the opaque cookie specified by the host-side requestor
  7317. * - COOKIE_MSBS
  7318. * Bits 31:0
  7319. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7320. * message with its preceding host->target stats request message.
  7321. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7322. */
  7323. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7324. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7325. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7326. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7327. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7328. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7329. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7330. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7331. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7332. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7333. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7334. do { \
  7335. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7336. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7337. } while (0)
  7338. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7339. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7340. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7341. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7342. do { \
  7343. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7344. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7345. } while (0)
  7346. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7347. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7348. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7349. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7350. do { \
  7351. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7352. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7353. } while (0)
  7354. /**
  7355. * @brief host -> target FW streaming statistics request
  7356. *
  7357. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7358. *
  7359. * @details
  7360. * The following field definitions describe the format of the HTT host
  7361. * to target message that requests the target to start or stop producing
  7362. * ongoing stats of the specified type.
  7363. *
  7364. * |31|30 |23 16|15 8|7 0|
  7365. * |-----------------------------------------------------------|
  7366. * |EN| reserved | stats type | reserved | msg type |
  7367. * |-----------------------------------------------------------|
  7368. * | config param [0] |
  7369. * |-----------------------------------------------------------|
  7370. * | config param [1] |
  7371. * |-----------------------------------------------------------|
  7372. * | config param [2] |
  7373. * |-----------------------------------------------------------|
  7374. * | config param [3] |
  7375. * |-----------------------------------------------------------|
  7376. * Where:
  7377. * - EN is an enable/disable flag
  7378. * Header fields:
  7379. * - MSG_TYPE
  7380. * Bits 7:0
  7381. * Purpose: identifies this is a streaming stats upload request message
  7382. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7383. * - STATS_TYPE
  7384. * Bits 23:16
  7385. * Purpose: identifies which FW statistics to upload
  7386. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7387. * Only the htt_dbg_ext_stats_type values identified as streaming
  7388. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7389. * - ENABLE
  7390. * Bit 31
  7391. * Purpose: enable/disable the target's ongoing stats of the specified type
  7392. * Value:
  7393. * 0 - disable ongoing production of the specified stats type
  7394. * 1 - enable ongoing production of the specified stats type
  7395. * - CONFIG_PARAM [0]
  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 [1]
  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 [2]
  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. * - CONFIG_PARAM [3]
  7411. * Bits 31:0
  7412. * Purpose: give an opaque configuration value to the specified stats type
  7413. * Value: stats-type specific configuration value
  7414. * Refer to htt_stats.h for interpretation for each stats sub_type
  7415. */
  7416. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7417. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7418. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7419. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7420. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7421. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7422. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7423. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7424. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7425. do { \
  7426. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7427. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7428. } while (0)
  7429. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7430. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7431. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7432. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7433. do { \
  7434. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7435. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7436. } while (0)
  7437. /**
  7438. * @brief host -> target FW PPDU_STATS request message
  7439. *
  7440. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7441. *
  7442. * @details
  7443. * The following field definitions describe the format of the HTT host
  7444. * to target FW for PPDU_STATS_CFG msg.
  7445. * The message allows the host to configure the PPDU_STATS_IND messages
  7446. * produced by the target.
  7447. *
  7448. * |31 24|23 16|15 8|7 0|
  7449. * |-----------------------------------------------------------|
  7450. * | REQ bit mask | pdev_mask | msg type |
  7451. * |-----------------------------------------------------------|
  7452. * Header fields:
  7453. * - MSG_TYPE
  7454. * Bits 7:0
  7455. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7456. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7457. * - PDEV_MASK
  7458. * Bits 8:15
  7459. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7460. * Value: This is a overloaded field, refer to usage and interpretation of
  7461. * PDEV in interface document.
  7462. * Bit 8 : Reserved for SOC stats
  7463. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7464. * Indicates MACID_MASK in DBS
  7465. * - REQ_TLV_BIT_MASK
  7466. * Bits 16:31
  7467. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7468. * needs to be included in the target's PPDU_STATS_IND messages.
  7469. * Value: refer htt_ppdu_stats_tlv_tag_t
  7470. *
  7471. */
  7472. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7473. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7474. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7475. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7476. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7477. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7478. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7479. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7480. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7481. do { \
  7482. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7483. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7484. } while (0)
  7485. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7486. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7487. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7488. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7489. do { \
  7490. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7491. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7492. } while (0)
  7493. /**
  7494. * @brief Host-->target HTT RX FSE setup message
  7495. *
  7496. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7497. *
  7498. * @details
  7499. * Through this message, the host will provide details of the flow tables
  7500. * in host DDR along with hash keys.
  7501. * This message can be sent per SOC or per PDEV, which is differentiated
  7502. * by pdev id values.
  7503. * The host will allocate flow search table and sends table size,
  7504. * physical DMA address of flow table, and hash keys to firmware to
  7505. * program into the RXOLE FSE HW block.
  7506. *
  7507. * The following field definitions describe the format of the RX FSE setup
  7508. * message sent from the host to target
  7509. *
  7510. * Header fields:
  7511. * dword0 - b'7:0 - msg_type: This will be set to
  7512. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7513. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7514. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7515. * pdev's LMAC ring.
  7516. * b'31:16 - reserved : Reserved for future use
  7517. * dword1 - b'19:0 - number of records: This field indicates the number of
  7518. * entries in the flow table. For example: 8k number of
  7519. * records is equivalent to
  7520. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7521. * b'27:20 - max search: This field specifies the skid length to FSE
  7522. * parser HW module whenever match is not found at the
  7523. * exact index pointed by hash.
  7524. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7525. * Refer htt_ip_da_sa_prefix below for more details.
  7526. * b'31:30 - reserved: Reserved for future use
  7527. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7528. * table allocated by host in DDR
  7529. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7530. * table allocated by host in DDR
  7531. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7532. * entry hashing
  7533. *
  7534. *
  7535. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7536. * |---------------------------------------------------------------|
  7537. * | reserved | pdev_id | MSG_TYPE |
  7538. * |---------------------------------------------------------------|
  7539. * |resvd|IPDSA| max_search | Number of records |
  7540. * |---------------------------------------------------------------|
  7541. * | base address lo |
  7542. * |---------------------------------------------------------------|
  7543. * | base address high |
  7544. * |---------------------------------------------------------------|
  7545. * | toeplitz key 31_0 |
  7546. * |---------------------------------------------------------------|
  7547. * | toeplitz key 63_32 |
  7548. * |---------------------------------------------------------------|
  7549. * | toeplitz key 95_64 |
  7550. * |---------------------------------------------------------------|
  7551. * | toeplitz key 127_96 |
  7552. * |---------------------------------------------------------------|
  7553. * | toeplitz key 159_128 |
  7554. * |---------------------------------------------------------------|
  7555. * | toeplitz key 191_160 |
  7556. * |---------------------------------------------------------------|
  7557. * | toeplitz key 223_192 |
  7558. * |---------------------------------------------------------------|
  7559. * | toeplitz key 255_224 |
  7560. * |---------------------------------------------------------------|
  7561. * | toeplitz key 287_256 |
  7562. * |---------------------------------------------------------------|
  7563. * | reserved | toeplitz key 314_288(26:0 bits) |
  7564. * |---------------------------------------------------------------|
  7565. * where:
  7566. * IPDSA = ip_da_sa
  7567. */
  7568. /**
  7569. * @brief: htt_ip_da_sa_prefix
  7570. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7571. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7572. * documentation per RFC3849
  7573. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7574. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7575. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7576. */
  7577. enum htt_ip_da_sa_prefix {
  7578. HTT_RX_IPV6_20010db8,
  7579. HTT_RX_IPV4_MAPPED_IPV6,
  7580. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7581. HTT_RX_IPV6_64FF9B,
  7582. };
  7583. /**
  7584. * @brief Host-->target HTT RX FISA configure and enable
  7585. *
  7586. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7587. *
  7588. * @details
  7589. * The host will send this command down to configure and enable the FISA
  7590. * operational params.
  7591. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7592. * register.
  7593. * Should configure both the MACs.
  7594. *
  7595. * dword0 - b'7:0 - msg_type:
  7596. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7597. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7598. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7599. * pdev's LMAC ring.
  7600. * b'31:16 - reserved : Reserved for future use
  7601. *
  7602. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7603. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7604. * packets. 1 flow search will be skipped
  7605. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7606. * tcp,udp packets
  7607. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7608. * calculation
  7609. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7610. * calculation
  7611. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7612. * calculation
  7613. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7614. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7615. * length
  7616. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7617. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7618. * length
  7619. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7620. * num jump
  7621. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7622. * num jump
  7623. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7624. * data type switch has happened for MPDU Sequence num jump
  7625. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7626. * for MPDU Sequence num jump
  7627. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7628. * for decrypt errors
  7629. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7630. * while aggregating a msdu
  7631. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7632. * The aggregation is done until (number of MSDUs aggregated
  7633. * < LIMIT + 1)
  7634. * b'31:18 - Reserved
  7635. *
  7636. * fisa_control_value - 32bit value FW can write to register
  7637. *
  7638. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7639. * Threshold value for FISA timeout (units are microseconds).
  7640. * When the global timestamp exceeds this threshold, FISA
  7641. * aggregation will be restarted.
  7642. * A value of 0 means timeout is disabled.
  7643. * Compare the threshold register with timestamp field in
  7644. * flow entry to generate timeout for the flow.
  7645. *
  7646. * |31 18 |17 16|15 8|7 0|
  7647. * |-------------------------------------------------------------|
  7648. * | reserved | pdev_mask | msg type |
  7649. * |-------------------------------------------------------------|
  7650. * | reserved | FISA_CTRL |
  7651. * |-------------------------------------------------------------|
  7652. * | FISA_TIMEOUT_THRESH |
  7653. * |-------------------------------------------------------------|
  7654. */
  7655. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7656. A_UINT32 msg_type:8,
  7657. pdev_id:8,
  7658. reserved0:16;
  7659. /**
  7660. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7661. * [17:0]
  7662. */
  7663. union {
  7664. /*
  7665. * fisa_control_bits structure is deprecated.
  7666. * Please use fisa_control_bits_v2 going forward.
  7667. */
  7668. struct {
  7669. A_UINT32 fisa_enable: 1,
  7670. ipsec_skip_search: 1,
  7671. nontcp_skip_search: 1,
  7672. add_ipv4_fixed_hdr_len: 1,
  7673. add_ipv6_fixed_hdr_len: 1,
  7674. add_tcp_fixed_hdr_len: 1,
  7675. add_udp_hdr_len: 1,
  7676. chksum_cum_ip_len_en: 1,
  7677. disable_tid_check: 1,
  7678. disable_ta_check: 1,
  7679. disable_qos_check: 1,
  7680. disable_raw_check: 1,
  7681. disable_decrypt_err_check: 1,
  7682. disable_msdu_drop_check: 1,
  7683. fisa_aggr_limit: 4,
  7684. reserved: 14;
  7685. } fisa_control_bits;
  7686. struct {
  7687. A_UINT32 fisa_enable: 1,
  7688. fisa_aggr_limit: 4,
  7689. reserved: 27;
  7690. } fisa_control_bits_v2;
  7691. A_UINT32 fisa_control_value;
  7692. } u_fisa_control;
  7693. /**
  7694. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7695. * timeout threshold for aggregation. Unit in usec.
  7696. * [31:0]
  7697. */
  7698. A_UINT32 fisa_timeout_threshold;
  7699. } POSTPACK;
  7700. /* DWord 0: pdev-ID */
  7701. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7702. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7703. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7704. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7705. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7706. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7707. do { \
  7708. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7709. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7710. } while (0)
  7711. /* Dword 1: fisa_control_value fisa config */
  7712. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7713. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7714. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7715. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7716. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7717. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7718. do { \
  7719. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7720. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7721. } while (0)
  7722. /* Dword 1: fisa_control_value ipsec_skip_search */
  7723. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7724. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7725. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7726. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7727. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7728. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7729. do { \
  7730. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7731. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7732. } while (0)
  7733. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7734. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7735. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7736. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7737. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7738. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7739. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7740. do { \
  7741. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7742. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7743. } while (0)
  7744. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7745. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7746. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7747. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7748. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7749. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7750. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7751. do { \
  7752. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7753. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7754. } while (0)
  7755. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7756. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7757. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7758. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7759. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7760. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7761. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7762. do { \
  7763. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7764. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7765. } while (0)
  7766. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7767. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7768. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7769. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7770. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7771. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7772. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7773. do { \
  7774. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7775. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7776. } while (0)
  7777. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7778. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7779. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7780. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7781. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7782. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7783. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7784. do { \
  7785. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7786. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7787. } while (0)
  7788. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7789. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7790. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7791. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7792. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7793. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7794. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7795. do { \
  7796. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7797. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7798. } while (0)
  7799. /* Dword 1: fisa_control_value disable_tid_check */
  7800. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7801. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7802. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7803. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7804. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7805. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7806. do { \
  7807. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7808. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7809. } while (0)
  7810. /* Dword 1: fisa_control_value disable_ta_check */
  7811. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7812. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7813. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7814. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7815. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7816. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7817. do { \
  7818. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7819. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7820. } while (0)
  7821. /* Dword 1: fisa_control_value disable_qos_check */
  7822. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7823. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7824. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7825. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7826. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7827. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7828. do { \
  7829. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7830. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7831. } while (0)
  7832. /* Dword 1: fisa_control_value disable_raw_check */
  7833. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7834. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7835. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7836. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7837. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7838. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7839. do { \
  7840. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7841. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7842. } while (0)
  7843. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7844. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7845. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7846. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7847. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7848. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7849. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7850. do { \
  7851. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7852. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7853. } while (0)
  7854. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7855. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7856. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7857. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7858. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7859. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7860. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7861. do { \
  7862. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7863. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7864. } while (0)
  7865. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7866. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7867. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7868. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7869. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7870. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7871. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7872. do { \
  7873. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7874. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7875. } while (0)
  7876. /* Dword 1: fisa_control_value fisa config */
  7877. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7878. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7879. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7880. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7881. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7882. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7883. do { \
  7884. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7885. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7886. } while (0)
  7887. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7888. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7889. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7890. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7891. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7892. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7893. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7894. do { \
  7895. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7896. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7897. } while (0)
  7898. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7899. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7900. pdev_id:8,
  7901. reserved0:16;
  7902. A_UINT32 num_records:20,
  7903. max_search:8,
  7904. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7905. reserved1:2;
  7906. A_UINT32 base_addr_lo;
  7907. A_UINT32 base_addr_hi;
  7908. A_UINT32 toeplitz31_0;
  7909. A_UINT32 toeplitz63_32;
  7910. A_UINT32 toeplitz95_64;
  7911. A_UINT32 toeplitz127_96;
  7912. A_UINT32 toeplitz159_128;
  7913. A_UINT32 toeplitz191_160;
  7914. A_UINT32 toeplitz223_192;
  7915. A_UINT32 toeplitz255_224;
  7916. A_UINT32 toeplitz287_256;
  7917. A_UINT32 toeplitz314_288:27,
  7918. reserved2:5;
  7919. } POSTPACK;
  7920. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7921. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7922. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7923. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7924. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7925. /* DWORD 0: Pdev ID */
  7926. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7927. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7928. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7929. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7930. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7931. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7932. do { \
  7933. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7934. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7935. } while (0)
  7936. /* DWORD 1:num of records */
  7937. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7938. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7939. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7940. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7941. HTT_RX_FSE_SETUP_NUM_REC_S)
  7942. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7943. do { \
  7944. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7945. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7946. } while (0)
  7947. /* DWORD 1:max_search */
  7948. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7949. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7950. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7951. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7952. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7953. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7954. do { \
  7955. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7956. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7957. } while (0)
  7958. /* DWORD 1:ip_da_sa prefix */
  7959. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7960. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7961. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7962. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7963. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7964. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7965. do { \
  7966. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7967. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7968. } while (0)
  7969. /* DWORD 2: Base Address LO */
  7970. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7971. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7972. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7973. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7974. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7975. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7976. do { \
  7977. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7978. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7979. } while (0)
  7980. /* DWORD 3: Base Address High */
  7981. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7982. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7983. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7984. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7985. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7986. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7987. do { \
  7988. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7989. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7990. } while (0)
  7991. /* DWORD 4-12: Hash Value */
  7992. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7993. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7994. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7995. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7996. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7997. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7998. do { \
  7999. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8000. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8001. } while (0)
  8002. /* DWORD 13: Hash Value 314:288 bits */
  8003. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8004. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8005. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8006. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8007. do { \
  8008. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8009. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8010. } while (0)
  8011. /**
  8012. * @brief Host-->target HTT RX FSE operation message
  8013. *
  8014. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8015. *
  8016. * @details
  8017. * The host will send this Flow Search Engine (FSE) operation message for
  8018. * every flow add/delete operation.
  8019. * The FSE operation includes FSE full cache invalidation or individual entry
  8020. * invalidation.
  8021. * This message can be sent per SOC or per PDEV which is differentiated
  8022. * by pdev id values.
  8023. *
  8024. * |31 16|15 8|7 1|0|
  8025. * |-------------------------------------------------------------|
  8026. * | reserved | pdev_id | MSG_TYPE |
  8027. * |-------------------------------------------------------------|
  8028. * | reserved | operation |I|
  8029. * |-------------------------------------------------------------|
  8030. * | ip_src_addr_31_0 |
  8031. * |-------------------------------------------------------------|
  8032. * | ip_src_addr_63_32 |
  8033. * |-------------------------------------------------------------|
  8034. * | ip_src_addr_95_64 |
  8035. * |-------------------------------------------------------------|
  8036. * | ip_src_addr_127_96 |
  8037. * |-------------------------------------------------------------|
  8038. * | ip_dst_addr_31_0 |
  8039. * |-------------------------------------------------------------|
  8040. * | ip_dst_addr_63_32 |
  8041. * |-------------------------------------------------------------|
  8042. * | ip_dst_addr_95_64 |
  8043. * |-------------------------------------------------------------|
  8044. * | ip_dst_addr_127_96 |
  8045. * |-------------------------------------------------------------|
  8046. * | l4_dst_port | l4_src_port |
  8047. * | (32-bit SPI incase of IPsec) |
  8048. * |-------------------------------------------------------------|
  8049. * | reserved | l4_proto |
  8050. * |-------------------------------------------------------------|
  8051. *
  8052. * where I is 1-bit ipsec_valid.
  8053. *
  8054. * The following field definitions describe the format of the RX FSE operation
  8055. * message sent from the host to target for every add/delete flow entry to flow
  8056. * table.
  8057. *
  8058. * Header fields:
  8059. * dword0 - b'7:0 - msg_type: This will be set to
  8060. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8061. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8062. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8063. * specified pdev's LMAC ring.
  8064. * b'31:16 - reserved : Reserved for future use
  8065. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8066. * (Internet Protocol Security).
  8067. * IPsec describes the framework for providing security at
  8068. * IP layer. IPsec is defined for both versions of IP:
  8069. * IPV4 and IPV6.
  8070. * Please refer to htt_rx_flow_proto enumeration below for
  8071. * more info.
  8072. * ipsec_valid = 1 for IPSEC packets
  8073. * ipsec_valid = 0 for IP Packets
  8074. * b'7:1 - operation: This indicates types of FSE operation.
  8075. * Refer to htt_rx_fse_operation enumeration:
  8076. * 0 - No Cache Invalidation required
  8077. * 1 - Cache invalidate only one entry given by IP
  8078. * src/dest address at DWORD[2:9]
  8079. * 2 - Complete FSE Cache Invalidation
  8080. * 3 - FSE Disable
  8081. * 4 - FSE Enable
  8082. * b'31:8 - reserved: Reserved for future use
  8083. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8084. * for per flow addition/deletion
  8085. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8086. * and the subsequent 3 A_UINT32 will be padding bytes.
  8087. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8088. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8089. * from 0 to 65535 but only 0 to 1023 are designated as
  8090. * 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. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8094. * range from 0 to 65535 but only 0 to 1023 are designated
  8095. * as well-known ports. Refer to [RFC1700] for more details.
  8096. * This field is valid only if
  8097. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8098. * - SPI (31:0): Security Parameters Index is an
  8099. * identification tag added to the header while using IPsec
  8100. * for tunneling the IP traffici.
  8101. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8102. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8103. * Assigned Internet Protocol Numbers.
  8104. * l4_proto numbers for standard protocol like UDP/TCP
  8105. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8106. * l4_proto = 17 for UDP etc.
  8107. * b'31:8 - reserved: Reserved for future use.
  8108. *
  8109. */
  8110. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8111. A_UINT32 msg_type:8,
  8112. pdev_id:8,
  8113. reserved0:16;
  8114. A_UINT32 ipsec_valid:1,
  8115. operation:7,
  8116. reserved1:24;
  8117. A_UINT32 ip_src_addr_31_0;
  8118. A_UINT32 ip_src_addr_63_32;
  8119. A_UINT32 ip_src_addr_95_64;
  8120. A_UINT32 ip_src_addr_127_96;
  8121. A_UINT32 ip_dest_addr_31_0;
  8122. A_UINT32 ip_dest_addr_63_32;
  8123. A_UINT32 ip_dest_addr_95_64;
  8124. A_UINT32 ip_dest_addr_127_96;
  8125. union {
  8126. A_UINT32 spi;
  8127. struct {
  8128. A_UINT32 l4_src_port:16,
  8129. l4_dest_port:16;
  8130. } ip;
  8131. } u;
  8132. A_UINT32 l4_proto:8,
  8133. reserved:24;
  8134. } POSTPACK;
  8135. /**
  8136. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8137. *
  8138. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8139. *
  8140. * @details
  8141. * The host will send this Full monitor mode register configuration message.
  8142. * This message can be sent per SOC or per PDEV which is differentiated
  8143. * by pdev id values.
  8144. *
  8145. * |31 16|15 11|10 8|7 3|2|1|0|
  8146. * |-------------------------------------------------------------|
  8147. * | reserved | pdev_id | MSG_TYPE |
  8148. * |-------------------------------------------------------------|
  8149. * | reserved |Release Ring |N|Z|E|
  8150. * |-------------------------------------------------------------|
  8151. *
  8152. * where E is 1-bit full monitor mode enable/disable.
  8153. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8154. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8155. *
  8156. * The following field definitions describe the format of the full monitor
  8157. * mode configuration message sent from the host to target for each pdev.
  8158. *
  8159. * Header fields:
  8160. * dword0 - b'7:0 - msg_type: This will be set to
  8161. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8162. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8163. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8164. * specified pdev's LMAC ring.
  8165. * b'31:16 - reserved : Reserved for future use.
  8166. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8167. * monitor mode rxdma register is to be enabled or disabled.
  8168. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8169. * additional descriptors at ppdu end for zero mpdus
  8170. * enabled or disabled.
  8171. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8172. * additional descriptors at ppdu end for non zero mpdus
  8173. * enabled or disabled.
  8174. * b'10:3 - release_ring: This indicates the destination ring
  8175. * selection for the descriptor at the end of PPDU
  8176. * 0 - REO ring select
  8177. * 1 - FW ring select
  8178. * 2 - SW ring select
  8179. * 3 - Release ring select
  8180. * Refer to htt_rx_full_mon_release_ring.
  8181. * b'31:11 - reserved for future use
  8182. */
  8183. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8184. A_UINT32 msg_type:8,
  8185. pdev_id:8,
  8186. reserved0:16;
  8187. A_UINT32 full_monitor_mode_enable:1,
  8188. addnl_descs_zero_mpdus_end:1,
  8189. addnl_descs_non_zero_mpdus_end:1,
  8190. release_ring:8,
  8191. reserved1:21;
  8192. } POSTPACK;
  8193. /**
  8194. * Enumeration for full monitor mode destination ring select
  8195. * 0 - REO destination ring select
  8196. * 1 - FW destination ring select
  8197. * 2 - SW destination ring select
  8198. * 3 - Release destination ring select
  8199. */
  8200. enum htt_rx_full_mon_release_ring {
  8201. HTT_RX_MON_RING_REO,
  8202. HTT_RX_MON_RING_FW,
  8203. HTT_RX_MON_RING_SW,
  8204. HTT_RX_MON_RING_RELEASE,
  8205. };
  8206. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8207. /* DWORD 0: Pdev ID */
  8208. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8209. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8210. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8211. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8212. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8213. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8214. do { \
  8215. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8216. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8217. } while (0)
  8218. /* DWORD 1:ENABLE */
  8219. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8220. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8221. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8222. do { \
  8223. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8224. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8225. } while (0)
  8226. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8227. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8228. /* DWORD 1:ZERO_MPDU */
  8229. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8230. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8231. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8232. do { \
  8233. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8234. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8235. } while (0)
  8236. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8237. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8238. /* DWORD 1:NON_ZERO_MPDU */
  8239. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8240. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8241. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8242. do { \
  8243. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8244. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8245. } while (0)
  8246. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8247. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8248. /* DWORD 1:RELEASE_RINGS */
  8249. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8250. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8251. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8252. do { \
  8253. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8254. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8255. } while (0)
  8256. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8257. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8258. /**
  8259. * Enumeration for IP Protocol or IPSEC Protocol
  8260. * IPsec describes the framework for providing security at IP layer.
  8261. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8262. */
  8263. enum htt_rx_flow_proto {
  8264. HTT_RX_FLOW_IP_PROTO,
  8265. HTT_RX_FLOW_IPSEC_PROTO,
  8266. };
  8267. /**
  8268. * Enumeration for FSE Cache Invalidation
  8269. * 0 - No Cache Invalidation required
  8270. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8271. * 2 - Complete FSE Cache Invalidation
  8272. * 3 - FSE Disable
  8273. * 4 - FSE Enable
  8274. */
  8275. enum htt_rx_fse_operation {
  8276. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8277. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8278. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8279. HTT_RX_FSE_DISABLE,
  8280. HTT_RX_FSE_ENABLE,
  8281. };
  8282. /* DWORD 0: Pdev ID */
  8283. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8284. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8285. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8286. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8287. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8288. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8289. do { \
  8290. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8291. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8292. } while (0)
  8293. /* DWORD 1:IP PROTO or IPSEC */
  8294. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8295. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8296. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8297. do { \
  8298. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8299. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8300. } while (0)
  8301. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8302. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8303. /* DWORD 1:FSE Operation */
  8304. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8305. #define HTT_RX_FSE_OPERATION_S 1
  8306. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8307. do { \
  8308. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8309. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8310. } while (0)
  8311. #define HTT_RX_FSE_OPERATION_GET(word) \
  8312. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8313. /* DWORD 2-9:IP Address */
  8314. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8315. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8316. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8317. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8318. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8319. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8320. do { \
  8321. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8322. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8323. } while (0)
  8324. /* DWORD 10:Source Port Number */
  8325. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8326. #define HTT_RX_FSE_SOURCEPORT_S 0
  8327. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8328. do { \
  8329. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8330. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8331. } while (0)
  8332. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8333. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8334. /* DWORD 11:Destination Port Number */
  8335. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8336. #define HTT_RX_FSE_DESTPORT_S 16
  8337. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8338. do { \
  8339. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8340. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8341. } while (0)
  8342. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8343. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8344. /* DWORD 10-11:SPI (In case of IPSEC) */
  8345. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8346. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8347. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8348. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8349. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8350. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8351. do { \
  8352. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8353. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8354. } while (0)
  8355. /* DWORD 12:L4 PROTO */
  8356. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8357. #define HTT_RX_FSE_L4_PROTO_S 0
  8358. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8359. do { \
  8360. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8361. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8362. } while (0)
  8363. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8364. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8365. /**
  8366. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8367. *
  8368. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8369. *
  8370. * |31 24|23 |15 8|7 2|1|0|
  8371. * |----------------+----------------+----------------+----------------|
  8372. * | reserved | pdev_id | msg_type |
  8373. * |---------------------------------+----------------+----------------|
  8374. * | reserved |E|F|
  8375. * |---------------------------------+----------------+----------------|
  8376. * Where E = Configure the target to provide the 3-tuple hash value in
  8377. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8378. * F = Configure the target to provide the 3-tuple hash value in
  8379. * flow_id_toeplitz field of rx_msdu_start tlv
  8380. *
  8381. * The following field definitions describe the format of the 3 tuple hash value
  8382. * message sent from the host to target as part of initialization sequence.
  8383. *
  8384. * Header fields:
  8385. * dword0 - b'7:0 - msg_type: This will be set to
  8386. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8387. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8388. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8389. * specified pdev's LMAC ring.
  8390. * b'31:16 - reserved : Reserved for future use
  8391. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8392. * b'1 - toeplitz_hash_2_or_4_field_enable
  8393. * b'31:2 - reserved : Reserved for future use
  8394. * ---------+------+----------------------------------------------------------
  8395. * bit1 | bit0 | Functionality
  8396. * ---------+------+----------------------------------------------------------
  8397. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8398. * | | in flow_id_toeplitz field
  8399. * ---------+------+----------------------------------------------------------
  8400. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8401. * | | in toeplitz_hash_2_or_4 field
  8402. * ---------+------+----------------------------------------------------------
  8403. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8404. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8405. * ---------+------+----------------------------------------------------------
  8406. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8407. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8408. * | | toeplitz_hash_2_or_4 field
  8409. *----------------------------------------------------------------------------
  8410. */
  8411. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8412. A_UINT32 msg_type :8,
  8413. pdev_id :8,
  8414. reserved0 :16;
  8415. A_UINT32 flow_id_toeplitz_field_enable :1,
  8416. toeplitz_hash_2_or_4_field_enable :1,
  8417. reserved1 :30;
  8418. } POSTPACK;
  8419. /* DWORD0 : pdev_id configuration Macros */
  8420. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8421. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8422. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8423. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8424. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8425. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8426. do { \
  8427. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8428. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8429. } while (0)
  8430. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8431. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8432. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8433. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8434. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8435. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8436. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8437. do { \
  8438. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8439. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8440. } while (0)
  8441. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8442. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8443. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8444. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8445. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8446. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8447. do { \
  8448. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8449. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8450. } while (0)
  8451. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8452. /**
  8453. * @brief host --> target Host PA Address Size
  8454. *
  8455. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8456. *
  8457. * @details
  8458. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8459. * provide the physical start address and size of each of the memory
  8460. * areas within host DDR that the target FW may need to access.
  8461. *
  8462. * For example, the host can use this message to allow the target FW
  8463. * to set up access to the host's pools of TQM link descriptors.
  8464. * The message would appear as follows:
  8465. *
  8466. * |31 24|23 16|15 8|7 0|
  8467. * |----------------+----------------+----------------+----------------|
  8468. * | reserved | num_entries | msg_type |
  8469. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8470. * | mem area 0 size |
  8471. * |----------------+----------------+----------------+----------------|
  8472. * | mem area 0 physical_address_lo |
  8473. * |----------------+----------------+----------------+----------------|
  8474. * | mem area 0 physical_address_hi |
  8475. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8476. * | mem area 1 size |
  8477. * |----------------+----------------+----------------+----------------|
  8478. * | mem area 1 physical_address_lo |
  8479. * |----------------+----------------+----------------+----------------|
  8480. * | mem area 1 physical_address_hi |
  8481. * |----------------+----------------+----------------+----------------|
  8482. * ...
  8483. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8484. * | mem area N size |
  8485. * |----------------+----------------+----------------+----------------|
  8486. * | mem area N physical_address_lo |
  8487. * |----------------+----------------+----------------+----------------|
  8488. * | mem area N physical_address_hi |
  8489. * |----------------+----------------+----------------+----------------|
  8490. *
  8491. * The message is interpreted as follows:
  8492. * dword0 - b'0:7 - msg_type: This will be set to
  8493. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8494. * b'8:15 - number_entries: Indicated the number of host memory
  8495. * areas specified within the remainder of the message
  8496. * b'16:31 - reserved.
  8497. * dword1 - b'0:31 - memory area 0 size in bytes
  8498. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8499. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8500. * and similar for memory area 1 through memory area N.
  8501. */
  8502. PREPACK struct htt_h2t_host_paddr_size {
  8503. A_UINT32 msg_type: 8,
  8504. num_entries: 8,
  8505. reserved: 16;
  8506. } POSTPACK;
  8507. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8508. A_UINT32 size;
  8509. A_UINT32 physical_address_lo;
  8510. A_UINT32 physical_address_hi;
  8511. } POSTPACK;
  8512. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8513. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8514. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8515. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8516. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8517. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8518. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8519. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8520. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8521. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8522. do { \
  8523. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8524. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8525. } while (0)
  8526. /**
  8527. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8528. *
  8529. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8530. *
  8531. * @details
  8532. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8533. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8534. *
  8535. * The message would appear as follows:
  8536. *
  8537. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8538. * |---------------------------------+---+---+----------+-+-----------|
  8539. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8540. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8541. *
  8542. *
  8543. * The message is interpreted as follows:
  8544. * dword0 - b'0:7 - msg_type: This will be set to
  8545. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8546. * b'8 - override bit to drive MSDUs to PPE ring
  8547. * b'9:13 - REO destination ring indication
  8548. * b'14 - Multi buffer msdu override enable bit
  8549. * b'15 - Intra BSS override
  8550. * b'16 - Decap raw override
  8551. * b'17 - Decap Native wifi override
  8552. * b'18 - IP frag override
  8553. * b'19:31 - reserved
  8554. */
  8555. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8556. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8557. override: 1,
  8558. reo_destination_indication: 5,
  8559. multi_buffer_msdu_override_en: 1,
  8560. intra_bss_override: 1,
  8561. decap_raw_override: 1,
  8562. decap_nwifi_override: 1,
  8563. ip_frag_override: 1,
  8564. reserved: 13;
  8565. } POSTPACK;
  8566. /* DWORD 0: Override */
  8567. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8568. #define HTT_PPE_CFG_OVERRIDE_S 8
  8569. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8570. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8571. HTT_PPE_CFG_OVERRIDE_S)
  8572. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8573. do { \
  8574. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8575. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8576. } while (0)
  8577. /* DWORD 0: REO Destination Indication*/
  8578. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8579. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8580. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8581. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8582. HTT_PPE_CFG_REO_DEST_IND_S)
  8583. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8584. do { \
  8585. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8586. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8587. } while (0)
  8588. /* DWORD 0: Multi buffer MSDU override */
  8589. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8590. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8591. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8592. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8593. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8594. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8595. do { \
  8596. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8597. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8598. } while (0)
  8599. /* DWORD 0: Intra BSS override */
  8600. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8601. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8602. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8603. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8604. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8605. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8606. do { \
  8607. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8608. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8609. } while (0)
  8610. /* DWORD 0: Decap RAW override */
  8611. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8612. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8613. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8614. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8615. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8616. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8617. do { \
  8618. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8619. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8620. } while (0)
  8621. /* DWORD 0: Decap NWIFI override */
  8622. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8623. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8624. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8625. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8626. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8627. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8628. do { \
  8629. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8630. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8631. } while (0)
  8632. /* DWORD 0: IP frag override */
  8633. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8634. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8635. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8636. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8637. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8638. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8639. do { \
  8640. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8641. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8642. } while (0)
  8643. /*
  8644. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8645. *
  8646. * @details
  8647. * The following field definitions describe the format of the HTT host
  8648. * to target FW VDEV TX RX stats retrieve message.
  8649. * The message specifies the type of stats the host wants to retrieve.
  8650. *
  8651. * |31 27|26 25|24 17|16|15 8|7 0|
  8652. * |-----------------------------------------------------------|
  8653. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8654. * |-----------------------------------------------------------|
  8655. * | vdev_id lower bitmask |
  8656. * |-----------------------------------------------------------|
  8657. * | vdev_id upper bitmask |
  8658. * |-----------------------------------------------------------|
  8659. * Header fields:
  8660. * Where:
  8661. * dword0 - b'7:0 - msg_type: This will be set to
  8662. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8663. * b'15:8 - pdev id
  8664. * b'16(E) - Enable/Disable the vdev HW stats
  8665. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8666. * b'25:26(R) - Reset stats bits
  8667. * 0: don't reset stats
  8668. * 1: reset stats once
  8669. * 2: reset stats at the start of each periodic interval
  8670. * b'27:31 - reserved for future use
  8671. * dword1 - b'0:31 - vdev_id lower bitmask
  8672. * dword2 - b'0:31 - vdev_id upper bitmask
  8673. */
  8674. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8675. A_UINT32 msg_type :8,
  8676. pdev_id :8,
  8677. enable :1,
  8678. periodic_interval :8,
  8679. reset_stats_bits :2,
  8680. reserved0 :5;
  8681. A_UINT32 vdev_id_lower_bitmask;
  8682. A_UINT32 vdev_id_upper_bitmask;
  8683. } POSTPACK;
  8684. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8685. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8686. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8687. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8688. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8689. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8690. do { \
  8691. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8692. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8693. } while (0)
  8694. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8695. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8696. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8697. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8698. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8699. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8700. do { \
  8701. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8702. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8703. } while (0)
  8704. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8705. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8706. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8707. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8708. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8709. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8710. do { \
  8711. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8712. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8713. } while (0)
  8714. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8715. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8716. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8717. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8718. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8719. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8720. do { \
  8721. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8722. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8723. } while (0)
  8724. /*
  8725. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8726. *
  8727. * @details
  8728. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8729. * the default MSDU queues for one of the TIDs within the specified peer
  8730. * to the specified service class.
  8731. * The TID is indirectly specified - each service class is associated
  8732. * with a TID. All default MSDU queues for this peer-TID will be
  8733. * linked to the service class in question.
  8734. *
  8735. * |31 16|15 8|7 0|
  8736. * |------------------------------+--------------+--------------|
  8737. * | peer ID | svc class ID | msg type |
  8738. * |------------------------------------------------------------|
  8739. * Header fields:
  8740. * dword0 - b'7:0 - msg_type: This will be set to
  8741. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8742. * b'15:8 - service class ID
  8743. * b'31:16 - peer ID
  8744. */
  8745. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8746. A_UINT32 msg_type :8,
  8747. svc_class_id :8,
  8748. peer_id :16;
  8749. } POSTPACK;
  8750. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8751. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8752. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8753. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8754. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8755. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8756. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8757. do { \
  8758. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8759. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8760. } while (0)
  8761. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8762. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8763. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8764. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8765. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8766. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8767. do { \
  8768. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8769. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8770. } while (0)
  8771. /*
  8772. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8773. *
  8774. * @details
  8775. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8776. * remove the linkage of the specified peer-TID's MSDU queues to
  8777. * service classes.
  8778. *
  8779. * |31 16|15 8|7 0|
  8780. * |------------------------------+--------------+--------------|
  8781. * | peer ID | svc class ID | msg type |
  8782. * |------------------------------------------------------------|
  8783. * Header fields:
  8784. * dword0 - b'7:0 - msg_type: This will be set to
  8785. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8786. * b'15:8 - service class ID
  8787. * b'31:16 - peer ID
  8788. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8789. * value for peer ID indicates that the target should
  8790. * apply the UNMAP_REQ to all peers.
  8791. */
  8792. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8793. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8794. A_UINT32 msg_type :8,
  8795. svc_class_id :8,
  8796. peer_id :16;
  8797. } POSTPACK;
  8798. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8799. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8800. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8801. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8802. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8803. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8804. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8805. do { \
  8806. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8807. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8808. } while (0)
  8809. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8810. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8811. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8812. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8813. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8814. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8815. do { \
  8816. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8817. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8818. } while (0)
  8819. /*
  8820. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8821. *
  8822. * @details
  8823. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8824. * request the target to report what service class the default MSDU queues
  8825. * of the specified TIDs within the peer are linked to.
  8826. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8827. * to report what service class (if any) the default MSDU queues for
  8828. * each of the specified TIDs are linked to.
  8829. *
  8830. * |31 16|15 8|7 1| 0|
  8831. * |------------------------------+--------------+--------------|
  8832. * | peer ID | TID mask | msg type |
  8833. * |------------------------------------------------------------|
  8834. * | reserved |ETO|
  8835. * |------------------------------------------------------------|
  8836. * Header fields:
  8837. * dword0 - b'7:0 - msg_type: This will be set to
  8838. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8839. * b'15:8 - TID mask
  8840. * b'31:16 - peer ID
  8841. * dword1 - b'0 - "Existing Tids Only" flag
  8842. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8843. * message generated by this REQ will only show the
  8844. * mapping for TIDs that actually exist in the target's
  8845. * peer object.
  8846. * Any TIDs that are covered by a MAP_REQ but which
  8847. * do not actually exist will be shown as being
  8848. * unmapped (i.e. svc class ID 0xff).
  8849. * If this flag is cleared, the MAP_REPORT_CONF message
  8850. * will consider not only the mapping of TIDs currently
  8851. * existing in the peer, but also the mapping that will
  8852. * be applied for any TID objects created within this
  8853. * peer in the future.
  8854. * b'31:1 - reserved for future use
  8855. */
  8856. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8857. A_UINT32 msg_type :8,
  8858. tid_mask :8,
  8859. peer_id :16;
  8860. A_UINT32 existing_tids_only:1,
  8861. reserved :31;
  8862. } POSTPACK;
  8863. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8864. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8865. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8866. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8867. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8868. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8869. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8870. do { \
  8871. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8872. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8873. } while (0)
  8874. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8875. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8876. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8877. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8878. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8879. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8880. do { \
  8881. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8882. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8883. } while (0)
  8884. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8885. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8886. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8887. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8888. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8889. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8890. do { \
  8891. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8892. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8893. } while (0)
  8894. /**
  8895. * @brief Format of shared memory between Host and Target
  8896. * for UMAC hang recovery feature messaging.
  8897. * @details
  8898. * This is shared memory between Host and Target allocated
  8899. * and used in chips where UMAC hang recovery feature is supported.
  8900. * This shared memory is allocated per SOC level by Host since each
  8901. * SOC's target Q6FW needs to communicate independently to the Host
  8902. * through its own shared memory.
  8903. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8904. * then host interprets it as a new message from target.
  8905. * Host clears that particular read bit in t2h_msg after each read
  8906. * operation. It is vice versa for h2t_msg. At any given point
  8907. * of time there is expected to be only one bit set
  8908. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8909. *
  8910. * The message is interpreted as follows:
  8911. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8912. * added for debuggability purpose.
  8913. * dword1 - b'0 - do_pre_reset
  8914. * b'1 - do_post_reset_start
  8915. * b'2 - do_post_reset_complete
  8916. * b'3 - initiate_umac_recovery
  8917. * b'4:31 - rsvd_t2h
  8918. * dword2 - b'0 - pre_reset_done
  8919. * b'1 - post_reset_start_done
  8920. * b'2 - post_reset_complete_done
  8921. * b'3 - start_pre_reset
  8922. * b'4:31 - rsvd_h2t
  8923. */
  8924. PREPACK typedef struct {
  8925. /** Magic number added for debuggability. */
  8926. A_UINT32 magic_num;
  8927. union {
  8928. /*
  8929. * BIT [0] :- T2H msg to do pre-reset
  8930. * BIT [1] :- T2H msg to do post-reset start
  8931. * BIT [2] :- T2H msg to do post-reset complete
  8932. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8933. * This is needed to synchronize UMAC recovery
  8934. * across all SOCs.
  8935. * BIT [31 : 4] :- reserved
  8936. */
  8937. A_UINT32 t2h_msg;
  8938. struct {
  8939. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8940. do_post_reset_start : 1, /* BIT [1] */
  8941. do_post_reset_complete : 1, /* BIT [2] */
  8942. initiate_umac_recovery : 1, /* BIT [3] */
  8943. rsvd_t2h : 28; /* BIT [31 : 4] */
  8944. };
  8945. };
  8946. union {
  8947. /*
  8948. * BIT [0] :- H2T msg to send pre-reset done
  8949. * BIT [1] :- H2T msg to send post-reset start done
  8950. * BIT [2] :- H2T msg to send post-reset complete done
  8951. * BIT [3] :- H2T msg to start pre-reset.
  8952. * This is expected only after T2H
  8953. * initiate_umac_recovery was received by Host
  8954. * from one of the SOCs.
  8955. * BIT [31 : 4] :- reserved
  8956. */
  8957. A_UINT32 h2t_msg;
  8958. struct {
  8959. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8960. post_reset_start_done : 1, /* BIT [1] */
  8961. post_reset_complete_done : 1, /* BIT [2] */
  8962. start_pre_reset : 1, /* BIT [3] */
  8963. rsvd_h2t : 28; /* BIT [31 : 4] */
  8964. };
  8965. };
  8966. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8967. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8968. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8969. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8970. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8971. /* dword1 - b'0 - do_pre_reset */
  8972. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8973. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8974. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8975. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8976. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8977. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8978. do { \
  8979. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8980. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8981. } while (0)
  8982. /* dword1 - b'1 - do_post_reset_start */
  8983. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8984. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8985. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8986. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8987. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8988. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8989. do { \
  8990. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8991. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8992. } while (0)
  8993. /* dword1 - b'2 - do_post_reset_complete */
  8994. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8995. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8996. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8997. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8998. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8999. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9000. do { \
  9001. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9002. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9003. } while (0)
  9004. /* dword1 - b'3 - initiate_umac_recovery */
  9005. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9006. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9007. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9008. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9009. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9010. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9011. do { \
  9012. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9013. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9014. } while (0)
  9015. /* dword2 - b'0 - pre_reset_done */
  9016. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9017. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9018. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9019. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9020. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9021. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9022. do { \
  9023. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9024. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9025. } while (0)
  9026. /* dword2 - b'1 - post_reset_start_done */
  9027. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9028. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9029. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9030. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9031. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9032. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9033. do { \
  9034. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9035. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9036. } while (0)
  9037. /* dword2 - b'2 - post_reset_complete_done */
  9038. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9039. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9040. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9041. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9042. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9043. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9044. do { \
  9045. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9046. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9047. } while (0)
  9048. /* dword2 - b'3 - start_pre_reset */
  9049. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9050. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9051. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9052. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9053. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9054. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9055. do { \
  9056. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9057. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9058. } while (0)
  9059. /**
  9060. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9061. *
  9062. * @details
  9063. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9064. * by the host to provide prerequisite info to target for the UMAC hang
  9065. * recovery feature.
  9066. * The info sent in this H2T message are T2H message method, H2T message
  9067. * method, T2H MSI interrupt number and physical start address, size of
  9068. * the shared memory (refers to the shared memory dedicated for messaging
  9069. * between host and target when the DUT is in UMAC hang recovery mode).
  9070. * This H2T message is expected to be only sent if the WMI service bit
  9071. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9072. *
  9073. * |31 16|15 12|11 8|7 0|
  9074. * |-------------------------------+--------------+--------------+------------|
  9075. * | reserved |h2t msg method|t2h msg method| msg_type |
  9076. * |--------------------------------------------------------------------------|
  9077. * | t2h msi interrupt number |
  9078. * |--------------------------------------------------------------------------|
  9079. * | shared memory area size |
  9080. * |--------------------------------------------------------------------------|
  9081. * | shared memory area physical address low |
  9082. * |--------------------------------------------------------------------------|
  9083. * | shared memory area physical address high |
  9084. * |--------------------------------------------------------------------------|
  9085. *
  9086. * The message is interpreted as follows:
  9087. * dword0 - b'0:7 - msg_type
  9088. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9089. * b'8:11 - t2h_msg_method: indicates method to be used for
  9090. * T2H communication in UMAC hang recovery mode.
  9091. * Value zero indicates MSI interrupt (default method).
  9092. * Refer to htt_umac_hang_recovery_msg_method enum.
  9093. * b'12:15 - h2t_msg_method: indicates method to be used for
  9094. * H2T communication in UMAC hang recovery mode.
  9095. * Value zero indicates polling by target for this h2t msg
  9096. * during UMAC hang recovery mode.
  9097. * Refer to htt_umac_hang_recovery_msg_method enum.
  9098. * b'16:31 - reserved.
  9099. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9100. * T2H communication in UMAC hang recovery mode.
  9101. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9102. * only when in UMAC hang recovery mode.
  9103. * This refers to size in bytes.
  9104. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9105. * of the shared memory dedicated for messaging only when
  9106. * in UMAC hang recovery mode.
  9107. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9108. * of the shared memory dedicated for messaging only when
  9109. * in UMAC hang recovery mode.
  9110. */
  9111. /* t2h_msg_method and h2t_msg_method */
  9112. enum htt_umac_hang_recovery_msg_method {
  9113. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9114. };
  9115. PREPACK typedef struct {
  9116. A_UINT32 msg_type : 8,
  9117. t2h_msg_method : 4,
  9118. h2t_msg_method : 4,
  9119. reserved : 16;
  9120. A_UINT32 t2h_msi_data;
  9121. /* size bytes and physical address of shared memory. */
  9122. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9123. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9124. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9125. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9126. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9127. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9128. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9129. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9130. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9131. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9132. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9133. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9136. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9137. } while (0)
  9138. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9139. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9140. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9141. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9142. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9143. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9144. do { \
  9145. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9146. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9147. } while (0)
  9148. /**
  9149. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9150. *
  9151. * @details
  9152. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9153. * HTT message sent by the host to indicate that the target needs to start the
  9154. * UMAC hang recovery feature from the point of pre-reset routine.
  9155. * The purpose of this H2T message is to have host synchronize and trigger
  9156. * UMAC recovery across all targets.
  9157. * The info sent in this H2T message is the flag to indicate whether the
  9158. * target needs to execute UMAC-recovery in context of the Initiator or
  9159. * Non-Initiator.
  9160. * This H2T message is expected to be sent as response to the
  9161. * initiate_umac_recovery indication from the Initiator target attached to
  9162. * this same host.
  9163. * This H2T message is expected to be only sent if the WMI service bit
  9164. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9165. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9166. * beforehand.
  9167. *
  9168. * |31 9|8|7 0|
  9169. * |-----------------------------------------------------------|
  9170. * | reserved |I| msg_type |
  9171. * |-----------------------------------------------------------|
  9172. * Where:
  9173. * I = is_initiator
  9174. *
  9175. * The message is interpreted as follows:
  9176. * dword0 - b'0:7 - msg_type
  9177. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9178. * b'8 - is_initiator: indicates whether the target needs to
  9179. * execute the UMAC-recovery in context of the Initiator or
  9180. * Non-Initiator.
  9181. * The value zero indicates this target is Non-Initiator.
  9182. * b'9:31 - reserved.
  9183. */
  9184. PREPACK typedef struct {
  9185. A_UINT32 msg_type : 8,
  9186. is_initiator : 1,
  9187. reserved : 23;
  9188. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9189. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9190. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9191. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9192. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9193. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9194. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9195. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9196. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9197. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9198. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9199. do { \
  9200. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9201. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9202. } while (0)
  9203. /*
  9204. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9205. *
  9206. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9207. *
  9208. * @details
  9209. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9210. * install or uninstall rx cce super rules to match certain kind of packets
  9211. * with specific parameters. Target sets up HW registers based on setup message
  9212. * and always confirms back to Host.
  9213. *
  9214. * The message would appear as follows:
  9215. * |31 24|23 16|15 8|7 0|
  9216. * |-----------------+-----------------+-----------------+-----------------|
  9217. * | reserved | operation | vdev_id | msg_type |
  9218. * |-----------------------------------------------------------------------|
  9219. * | cce_super_rule_param[0] |
  9220. * |-----------------------------------------------------------------------|
  9221. * | cce_super_rule_param[1] |
  9222. * |-----------------------------------------------------------------------|
  9223. *
  9224. * The message is interpreted as follows:
  9225. * dword0 - b'0:7 - msg_type: This will be set to
  9226. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9227. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is for
  9228. * b'16:23 - operation: Identify operation to be taken,
  9229. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9230. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9231. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9232. * b'24:31 - reserved
  9233. * dword1~10 - cce_super_rule_param[0]:
  9234. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9235. * dword11~20 - cce_super_rule_param[1]:
  9236. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9237. *
  9238. * Each cce_super_rule_param structure would appear as follows:
  9239. * |31 24|23 16|15 8|7 0|
  9240. * |-----------------+-----------------+-----------------+-----------------|
  9241. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9242. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9243. * |-----------------------------------------------------------------------|
  9244. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9245. * |-----------------------------------------------------------------------|
  9246. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9247. * |-----------------------------------------------------------------------|
  9248. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9249. * |-----------------------------------------------------------------------|
  9250. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9251. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9252. * |-----------------------------------------------------------------------|
  9253. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9254. * |-----------------------------------------------------------------------|
  9255. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9256. * |-----------------------------------------------------------------------|
  9257. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9258. * |-----------------------------------------------------------------------|
  9259. * | is_valid | l4_type | l3_type |
  9260. * |-----------------------------------------------------------------------|
  9261. * | l4_dst_port | l4_src_port |
  9262. * |-----------------------------------------------------------------------|
  9263. *
  9264. * The cce_super_rule_param[0] structure is interpreted as follows:
  9265. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9266. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9267. * in case of ipv4)
  9268. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9269. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9270. * in case of ipv4)
  9271. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9272. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9273. * in case of ipv4)
  9274. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9275. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9276. * in case of ipv4)
  9277. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9278. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9279. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9280. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9281. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9282. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9283. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9284. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9285. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9286. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9287. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9288. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9289. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9290. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9291. * ipv4 address, in case of ipv4)
  9292. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9293. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9294. * ipv4 address, in case of ipv4)
  9295. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9296. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9297. * ipv4 address, in case of ipv4)
  9298. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9299. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9300. * ipv4 address, in case of ipv4)
  9301. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9302. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9303. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9304. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9305. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9306. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9307. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9308. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9309. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9310. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9311. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9312. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9313. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9314. * 0x0008: ipv4
  9315. * 0xdd86: ipv6
  9316. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9317. * 6: TCP
  9318. * 17: UDP
  9319. * b'24:31 - is_valid: indicate whether this parameter is valid
  9320. * 0: invalid
  9321. * 1: valid
  9322. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9323. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9324. *
  9325. * The cce_super_rule_param[1] structure is similar.
  9326. */
  9327. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9328. enum htt_rx_cce_super_rule_setup_operation {
  9329. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9330. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9331. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9332. /* All operation should be before this */
  9333. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9334. };
  9335. typedef struct {
  9336. union {
  9337. A_UINT8 src_ipv4_addr[4];
  9338. A_UINT8 src_ipv6_addr[16];
  9339. };
  9340. union {
  9341. A_UINT8 dst_ipv4_addr[4];
  9342. A_UINT8 dst_ipv6_addr[16];
  9343. };
  9344. A_UINT32 l3_type: 16,
  9345. l4_type: 8,
  9346. is_valid: 8;
  9347. A_UINT32 l4_src_port: 16,
  9348. l4_dst_port: 16;
  9349. } htt_rx_cce_super_rule_param_t;
  9350. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9351. A_UINT32 msg_type: 8,
  9352. vdev_id: 8,
  9353. operation: 8,
  9354. reserved: 8;
  9355. htt_rx_cce_super_rule_param_t
  9356. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9357. } POSTPACK;
  9358. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9359. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9360. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M 0x0000ff00
  9361. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S 8
  9362. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_GET(_var) \
  9363. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M) >> \
  9364. HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)
  9365. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_SET(_var, _val) \
  9366. do { \
  9367. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID, _val); \
  9368. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)); \
  9369. } while (0)
  9370. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9371. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9372. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9373. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9374. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9375. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9376. do { \
  9377. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9378. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9379. } while (0)
  9380. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9381. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9382. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9383. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9384. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9385. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9386. do { \
  9387. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9388. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9389. } while (0)
  9390. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9391. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9392. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9393. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9394. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9395. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9396. do { \
  9397. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9398. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9399. } while (0)
  9400. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9401. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9402. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9403. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9404. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9405. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9406. do { \
  9407. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9408. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9409. } while (0)
  9410. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9411. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9412. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9413. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9414. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9415. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9416. do { \
  9417. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9418. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9419. } while (0)
  9420. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9421. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9422. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9423. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9424. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9425. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9426. do { \
  9427. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9428. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9429. } while (0)
  9430. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9431. do { \
  9432. A_MEMCPY(_array, _ptr, 4); \
  9433. } while (0)
  9434. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9435. do { \
  9436. A_MEMCPY(_ptr, _array, 4); \
  9437. } while (0)
  9438. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9439. do { \
  9440. A_MEMCPY(_array, _ptr, 16); \
  9441. } while (0)
  9442. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9443. do { \
  9444. A_MEMCPY(_ptr, _array, 16); \
  9445. } while (0)
  9446. /*=== target -> host messages ===============================================*/
  9447. enum htt_t2h_msg_type {
  9448. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9449. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9450. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9451. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9452. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9453. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9454. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9455. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9456. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9457. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9458. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9459. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9460. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9461. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9462. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9463. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9464. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9465. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9466. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9467. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9468. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9469. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9470. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9471. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9472. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9473. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9474. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9475. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9476. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9477. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9478. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9479. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9480. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9481. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9482. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9483. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9484. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9485. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9486. /* TX_OFFLOAD_DELIVER_IND:
  9487. * Forward the target's locally-generated packets to the host,
  9488. * to provide to the monitor mode interface.
  9489. */
  9490. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9491. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9492. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9493. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9494. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9495. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9496. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9497. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9498. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9499. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9500. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9501. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9502. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9503. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9504. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9505. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9506. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9507. HTT_T2H_MSG_TYPE_TEST,
  9508. /* keep this last */
  9509. HTT_T2H_NUM_MSGS
  9510. };
  9511. /*
  9512. * HTT target to host message type -
  9513. * stored in bits 7:0 of the first word of the message
  9514. */
  9515. #define HTT_T2H_MSG_TYPE_M 0xff
  9516. #define HTT_T2H_MSG_TYPE_S 0
  9517. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9518. do { \
  9519. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9520. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9521. } while (0)
  9522. #define HTT_T2H_MSG_TYPE_GET(word) \
  9523. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9524. /**
  9525. * @brief target -> host version number confirmation message definition
  9526. *
  9527. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9528. *
  9529. * |31 24|23 16|15 8|7 0|
  9530. * |----------------+----------------+----------------+----------------|
  9531. * | reserved | major number | minor number | msg type |
  9532. * |-------------------------------------------------------------------|
  9533. * : option request TLV (optional) |
  9534. * :...................................................................:
  9535. *
  9536. * The VER_CONF message may consist of a single 4-byte word, or may be
  9537. * extended with TLVs that specify HTT options selected by the target.
  9538. * The following option TLVs may be appended to the VER_CONF message:
  9539. * - LL_BUS_ADDR_SIZE
  9540. * - HL_SUPPRESS_TX_COMPL_IND
  9541. * - MAX_TX_QUEUE_GROUPS
  9542. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9543. * may be appended to the VER_CONF message (but only one TLV of each type).
  9544. *
  9545. * Header fields:
  9546. * - MSG_TYPE
  9547. * Bits 7:0
  9548. * Purpose: identifies this as a version number confirmation message
  9549. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9550. * - VER_MINOR
  9551. * Bits 15:8
  9552. * Purpose: Specify the minor number of the HTT message library version
  9553. * in use by the target firmware.
  9554. * The minor number specifies the specific revision within a range
  9555. * of fundamentally compatible HTT message definition revisions.
  9556. * Compatible revisions involve adding new messages or perhaps
  9557. * adding new fields to existing messages, in a backwards-compatible
  9558. * manner.
  9559. * Incompatible revisions involve changing the message type values,
  9560. * or redefining existing messages.
  9561. * Value: minor number
  9562. * - VER_MAJOR
  9563. * Bits 15:8
  9564. * Purpose: Specify the major number of the HTT message library version
  9565. * in use by the target firmware.
  9566. * The major number specifies the family of minor revisions that are
  9567. * fundamentally compatible with each other, but not with prior or
  9568. * later families.
  9569. * Value: major number
  9570. */
  9571. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9572. #define HTT_VER_CONF_MINOR_S 8
  9573. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9574. #define HTT_VER_CONF_MAJOR_S 16
  9575. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9576. do { \
  9577. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9578. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9579. } while (0)
  9580. #define HTT_VER_CONF_MINOR_GET(word) \
  9581. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9582. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9583. do { \
  9584. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9585. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9586. } while (0)
  9587. #define HTT_VER_CONF_MAJOR_GET(word) \
  9588. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9589. #define HTT_VER_CONF_BYTES 4
  9590. /**
  9591. * @brief - target -> host HTT Rx In order indication message
  9592. *
  9593. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9594. *
  9595. * @details
  9596. *
  9597. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9598. * |----------------+-------------------+---------------------+---------------|
  9599. * | peer ID | P| F| O| ext TID | msg type |
  9600. * |--------------------------------------------------------------------------|
  9601. * | MSDU count | Reserved | vdev id |
  9602. * |--------------------------------------------------------------------------|
  9603. * | MSDU 0 bus address (bits 31:0) |
  9604. #if HTT_PADDR64
  9605. * | MSDU 0 bus address (bits 63:32) |
  9606. #endif
  9607. * |--------------------------------------------------------------------------|
  9608. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9609. * |--------------------------------------------------------------------------|
  9610. * | MSDU 1 bus address (bits 31:0) |
  9611. #if HTT_PADDR64
  9612. * | MSDU 1 bus address (bits 63:32) |
  9613. #endif
  9614. * |--------------------------------------------------------------------------|
  9615. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9616. * |--------------------------------------------------------------------------|
  9617. */
  9618. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9619. *
  9620. * @details
  9621. * bits
  9622. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9623. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9624. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9625. * | | frag | | | | fail |chksum fail|
  9626. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9627. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9628. */
  9629. struct htt_rx_in_ord_paddr_ind_hdr_t
  9630. {
  9631. A_UINT32 /* word 0 */
  9632. msg_type: 8,
  9633. ext_tid: 5,
  9634. offload: 1,
  9635. frag: 1,
  9636. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9637. peer_id: 16;
  9638. A_UINT32 /* word 1 */
  9639. vap_id: 8,
  9640. /* NOTE:
  9641. * This reserved_1 field is not truly reserved - certain targets use
  9642. * this field internally to store debug information, and do not zero
  9643. * out the contents of the field before uploading the message to the
  9644. * host. Thus, any host-target communication supported by this field
  9645. * is limited to using values that are never used by the debug
  9646. * information stored by certain targets in the reserved_1 field.
  9647. * In particular, the targets in question don't use the value 0x3
  9648. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9649. * so this previously-unused value within these bits is available to
  9650. * use as the host / target PKT_CAPTURE_MODE flag.
  9651. */
  9652. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9653. /* if pkt_capture_mode == 0x3, host should
  9654. * send rx frames to monitor mode interface
  9655. */
  9656. msdu_cnt: 16;
  9657. };
  9658. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9659. {
  9660. A_UINT32 dma_addr;
  9661. A_UINT32
  9662. length: 16,
  9663. fw_desc: 8,
  9664. msdu_info:8;
  9665. };
  9666. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9667. {
  9668. A_UINT32 dma_addr_lo;
  9669. A_UINT32 dma_addr_hi;
  9670. A_UINT32
  9671. length: 16,
  9672. fw_desc: 8,
  9673. msdu_info:8;
  9674. };
  9675. #if HTT_PADDR64
  9676. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9677. #else
  9678. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9679. #endif
  9680. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9681. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9682. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9683. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9684. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9685. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9686. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9687. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9688. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9689. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9690. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9691. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9692. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9693. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9694. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9695. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9696. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9697. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9698. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9699. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9700. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9701. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9702. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9703. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9704. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9705. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9706. /* for systems using 64-bit format for bus addresses */
  9707. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9708. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9709. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9710. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9711. /* for systems using 32-bit format for bus addresses */
  9712. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9713. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9714. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9715. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9716. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9717. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9718. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9719. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9720. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9721. do { \
  9722. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9723. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9724. } while (0)
  9725. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9726. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9727. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9728. do { \
  9729. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9730. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9731. } while (0)
  9732. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9733. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9734. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9735. do { \
  9736. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9737. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9738. } while (0)
  9739. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9740. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9741. /*
  9742. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9743. * deliver the rx frames to the monitor mode interface.
  9744. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9745. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9746. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9747. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9748. */
  9749. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9750. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9751. do { \
  9752. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9753. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9754. } while (0)
  9755. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9756. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9757. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9758. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9759. do { \
  9760. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9761. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9762. } while (0)
  9763. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9764. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9765. /* for systems using 64-bit format for bus addresses */
  9766. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9767. do { \
  9768. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9769. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9770. } while (0)
  9771. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9772. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9773. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9774. do { \
  9775. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9776. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9777. } while (0)
  9778. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9779. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9780. /* for systems using 32-bit format for bus addresses */
  9781. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9782. do { \
  9783. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9784. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9785. } while (0)
  9786. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9787. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9788. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9789. do { \
  9790. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9791. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9792. } while (0)
  9793. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9794. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9795. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9796. do { \
  9797. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9798. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9799. } while (0)
  9800. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9801. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9802. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9803. do { \
  9804. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9805. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9806. } while (0)
  9807. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9808. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9809. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9810. do { \
  9811. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9812. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9813. } while (0)
  9814. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9815. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9816. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9817. do { \
  9818. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9819. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9820. } while (0)
  9821. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9822. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9823. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9824. do { \
  9825. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9826. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9827. } while (0)
  9828. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9829. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9830. /* definitions used within target -> host rx indication message */
  9831. PREPACK struct htt_rx_ind_hdr_prefix_t
  9832. {
  9833. A_UINT32 /* word 0 */
  9834. msg_type: 8,
  9835. ext_tid: 5,
  9836. release_valid: 1,
  9837. flush_valid: 1,
  9838. reserved0: 1,
  9839. peer_id: 16;
  9840. A_UINT32 /* word 1 */
  9841. flush_start_seq_num: 6,
  9842. flush_end_seq_num: 6,
  9843. release_start_seq_num: 6,
  9844. release_end_seq_num: 6,
  9845. num_mpdu_ranges: 8;
  9846. } POSTPACK;
  9847. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9848. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9849. #define HTT_TGT_RSSI_INVALID 0x80
  9850. PREPACK struct htt_rx_ppdu_desc_t
  9851. {
  9852. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9853. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9854. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9855. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9856. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9857. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9858. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9859. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9860. A_UINT32 /* word 0 */
  9861. rssi_cmb: 8,
  9862. timestamp_submicrosec: 8,
  9863. phy_err_code: 8,
  9864. phy_err: 1,
  9865. legacy_rate: 4,
  9866. legacy_rate_sel: 1,
  9867. end_valid: 1,
  9868. start_valid: 1;
  9869. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9870. union {
  9871. A_UINT32 /* word 1 */
  9872. rssi0_pri20: 8,
  9873. rssi0_ext20: 8,
  9874. rssi0_ext40: 8,
  9875. rssi0_ext80: 8;
  9876. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9877. } u0;
  9878. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9879. union {
  9880. A_UINT32 /* word 2 */
  9881. rssi1_pri20: 8,
  9882. rssi1_ext20: 8,
  9883. rssi1_ext40: 8,
  9884. rssi1_ext80: 8;
  9885. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9886. } u1;
  9887. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9888. union {
  9889. A_UINT32 /* word 3 */
  9890. rssi2_pri20: 8,
  9891. rssi2_ext20: 8,
  9892. rssi2_ext40: 8,
  9893. rssi2_ext80: 8;
  9894. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9895. } u2;
  9896. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9897. union {
  9898. A_UINT32 /* word 4 */
  9899. rssi3_pri20: 8,
  9900. rssi3_ext20: 8,
  9901. rssi3_ext40: 8,
  9902. rssi3_ext80: 8;
  9903. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9904. } u3;
  9905. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9906. A_UINT32 tsf32; /* word 5 */
  9907. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9908. A_UINT32 timestamp_microsec; /* word 6 */
  9909. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9910. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9911. A_UINT32 /* word 7 */
  9912. vht_sig_a1: 24,
  9913. preamble_type: 8;
  9914. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9915. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9916. A_UINT32 /* word 8 */
  9917. vht_sig_a2: 24,
  9918. /* sa_ant_matrix
  9919. * For cases where a single rx chain has options to be connected to
  9920. * different rx antennas, show which rx antennas were in use during
  9921. * receipt of a given PPDU.
  9922. * This sa_ant_matrix provides a bitmask of the antennas used while
  9923. * receiving this frame.
  9924. */
  9925. sa_ant_matrix: 8;
  9926. } POSTPACK;
  9927. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9928. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9929. PREPACK struct htt_rx_ind_hdr_suffix_t
  9930. {
  9931. A_UINT32 /* word 0 */
  9932. fw_rx_desc_bytes: 16,
  9933. reserved0: 16;
  9934. } POSTPACK;
  9935. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9936. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9937. PREPACK struct htt_rx_ind_hdr_t
  9938. {
  9939. struct htt_rx_ind_hdr_prefix_t prefix;
  9940. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9941. struct htt_rx_ind_hdr_suffix_t suffix;
  9942. } POSTPACK;
  9943. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9944. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9945. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9946. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9947. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9948. /*
  9949. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9950. * the offset into the HTT rx indication message at which the
  9951. * FW rx PPDU descriptor resides
  9952. */
  9953. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9954. /*
  9955. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9956. * the offset into the HTT rx indication message at which the
  9957. * header suffix (FW rx MSDU byte count) resides
  9958. */
  9959. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9960. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9961. /*
  9962. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9963. * the offset into the HTT rx indication message at which the per-MSDU
  9964. * information starts
  9965. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9966. * per-MSDU information portion of the message. The per-MSDU info itself
  9967. * starts at byte 12.
  9968. */
  9969. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9970. /**
  9971. * @brief target -> host rx indication message definition
  9972. *
  9973. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9974. *
  9975. * @details
  9976. * The following field definitions describe the format of the rx indication
  9977. * message sent from the target to the host.
  9978. * The message consists of three major sections:
  9979. * 1. a fixed-length header
  9980. * 2. a variable-length list of firmware rx MSDU descriptors
  9981. * 3. one or more 4-octet MPDU range information elements
  9982. * The fixed length header itself has two sub-sections
  9983. * 1. the message meta-information, including identification of the
  9984. * sender and type of the received data, and a 4-octet flush/release IE
  9985. * 2. the firmware rx PPDU descriptor
  9986. *
  9987. * The format of the message is depicted below.
  9988. * in this depiction, the following abbreviations are used for information
  9989. * elements within the message:
  9990. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9991. * elements associated with the PPDU start are valid.
  9992. * Specifically, the following fields are valid only if SV is set:
  9993. * RSSI (all variants), L, legacy rate, preamble type, service,
  9994. * VHT-SIG-A
  9995. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9996. * elements associated with the PPDU end are valid.
  9997. * Specifically, the following fields are valid only if EV is set:
  9998. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9999. * - L - Legacy rate selector - if legacy rates are used, this flag
  10000. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10001. * (L == 0) PHY.
  10002. * - P - PHY error flag - boolean indication of whether the rx frame had
  10003. * a PHY error
  10004. *
  10005. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10006. * |----------------+-------------------+---------------------+---------------|
  10007. * | peer ID | |RV|FV| ext TID | msg type |
  10008. * |--------------------------------------------------------------------------|
  10009. * | num | release | release | flush | flush |
  10010. * | MPDU | end | start | end | start |
  10011. * | ranges | seq num | seq num | seq num | seq num |
  10012. * |==========================================================================|
  10013. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10014. * |V|V| | rate | | | timestamp | RSSI |
  10015. * |--------------------------------------------------------------------------|
  10016. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10017. * |--------------------------------------------------------------------------|
  10018. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10019. * |--------------------------------------------------------------------------|
  10020. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10021. * |--------------------------------------------------------------------------|
  10022. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10023. * |--------------------------------------------------------------------------|
  10024. * | TSF LSBs |
  10025. * |--------------------------------------------------------------------------|
  10026. * | microsec timestamp |
  10027. * |--------------------------------------------------------------------------|
  10028. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10029. * |--------------------------------------------------------------------------|
  10030. * | service | HT-SIG / VHT-SIG-A2 |
  10031. * |==========================================================================|
  10032. * | reserved | FW rx desc bytes |
  10033. * |--------------------------------------------------------------------------|
  10034. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10035. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10036. * |--------------------------------------------------------------------------|
  10037. * : : :
  10038. * |--------------------------------------------------------------------------|
  10039. * | alignment | MSDU Rx |
  10040. * | padding | desc Bn |
  10041. * |--------------------------------------------------------------------------|
  10042. * | reserved | MPDU range status | MPDU count |
  10043. * |--------------------------------------------------------------------------|
  10044. * : reserved : MPDU range status : MPDU count :
  10045. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10046. *
  10047. * Header fields:
  10048. * - MSG_TYPE
  10049. * Bits 7:0
  10050. * Purpose: identifies this as an rx indication message
  10051. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10052. * - EXT_TID
  10053. * Bits 12:8
  10054. * Purpose: identify the traffic ID of the rx data, including
  10055. * special "extended" TID values for multicast, broadcast, and
  10056. * non-QoS data frames
  10057. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10058. * - FLUSH_VALID (FV)
  10059. * Bit 13
  10060. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10061. * is valid
  10062. * Value:
  10063. * 1 -> flush IE is valid and needs to be processed
  10064. * 0 -> flush IE is not valid and should be ignored
  10065. * - REL_VALID (RV)
  10066. * Bit 13
  10067. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10068. * is valid
  10069. * Value:
  10070. * 1 -> release IE is valid and needs to be processed
  10071. * 0 -> release IE is not valid and should be ignored
  10072. * - PEER_ID
  10073. * Bits 31:16
  10074. * Purpose: Identify, by ID, which peer sent the rx data
  10075. * Value: ID of the peer who sent the rx data
  10076. * - FLUSH_SEQ_NUM_START
  10077. * Bits 5:0
  10078. * Purpose: Indicate the start of a series of MPDUs to flush
  10079. * Not all MPDUs within this series are necessarily valid - the host
  10080. * must check each sequence number within this range to see if the
  10081. * corresponding MPDU is actually present.
  10082. * This field is only valid if the FV bit is set.
  10083. * Value:
  10084. * The sequence number for the first MPDUs to check to flush.
  10085. * The sequence number is masked by 0x3f.
  10086. * - FLUSH_SEQ_NUM_END
  10087. * Bits 11:6
  10088. * Purpose: Indicate the end of a series of MPDUs to flush
  10089. * Value:
  10090. * The sequence number one larger than the sequence number of the
  10091. * last MPDU to check to flush.
  10092. * The sequence number is masked by 0x3f.
  10093. * Not all MPDUs within this series are necessarily valid - the host
  10094. * must check each sequence number within this range to see if the
  10095. * corresponding MPDU is actually present.
  10096. * This field is only valid if the FV bit is set.
  10097. * - REL_SEQ_NUM_START
  10098. * Bits 17:12
  10099. * Purpose: Indicate the start of a series of MPDUs to release.
  10100. * All MPDUs within this series are present and valid - the host
  10101. * need not check each sequence number within this range to see if
  10102. * the corresponding MPDU is actually present.
  10103. * This field is only valid if the RV bit is set.
  10104. * Value:
  10105. * The sequence number for the first MPDUs to check to release.
  10106. * The sequence number is masked by 0x3f.
  10107. * - REL_SEQ_NUM_END
  10108. * Bits 23:18
  10109. * Purpose: Indicate the end of a series of MPDUs to release.
  10110. * Value:
  10111. * The sequence number one larger than the sequence number of the
  10112. * last MPDU to check to release.
  10113. * The sequence number is masked by 0x3f.
  10114. * All MPDUs within this series are present and valid - the host
  10115. * need not check each sequence number within this range to see if
  10116. * the corresponding MPDU is actually present.
  10117. * This field is only valid if the RV bit is set.
  10118. * - NUM_MPDU_RANGES
  10119. * Bits 31:24
  10120. * Purpose: Indicate how many ranges of MPDUs are present.
  10121. * Each MPDU range consists of a series of contiguous MPDUs within the
  10122. * rx frame sequence which all have the same MPDU status.
  10123. * Value: 1-63 (typically a small number, like 1-3)
  10124. *
  10125. * Rx PPDU descriptor fields:
  10126. * - RSSI_CMB
  10127. * Bits 7:0
  10128. * Purpose: Combined RSSI from all active rx chains, across the active
  10129. * bandwidth.
  10130. * Value: RSSI dB units w.r.t. noise floor
  10131. * - TIMESTAMP_SUBMICROSEC
  10132. * Bits 15:8
  10133. * Purpose: high-resolution timestamp
  10134. * Value:
  10135. * Sub-microsecond time of PPDU reception.
  10136. * This timestamp ranges from [0,MAC clock MHz).
  10137. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10138. * to form a high-resolution, large range rx timestamp.
  10139. * - PHY_ERR_CODE
  10140. * Bits 23:16
  10141. * Purpose:
  10142. * If the rx frame processing resulted in a PHY error, indicate what
  10143. * type of rx PHY error occurred.
  10144. * Value:
  10145. * This field is valid if the "P" (PHY_ERR) flag is set.
  10146. * TBD: document/specify the values for this field
  10147. * - PHY_ERR
  10148. * Bit 24
  10149. * Purpose: indicate whether the rx PPDU had a PHY error
  10150. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10151. * - LEGACY_RATE
  10152. * Bits 28:25
  10153. * Purpose:
  10154. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10155. * specify which rate was used.
  10156. * Value:
  10157. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10158. * flag.
  10159. * If LEGACY_RATE_SEL is 0:
  10160. * 0x8: OFDM 48 Mbps
  10161. * 0x9: OFDM 24 Mbps
  10162. * 0xA: OFDM 12 Mbps
  10163. * 0xB: OFDM 6 Mbps
  10164. * 0xC: OFDM 54 Mbps
  10165. * 0xD: OFDM 36 Mbps
  10166. * 0xE: OFDM 18 Mbps
  10167. * 0xF: OFDM 9 Mbps
  10168. * If LEGACY_RATE_SEL is 1:
  10169. * 0x8: CCK 11 Mbps long preamble
  10170. * 0x9: CCK 5.5 Mbps long preamble
  10171. * 0xA: CCK 2 Mbps long preamble
  10172. * 0xB: CCK 1 Mbps long preamble
  10173. * 0xC: CCK 11 Mbps short preamble
  10174. * 0xD: CCK 5.5 Mbps short preamble
  10175. * 0xE: CCK 2 Mbps short preamble
  10176. * - LEGACY_RATE_SEL
  10177. * Bit 29
  10178. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10179. * Value:
  10180. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10181. * used a legacy rate.
  10182. * 0 -> OFDM, 1 -> CCK
  10183. * - END_VALID
  10184. * Bit 30
  10185. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10186. * the start of the PPDU are valid. Specifically, the following
  10187. * fields are only valid if END_VALID is set:
  10188. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10189. * TIMESTAMP_SUBMICROSEC
  10190. * Value:
  10191. * 0 -> rx PPDU desc end fields are not valid
  10192. * 1 -> rx PPDU desc end fields are valid
  10193. * - START_VALID
  10194. * Bit 31
  10195. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10196. * the end of the PPDU are valid. Specifically, the following
  10197. * fields are only valid if START_VALID is set:
  10198. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10199. * VHT-SIG-A
  10200. * Value:
  10201. * 0 -> rx PPDU desc start fields are not valid
  10202. * 1 -> rx PPDU desc start fields are valid
  10203. * - RSSI0_PRI20
  10204. * Bits 7:0
  10205. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10206. * Value: RSSI dB units w.r.t. noise floor
  10207. *
  10208. * - RSSI0_EXT20
  10209. * Bits 7:0
  10210. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10211. * (if the rx bandwidth was >= 40 MHz)
  10212. * Value: RSSI dB units w.r.t. noise floor
  10213. * - RSSI0_EXT40
  10214. * Bits 7:0
  10215. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10216. * (if the rx bandwidth was >= 80 MHz)
  10217. * Value: RSSI dB units w.r.t. noise floor
  10218. * - RSSI0_EXT80
  10219. * Bits 7:0
  10220. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10221. * (if the rx bandwidth was >= 160 MHz)
  10222. * Value: RSSI dB units w.r.t. noise floor
  10223. *
  10224. * - RSSI1_PRI20
  10225. * Bits 7:0
  10226. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10227. * Value: RSSI dB units w.r.t. noise floor
  10228. * - RSSI1_EXT20
  10229. * Bits 7:0
  10230. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10231. * (if the rx bandwidth was >= 40 MHz)
  10232. * Value: RSSI dB units w.r.t. noise floor
  10233. * - RSSI1_EXT40
  10234. * Bits 7:0
  10235. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10236. * (if the rx bandwidth was >= 80 MHz)
  10237. * Value: RSSI dB units w.r.t. noise floor
  10238. * - RSSI1_EXT80
  10239. * Bits 7:0
  10240. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10241. * (if the rx bandwidth was >= 160 MHz)
  10242. * Value: RSSI dB units w.r.t. noise floor
  10243. *
  10244. * - RSSI2_PRI20
  10245. * Bits 7:0
  10246. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10247. * Value: RSSI dB units w.r.t. noise floor
  10248. * - RSSI2_EXT20
  10249. * Bits 7:0
  10250. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10251. * (if the rx bandwidth was >= 40 MHz)
  10252. * Value: RSSI dB units w.r.t. noise floor
  10253. * - RSSI2_EXT40
  10254. * Bits 7:0
  10255. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10256. * (if the rx bandwidth was >= 80 MHz)
  10257. * Value: RSSI dB units w.r.t. noise floor
  10258. * - RSSI2_EXT80
  10259. * Bits 7:0
  10260. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10261. * (if the rx bandwidth was >= 160 MHz)
  10262. * Value: RSSI dB units w.r.t. noise floor
  10263. *
  10264. * - RSSI3_PRI20
  10265. * Bits 7:0
  10266. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10267. * Value: RSSI dB units w.r.t. noise floor
  10268. * - RSSI3_EXT20
  10269. * Bits 7:0
  10270. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10271. * (if the rx bandwidth was >= 40 MHz)
  10272. * Value: RSSI dB units w.r.t. noise floor
  10273. * - RSSI3_EXT40
  10274. * Bits 7:0
  10275. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10276. * (if the rx bandwidth was >= 80 MHz)
  10277. * Value: RSSI dB units w.r.t. noise floor
  10278. * - RSSI3_EXT80
  10279. * Bits 7:0
  10280. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10281. * (if the rx bandwidth was >= 160 MHz)
  10282. * Value: RSSI dB units w.r.t. noise floor
  10283. *
  10284. * - TSF32
  10285. * Bits 31:0
  10286. * Purpose: specify the time the rx PPDU was received, in TSF units
  10287. * Value: 32 LSBs of the TSF
  10288. * - TIMESTAMP_MICROSEC
  10289. * Bits 31:0
  10290. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10291. * Value: PPDU rx time, in microseconds
  10292. * - VHT_SIG_A1
  10293. * Bits 23:0
  10294. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10295. * from the rx PPDU
  10296. * Value:
  10297. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10298. * VHT-SIG-A1 data.
  10299. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10300. * first 24 bits of the HT-SIG data.
  10301. * Otherwise, this field is invalid.
  10302. * Refer to the the 802.11 protocol for the definition of the
  10303. * HT-SIG and VHT-SIG-A1 fields
  10304. * - VHT_SIG_A2
  10305. * Bits 23:0
  10306. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10307. * from the rx PPDU
  10308. * Value:
  10309. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10310. * VHT-SIG-A2 data.
  10311. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10312. * last 24 bits of the HT-SIG data.
  10313. * Otherwise, this field is invalid.
  10314. * Refer to the the 802.11 protocol for the definition of the
  10315. * HT-SIG and VHT-SIG-A2 fields
  10316. * - PREAMBLE_TYPE
  10317. * Bits 31:24
  10318. * Purpose: indicate the PHY format of the received burst
  10319. * Value:
  10320. * 0x4: Legacy (OFDM/CCK)
  10321. * 0x8: HT
  10322. * 0x9: HT with TxBF
  10323. * 0xC: VHT
  10324. * 0xD: VHT with TxBF
  10325. * - SERVICE
  10326. * Bits 31:24
  10327. * Purpose: TBD
  10328. * Value: TBD
  10329. *
  10330. * Rx MSDU descriptor fields:
  10331. * - FW_RX_DESC_BYTES
  10332. * Bits 15:0
  10333. * Purpose: Indicate how many bytes in the Rx indication are used for
  10334. * FW Rx descriptors
  10335. *
  10336. * Payload fields:
  10337. * - MPDU_COUNT
  10338. * Bits 7:0
  10339. * Purpose: Indicate how many sequential MPDUs share the same status.
  10340. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10341. * - MPDU_STATUS
  10342. * Bits 15:8
  10343. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10344. * received successfully.
  10345. * Value:
  10346. * 0x1: success
  10347. * 0x2: FCS error
  10348. * 0x3: duplicate error
  10349. * 0x4: replay error
  10350. * 0x5: invalid peer
  10351. */
  10352. /* header fields */
  10353. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10354. #define HTT_RX_IND_EXT_TID_S 8
  10355. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10356. #define HTT_RX_IND_FLUSH_VALID_S 13
  10357. #define HTT_RX_IND_REL_VALID_M 0x4000
  10358. #define HTT_RX_IND_REL_VALID_S 14
  10359. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10360. #define HTT_RX_IND_PEER_ID_S 16
  10361. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10362. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10363. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10364. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10365. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10366. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10367. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10368. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10369. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10370. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10371. /* rx PPDU descriptor fields */
  10372. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10373. #define HTT_RX_IND_RSSI_CMB_S 0
  10374. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10375. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10376. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10377. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10378. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10379. #define HTT_RX_IND_PHY_ERR_S 24
  10380. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10381. #define HTT_RX_IND_LEGACY_RATE_S 25
  10382. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10383. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10384. #define HTT_RX_IND_END_VALID_M 0x40000000
  10385. #define HTT_RX_IND_END_VALID_S 30
  10386. #define HTT_RX_IND_START_VALID_M 0x80000000
  10387. #define HTT_RX_IND_START_VALID_S 31
  10388. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10389. #define HTT_RX_IND_RSSI_PRI20_S 0
  10390. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10391. #define HTT_RX_IND_RSSI_EXT20_S 8
  10392. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10393. #define HTT_RX_IND_RSSI_EXT40_S 16
  10394. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10395. #define HTT_RX_IND_RSSI_EXT80_S 24
  10396. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10397. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10398. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10399. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10400. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10401. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10402. #define HTT_RX_IND_SERVICE_M 0xff000000
  10403. #define HTT_RX_IND_SERVICE_S 24
  10404. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10405. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10406. /* rx MSDU descriptor fields */
  10407. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10408. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10409. /* payload fields */
  10410. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10411. #define HTT_RX_IND_MPDU_COUNT_S 0
  10412. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10413. #define HTT_RX_IND_MPDU_STATUS_S 8
  10414. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10415. do { \
  10416. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10417. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10418. } while (0)
  10419. #define HTT_RX_IND_EXT_TID_GET(word) \
  10420. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10421. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10422. do { \
  10423. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10424. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10425. } while (0)
  10426. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10427. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10428. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10429. do { \
  10430. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10431. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10432. } while (0)
  10433. #define HTT_RX_IND_REL_VALID_GET(word) \
  10434. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10435. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10436. do { \
  10437. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10438. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10439. } while (0)
  10440. #define HTT_RX_IND_PEER_ID_GET(word) \
  10441. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10442. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10443. do { \
  10444. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10445. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10446. } while (0)
  10447. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10448. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10449. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10450. do { \
  10451. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10452. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10453. } while (0)
  10454. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10455. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10456. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10457. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10458. do { \
  10459. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10460. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10461. } while (0)
  10462. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10463. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10464. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10465. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10466. do { \
  10467. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10468. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10469. } while (0)
  10470. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10471. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10472. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10473. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10474. do { \
  10475. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10476. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10477. } while (0)
  10478. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10479. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10480. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10481. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10482. do { \
  10483. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10484. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10485. } while (0)
  10486. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10487. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10488. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10489. /* FW rx PPDU descriptor fields */
  10490. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10491. do { \
  10492. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10493. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10494. } while (0)
  10495. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10496. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10497. HTT_RX_IND_RSSI_CMB_S)
  10498. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10499. do { \
  10500. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10501. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10502. } while (0)
  10503. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10504. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10505. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10506. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10507. do { \
  10508. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10509. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10510. } while (0)
  10511. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10512. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10513. HTT_RX_IND_PHY_ERR_CODE_S)
  10514. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10515. do { \
  10516. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10517. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10518. } while (0)
  10519. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10520. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10521. HTT_RX_IND_PHY_ERR_S)
  10522. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10523. do { \
  10524. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10525. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10526. } while (0)
  10527. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10528. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10529. HTT_RX_IND_LEGACY_RATE_S)
  10530. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10531. do { \
  10532. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10533. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10534. } while (0)
  10535. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10536. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10537. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10538. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10539. do { \
  10540. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10541. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10542. } while (0)
  10543. #define HTT_RX_IND_END_VALID_GET(word) \
  10544. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10545. HTT_RX_IND_END_VALID_S)
  10546. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10547. do { \
  10548. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10549. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10550. } while (0)
  10551. #define HTT_RX_IND_START_VALID_GET(word) \
  10552. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10553. HTT_RX_IND_START_VALID_S)
  10554. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10555. do { \
  10556. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10557. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10558. } while (0)
  10559. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10560. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10561. HTT_RX_IND_RSSI_PRI20_S)
  10562. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10563. do { \
  10564. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10565. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10566. } while (0)
  10567. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10568. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10569. HTT_RX_IND_RSSI_EXT20_S)
  10570. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10571. do { \
  10572. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10573. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10574. } while (0)
  10575. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10576. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10577. HTT_RX_IND_RSSI_EXT40_S)
  10578. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10579. do { \
  10580. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10581. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10582. } while (0)
  10583. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10584. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10585. HTT_RX_IND_RSSI_EXT80_S)
  10586. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10587. do { \
  10588. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10589. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10590. } while (0)
  10591. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10592. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10593. HTT_RX_IND_VHT_SIG_A1_S)
  10594. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10595. do { \
  10596. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10597. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10598. } while (0)
  10599. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10600. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10601. HTT_RX_IND_VHT_SIG_A2_S)
  10602. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10603. do { \
  10604. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10605. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10606. } while (0)
  10607. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10608. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10609. HTT_RX_IND_PREAMBLE_TYPE_S)
  10610. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10611. do { \
  10612. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10613. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10614. } while (0)
  10615. #define HTT_RX_IND_SERVICE_GET(word) \
  10616. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10617. HTT_RX_IND_SERVICE_S)
  10618. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10619. do { \
  10620. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10621. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10622. } while (0)
  10623. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10624. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10625. HTT_RX_IND_SA_ANT_MATRIX_S)
  10626. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10627. do { \
  10628. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10629. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10630. } while (0)
  10631. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10632. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10633. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10634. do { \
  10635. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10636. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10637. } while (0)
  10638. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10639. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10640. #define HTT_RX_IND_HL_BYTES \
  10641. (HTT_RX_IND_HDR_BYTES + \
  10642. 4 /* single FW rx MSDU descriptor */ + \
  10643. 4 /* single MPDU range information element */)
  10644. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10645. /* Could we use one macro entry? */
  10646. #define HTT_WORD_SET(word, field, value) \
  10647. do { \
  10648. HTT_CHECK_SET_VAL(field, value); \
  10649. (word) |= ((value) << field ## _S); \
  10650. } while (0)
  10651. #define HTT_WORD_GET(word, field) \
  10652. (((word) & field ## _M) >> field ## _S)
  10653. PREPACK struct hl_htt_rx_ind_base {
  10654. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10655. } POSTPACK;
  10656. /*
  10657. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10658. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10659. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10660. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10661. * htt_rx_ind_hl_rx_desc_t.
  10662. */
  10663. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10664. struct htt_rx_ind_hl_rx_desc_t {
  10665. A_UINT8 ver;
  10666. A_UINT8 len;
  10667. struct {
  10668. A_UINT8
  10669. first_msdu: 1,
  10670. last_msdu: 1,
  10671. c3_failed: 1,
  10672. c4_failed: 1,
  10673. ipv6: 1,
  10674. tcp: 1,
  10675. udp: 1,
  10676. reserved: 1;
  10677. } flags;
  10678. /* NOTE: no reserved space - don't append any new fields here */
  10679. };
  10680. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10681. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10682. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10683. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10684. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10685. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10686. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10687. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10688. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10689. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10690. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10691. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10692. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10693. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10694. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10695. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10696. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10697. /* This structure is used in HL, the basic descriptor information
  10698. * used by host. the structure is translated by FW from HW desc
  10699. * or generated by FW. But in HL monitor mode, the host would use
  10700. * the same structure with LL.
  10701. */
  10702. PREPACK struct hl_htt_rx_desc_base {
  10703. A_UINT32
  10704. seq_num:12,
  10705. encrypted:1,
  10706. chan_info_present:1,
  10707. resv0:2,
  10708. mcast_bcast:1,
  10709. fragment:1,
  10710. key_id_oct:8,
  10711. resv1:6;
  10712. A_UINT32
  10713. pn_31_0;
  10714. union {
  10715. struct {
  10716. A_UINT16 pn_47_32;
  10717. A_UINT16 pn_63_48;
  10718. } pn16;
  10719. A_UINT32 pn_63_32;
  10720. } u0;
  10721. A_UINT32
  10722. pn_95_64;
  10723. A_UINT32
  10724. pn_127_96;
  10725. } POSTPACK;
  10726. /*
  10727. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10728. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10729. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10730. * Please see htt_chan_change_t for description of the fields.
  10731. */
  10732. PREPACK struct htt_chan_info_t
  10733. {
  10734. A_UINT32 primary_chan_center_freq_mhz: 16,
  10735. contig_chan1_center_freq_mhz: 16;
  10736. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10737. phy_mode: 8,
  10738. reserved: 8;
  10739. } POSTPACK;
  10740. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10741. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10742. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10743. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10744. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10745. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10746. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10747. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10748. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10749. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10750. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10751. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10752. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10753. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10754. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10755. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10756. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10757. /* Channel information */
  10758. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10759. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10760. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10761. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10762. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10763. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10764. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10765. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10766. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10767. do { \
  10768. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10769. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10770. } while (0)
  10771. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10772. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10773. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10774. do { \
  10775. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10776. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10777. } while (0)
  10778. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10779. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10780. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10781. do { \
  10782. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10783. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10784. } while (0)
  10785. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10786. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10787. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10788. do { \
  10789. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10790. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10791. } while (0)
  10792. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10793. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10794. /*
  10795. * @brief target -> host message definition for FW offloaded pkts
  10796. *
  10797. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10798. *
  10799. * @details
  10800. * The following field definitions describe the format of the firmware
  10801. * offload deliver message sent from the target to the host.
  10802. *
  10803. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10804. *
  10805. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10806. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10807. * | reserved_1 | msg type |
  10808. * |--------------------------------------------------------------------------|
  10809. * | phy_timestamp_l32 |
  10810. * |--------------------------------------------------------------------------|
  10811. * | WORD2 (see below) |
  10812. * |--------------------------------------------------------------------------|
  10813. * | seqno | framectrl |
  10814. * |--------------------------------------------------------------------------|
  10815. * | reserved_3 | vdev_id | tid_num|
  10816. * |--------------------------------------------------------------------------|
  10817. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10818. * |--------------------------------------------------------------------------|
  10819. *
  10820. * where:
  10821. * STAT = status
  10822. * F = format (802.3 vs. 802.11)
  10823. *
  10824. * definition for word 2
  10825. *
  10826. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10827. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10828. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10829. * |--------------------------------------------------------------------------|
  10830. *
  10831. * where:
  10832. * PR = preamble
  10833. * BF = beamformed
  10834. */
  10835. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10836. {
  10837. A_UINT32 /* word 0 */
  10838. msg_type:8, /* [ 7: 0] */
  10839. reserved_1:24; /* [31: 8] */
  10840. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10841. A_UINT32 /* word 2 */
  10842. /* preamble:
  10843. * 0-OFDM,
  10844. * 1-CCk,
  10845. * 2-HT,
  10846. * 3-VHT
  10847. */
  10848. preamble: 2, /* [1:0] */
  10849. /* mcs:
  10850. * In case of HT preamble interpret
  10851. * MCS along with NSS.
  10852. * Valid values for HT are 0 to 7.
  10853. * HT mcs 0 with NSS 2 is mcs 8.
  10854. * Valid values for VHT are 0 to 9.
  10855. */
  10856. mcs: 4, /* [5:2] */
  10857. /* rate:
  10858. * This is applicable only for
  10859. * CCK and OFDM preamble type
  10860. * rate 0: OFDM 48 Mbps,
  10861. * 1: OFDM 24 Mbps,
  10862. * 2: OFDM 12 Mbps
  10863. * 3: OFDM 6 Mbps
  10864. * 4: OFDM 54 Mbps
  10865. * 5: OFDM 36 Mbps
  10866. * 6: OFDM 18 Mbps
  10867. * 7: OFDM 9 Mbps
  10868. * rate 0: CCK 11 Mbps Long
  10869. * 1: CCK 5.5 Mbps Long
  10870. * 2: CCK 2 Mbps Long
  10871. * 3: CCK 1 Mbps Long
  10872. * 4: CCK 11 Mbps Short
  10873. * 5: CCK 5.5 Mbps Short
  10874. * 6: CCK 2 Mbps Short
  10875. */
  10876. rate : 3, /* [ 8: 6] */
  10877. rssi : 8, /* [16: 9] units=dBm */
  10878. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10879. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10880. stbc : 1, /* [22] */
  10881. sgi : 1, /* [23] */
  10882. ldpc : 1, /* [24] */
  10883. beamformed: 1, /* [25] */
  10884. reserved_2: 6; /* [31:26] */
  10885. A_UINT32 /* word 3 */
  10886. framectrl:16, /* [15: 0] */
  10887. seqno:16; /* [31:16] */
  10888. A_UINT32 /* word 4 */
  10889. tid_num:5, /* [ 4: 0] actual TID number */
  10890. vdev_id:8, /* [12: 5] */
  10891. reserved_3:19; /* [31:13] */
  10892. A_UINT32 /* word 5 */
  10893. /* status:
  10894. * 0: tx_ok
  10895. * 1: retry
  10896. * 2: drop
  10897. * 3: filtered
  10898. * 4: abort
  10899. * 5: tid delete
  10900. * 6: sw abort
  10901. * 7: dropped by peer migration
  10902. */
  10903. status:3, /* [2:0] */
  10904. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10905. tx_mpdu_bytes:16, /* [19:4] */
  10906. /* Indicates retry count of offloaded/local generated Data tx frames */
  10907. tx_retry_cnt:6, /* [25:20] */
  10908. reserved_4:6; /* [31:26] */
  10909. } POSTPACK;
  10910. /* FW offload deliver ind message header fields */
  10911. /* DWORD one */
  10912. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10913. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10914. /* DWORD two */
  10915. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10916. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10917. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10918. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10919. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10920. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10921. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10922. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10923. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10924. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10925. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10926. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10927. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10928. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10929. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10930. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10931. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10932. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10933. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10934. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10935. /* DWORD three*/
  10936. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10937. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10938. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10939. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10940. /* DWORD four */
  10941. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10942. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10943. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10944. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10945. /* DWORD five */
  10946. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10947. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10948. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10949. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10950. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10951. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10952. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10953. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10954. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10955. do { \
  10956. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10957. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10958. } while (0)
  10959. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10960. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10961. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10962. do { \
  10963. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10964. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10965. } while (0)
  10966. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10967. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10968. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10969. do { \
  10970. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10971. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10972. } while (0)
  10973. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10974. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10975. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10976. do { \
  10977. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10978. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10979. } while (0)
  10980. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10981. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10982. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10983. do { \
  10984. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10985. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10986. } while (0)
  10987. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10988. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10989. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10990. do { \
  10991. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10992. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10993. } while (0)
  10994. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10995. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10996. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10997. do { \
  10998. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10999. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11000. } while (0)
  11001. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11002. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11003. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11004. do { \
  11005. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11006. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11007. } while (0)
  11008. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11009. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11010. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11011. do { \
  11012. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11013. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11014. } while (0)
  11015. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11016. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11017. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11018. do { \
  11019. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11020. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11021. } while (0)
  11022. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11023. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11024. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11025. do { \
  11026. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11027. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11028. } while (0)
  11029. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11030. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11031. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11032. do { \
  11033. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11034. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11035. } while (0)
  11036. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11037. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11038. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11039. do { \
  11040. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11041. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11042. } while (0)
  11043. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11044. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11045. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11046. do { \
  11047. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11048. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11049. } while (0)
  11050. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11051. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11052. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11053. do { \
  11054. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11055. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11056. } while (0)
  11057. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11058. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11059. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11060. do { \
  11061. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11062. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11063. } while (0)
  11064. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11065. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11066. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11067. do { \
  11068. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11069. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11070. } while (0)
  11071. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11072. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11073. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11074. do { \
  11075. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11076. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11077. } while (0)
  11078. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11079. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11080. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11081. do { \
  11082. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11083. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11084. } while (0)
  11085. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11086. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11087. /*
  11088. * @brief target -> host rx reorder flush message definition
  11089. *
  11090. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11091. *
  11092. * @details
  11093. * The following field definitions describe the format of the rx flush
  11094. * message sent from the target to the host.
  11095. * The message consists of a 4-octet header, followed by one or more
  11096. * 4-octet payload information elements.
  11097. *
  11098. * |31 24|23 8|7 0|
  11099. * |--------------------------------------------------------------|
  11100. * | TID | peer ID | msg type |
  11101. * |--------------------------------------------------------------|
  11102. * | seq num end | seq num start | MPDU status | reserved |
  11103. * |--------------------------------------------------------------|
  11104. * First DWORD:
  11105. * - MSG_TYPE
  11106. * Bits 7:0
  11107. * Purpose: identifies this as an rx flush message
  11108. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11109. * - PEER_ID
  11110. * Bits 23:8 (only bits 18:8 actually used)
  11111. * Purpose: identify which peer's rx data is being flushed
  11112. * Value: (rx) peer ID
  11113. * - TID
  11114. * Bits 31:24 (only bits 27:24 actually used)
  11115. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11116. * Value: traffic identifier
  11117. * Second DWORD:
  11118. * - MPDU_STATUS
  11119. * Bits 15:8
  11120. * Purpose:
  11121. * Indicate whether the flushed MPDUs should be discarded or processed.
  11122. * Value:
  11123. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11124. * stages of rx processing
  11125. * other: discard the MPDUs
  11126. * It is anticipated that flush messages will always have
  11127. * MPDU status == 1, but the status flag is included for
  11128. * flexibility.
  11129. * - SEQ_NUM_START
  11130. * Bits 23:16
  11131. * Purpose:
  11132. * Indicate the start of a series of consecutive MPDUs being flushed.
  11133. * Not all MPDUs within this range are necessarily valid - the host
  11134. * must check each sequence number within this range to see if the
  11135. * corresponding MPDU is actually present.
  11136. * Value:
  11137. * The sequence number for the first MPDU in the sequence.
  11138. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11139. * - SEQ_NUM_END
  11140. * Bits 30:24
  11141. * Purpose:
  11142. * Indicate the end of a series of consecutive MPDUs being flushed.
  11143. * Value:
  11144. * The sequence number one larger than the sequence number of the
  11145. * last MPDU being flushed.
  11146. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11147. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11148. * are to be released for further rx processing.
  11149. * Not all MPDUs within this range are necessarily valid - the host
  11150. * must check each sequence number within this range to see if the
  11151. * corresponding MPDU is actually present.
  11152. */
  11153. /* first DWORD */
  11154. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11155. #define HTT_RX_FLUSH_PEER_ID_S 8
  11156. #define HTT_RX_FLUSH_TID_M 0xff000000
  11157. #define HTT_RX_FLUSH_TID_S 24
  11158. /* second DWORD */
  11159. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11160. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11161. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11162. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11163. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11164. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11165. #define HTT_RX_FLUSH_BYTES 8
  11166. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11167. do { \
  11168. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11169. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11170. } while (0)
  11171. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11172. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11173. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11174. do { \
  11175. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11176. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11177. } while (0)
  11178. #define HTT_RX_FLUSH_TID_GET(word) \
  11179. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11180. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11181. do { \
  11182. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11183. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11184. } while (0)
  11185. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11186. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11187. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11188. do { \
  11189. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11190. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11191. } while (0)
  11192. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11193. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11194. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11195. do { \
  11196. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11197. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11198. } while (0)
  11199. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11200. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11201. /*
  11202. * @brief target -> host rx pn check indication message
  11203. *
  11204. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11205. *
  11206. * @details
  11207. * The following field definitions describe the format of the Rx PN check
  11208. * indication message sent from the target to the host.
  11209. * The message consists of a 4-octet header, followed by the start and
  11210. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11211. * IE is one octet containing the sequence number that failed the PN
  11212. * check.
  11213. *
  11214. * |31 24|23 8|7 0|
  11215. * |--------------------------------------------------------------|
  11216. * | TID | peer ID | msg type |
  11217. * |--------------------------------------------------------------|
  11218. * | Reserved | PN IE count | seq num end | seq num start|
  11219. * |--------------------------------------------------------------|
  11220. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11221. * |--------------------------------------------------------------|
  11222. * First DWORD:
  11223. * - MSG_TYPE
  11224. * Bits 7:0
  11225. * Purpose: Identifies this as an rx pn check indication message
  11226. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11227. * - PEER_ID
  11228. * Bits 23:8 (only bits 18:8 actually used)
  11229. * Purpose: identify which peer
  11230. * Value: (rx) peer ID
  11231. * - TID
  11232. * Bits 31:24 (only bits 27:24 actually used)
  11233. * Purpose: identify traffic identifier
  11234. * Value: traffic identifier
  11235. * Second DWORD:
  11236. * - SEQ_NUM_START
  11237. * Bits 7:0
  11238. * Purpose:
  11239. * Indicates the starting sequence number of the MPDU in this
  11240. * series of MPDUs that went though PN check.
  11241. * Value:
  11242. * The sequence number for the first MPDU in the sequence.
  11243. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11244. * - SEQ_NUM_END
  11245. * Bits 15:8
  11246. * Purpose:
  11247. * Indicates the ending sequence number of the MPDU in this
  11248. * series of MPDUs that went though PN check.
  11249. * Value:
  11250. * The sequence number one larger then the sequence number of the last
  11251. * MPDU being flushed.
  11252. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11253. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11254. * for invalid PN numbers and are ready to be released for further processing.
  11255. * Not all MPDUs within this range are necessarily valid - the host
  11256. * must check each sequence number within this range to see if the
  11257. * corresponding MPDU is actually present.
  11258. * - PN_IE_COUNT
  11259. * Bits 23:16
  11260. * Purpose:
  11261. * Used to determine the variable number of PN information elements in this
  11262. * message
  11263. *
  11264. * PN information elements:
  11265. * - PN_IE_x-
  11266. * Purpose:
  11267. * Each PN information element contains the sequence number of the MPDU that
  11268. * has failed the target PN check.
  11269. * Value:
  11270. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11271. * that failed the PN check.
  11272. */
  11273. /* first DWORD */
  11274. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11275. #define HTT_RX_PN_IND_PEER_ID_S 8
  11276. #define HTT_RX_PN_IND_TID_M 0xff000000
  11277. #define HTT_RX_PN_IND_TID_S 24
  11278. /* second DWORD */
  11279. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11280. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11281. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11282. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11283. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11284. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11285. #define HTT_RX_PN_IND_BYTES 8
  11286. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11287. do { \
  11288. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11289. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11290. } while (0)
  11291. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11292. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11293. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11294. do { \
  11295. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11296. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11297. } while (0)
  11298. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11299. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11300. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11301. do { \
  11302. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11303. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11304. } while (0)
  11305. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11306. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11307. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11308. do { \
  11309. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11310. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11311. } while (0)
  11312. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11313. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11314. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11315. do { \
  11316. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11317. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11318. } while (0)
  11319. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11320. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11321. /*
  11322. * @brief target -> host rx offload deliver message for LL system
  11323. *
  11324. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11325. *
  11326. * @details
  11327. * In a low latency system this message is sent whenever the offload
  11328. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11329. * The DMA of the actual packets into host memory is done before sending out
  11330. * this message. This message indicates only how many MSDUs to reap. The
  11331. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11332. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11333. * DMA'd by the MAC directly into host memory these packets do not contain
  11334. * the MAC descriptors in the header portion of the packet. Instead they contain
  11335. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11336. * message, the packets are delivered directly to the NW stack without going
  11337. * through the regular reorder buffering and PN checking path since it has
  11338. * already been done in target.
  11339. *
  11340. * |31 24|23 16|15 8|7 0|
  11341. * |-----------------------------------------------------------------------|
  11342. * | Total MSDU count | reserved | msg type |
  11343. * |-----------------------------------------------------------------------|
  11344. *
  11345. * @brief target -> host rx offload deliver message for HL system
  11346. *
  11347. * @details
  11348. * In a high latency system this message is sent whenever the offload manager
  11349. * flushes out the packets it has coalesced in its coalescing buffer. The
  11350. * actual packets are also carried along with this message. When the host
  11351. * receives this message, it is expected to deliver these packets to the NW
  11352. * stack directly instead of routing them through the reorder buffering and
  11353. * PN checking path since it has already been done in target.
  11354. *
  11355. * |31 24|23 16|15 8|7 0|
  11356. * |-----------------------------------------------------------------------|
  11357. * | Total MSDU count | reserved | msg type |
  11358. * |-----------------------------------------------------------------------|
  11359. * | peer ID | MSDU length |
  11360. * |-----------------------------------------------------------------------|
  11361. * | MSDU payload | FW Desc | tid | vdev ID |
  11362. * |-----------------------------------------------------------------------|
  11363. * | MSDU payload contd. |
  11364. * |-----------------------------------------------------------------------|
  11365. * | peer ID | MSDU length |
  11366. * |-----------------------------------------------------------------------|
  11367. * | MSDU payload | FW Desc | tid | vdev ID |
  11368. * |-----------------------------------------------------------------------|
  11369. * | MSDU payload contd. |
  11370. * |-----------------------------------------------------------------------|
  11371. *
  11372. */
  11373. /* first DWORD */
  11374. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11375. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11376. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11377. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11378. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11379. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11380. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11381. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11382. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11383. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11384. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11385. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11386. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11387. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11388. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11389. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11390. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11391. do { \
  11392. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11393. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11394. } while (0)
  11395. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11396. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11397. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11398. do { \
  11399. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11400. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11401. } while (0)
  11402. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11403. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11404. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11405. do { \
  11406. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11407. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11408. } while (0)
  11409. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11410. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11411. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11412. do { \
  11413. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11414. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11415. } while (0)
  11416. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11417. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11418. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11419. do { \
  11420. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11421. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11422. } while (0)
  11423. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11424. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11425. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11426. do { \
  11427. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11428. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11429. } while (0)
  11430. /**
  11431. * @brief target -> host rx peer map/unmap message definition
  11432. *
  11433. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11434. *
  11435. * @details
  11436. * The following diagram shows the format of the rx peer map message sent
  11437. * from the target to the host. This layout assumes the target operates
  11438. * as little-endian.
  11439. *
  11440. * This message always contains a SW peer ID. The main purpose of the
  11441. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11442. * with, so that the host can use that peer ID to determine which peer
  11443. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11444. * other purposes, such as identifying during tx completions which peer
  11445. * the tx frames in question were transmitted to.
  11446. *
  11447. * In certain generations of chips, the peer map message also contains
  11448. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11449. * to identify which peer the frame needs to be forwarded to (i.e. the
  11450. * peer associated with the Destination MAC Address within the packet),
  11451. * and particularly which vdev needs to transmit the frame (for cases
  11452. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11453. * meaning as AST_INDEX_0.
  11454. * This DA-based peer ID that is provided for certain rx frames
  11455. * (the rx frames that need to be re-transmitted as tx frames)
  11456. * is the ID that the HW uses for referring to the peer in question,
  11457. * rather than the peer ID that the SW+FW use to refer to the peer.
  11458. *
  11459. *
  11460. * |31 24|23 16|15 8|7 0|
  11461. * |-----------------------------------------------------------------------|
  11462. * | SW peer ID | VDEV ID | msg type |
  11463. * |-----------------------------------------------------------------------|
  11464. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11465. * |-----------------------------------------------------------------------|
  11466. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11467. * |-----------------------------------------------------------------------|
  11468. *
  11469. *
  11470. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11471. *
  11472. * The following diagram shows the format of the rx peer unmap message sent
  11473. * from the target to the host.
  11474. *
  11475. * |31 24|23 16|15 8|7 0|
  11476. * |-----------------------------------------------------------------------|
  11477. * | SW peer ID | VDEV ID | msg type |
  11478. * |-----------------------------------------------------------------------|
  11479. *
  11480. * The following field definitions describe the format of the rx peer map
  11481. * and peer unmap messages sent from the target to the host.
  11482. * - MSG_TYPE
  11483. * Bits 7:0
  11484. * Purpose: identifies this as an rx peer map or peer unmap message
  11485. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11486. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11487. * - VDEV_ID
  11488. * Bits 15:8
  11489. * Purpose: Indicates which virtual device the peer is associated
  11490. * with.
  11491. * Value: vdev ID (used in the host to look up the vdev object)
  11492. * - PEER_ID (a.k.a. SW_PEER_ID)
  11493. * Bits 31:16
  11494. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11495. * freeing (unmap)
  11496. * Value: (rx) peer ID
  11497. * - MAC_ADDR_L32 (peer map only)
  11498. * Bits 31:0
  11499. * Purpose: Identifies which peer node the peer ID is for.
  11500. * Value: lower 4 bytes of peer node's MAC address
  11501. * - MAC_ADDR_U16 (peer map only)
  11502. * Bits 15:0
  11503. * Purpose: Identifies which peer node the peer ID is for.
  11504. * Value: upper 2 bytes of peer node's MAC address
  11505. * - HW_PEER_ID
  11506. * Bits 31:16
  11507. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11508. * address, so for rx frames marked for rx --> tx forwarding, the
  11509. * host can determine from the HW peer ID provided as meta-data with
  11510. * the rx frame which peer the frame is supposed to be forwarded to.
  11511. * Value: ID used by the MAC HW to identify the peer
  11512. */
  11513. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11514. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11515. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11516. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11517. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11518. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11519. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11520. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11521. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11522. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11523. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11524. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11525. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11526. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11527. do { \
  11528. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11529. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11530. } while (0)
  11531. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11532. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11533. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11534. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11535. do { \
  11536. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11537. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11538. } while (0)
  11539. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11540. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11541. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11542. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11543. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11544. do { \
  11545. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11546. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11547. } while (0)
  11548. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11549. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11550. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11551. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11552. #define HTT_RX_PEER_MAP_BYTES 12
  11553. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11554. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11555. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11556. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11557. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11558. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11559. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11560. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11561. #define HTT_RX_PEER_UNMAP_BYTES 4
  11562. /**
  11563. * @brief target -> host rx peer map V2 message definition
  11564. *
  11565. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11566. *
  11567. * @details
  11568. * The following diagram shows the format of the rx peer map v2 message sent
  11569. * from the target to the host. This layout assumes the target operates
  11570. * as little-endian.
  11571. *
  11572. * This message always contains a SW peer ID. The main purpose of the
  11573. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11574. * with, so that the host can use that peer ID to determine which peer
  11575. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11576. * other purposes, such as identifying during tx completions which peer
  11577. * the tx frames in question were transmitted to.
  11578. *
  11579. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11580. * is used during rx --> tx frame forwarding to identify which peer the
  11581. * frame needs to be forwarded to (i.e. the peer associated with the
  11582. * Destination MAC Address within the packet), and particularly which vdev
  11583. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11584. * This DA-based peer ID that is provided for certain rx frames
  11585. * (the rx frames that need to be re-transmitted as tx frames)
  11586. * is the ID that the HW uses for referring to the peer in question,
  11587. * rather than the peer ID that the SW+FW use to refer to the peer.
  11588. *
  11589. * The HW peer id here is the same meaning as AST_INDEX_0.
  11590. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11591. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11592. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11593. * AST is valid.
  11594. *
  11595. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11596. * |-------------------------------------------------------------------------|
  11597. * | SW peer ID | VDEV ID | msg type |
  11598. * |-------------------------------------------------------------------------|
  11599. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11600. * |-------------------------------------------------------------------------|
  11601. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11602. * |-------------------------------------------------------------------------|
  11603. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11604. * |-------------------------------------------------------------------------|
  11605. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11606. * |-------------------------------------------------------------------------|
  11607. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11608. * |-------------------------------------------------------------------------|
  11609. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11610. * |-------------------------------------------------------------------------|
  11611. * | Reserved_2 |
  11612. * |-------------------------------------------------------------------------|
  11613. * Where:
  11614. * NH = Next Hop
  11615. * ASTVM = AST valid mask
  11616. * OA = on-chip AST valid bit
  11617. * ASTFM = AST flow mask
  11618. *
  11619. * The following field definitions describe the format of the rx peer map v2
  11620. * messages sent from the target to the host.
  11621. * - MSG_TYPE
  11622. * Bits 7:0
  11623. * Purpose: identifies this as an rx peer map v2 message
  11624. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11625. * - VDEV_ID
  11626. * Bits 15:8
  11627. * Purpose: Indicates which virtual device the peer is associated with.
  11628. * Value: vdev ID (used in the host to look up the vdev object)
  11629. * - SW_PEER_ID
  11630. * Bits 31:16
  11631. * Purpose: The peer ID (index) that WAL is allocating
  11632. * Value: (rx) peer ID
  11633. * - MAC_ADDR_L32
  11634. * Bits 31:0
  11635. * Purpose: Identifies which peer node the peer ID is for.
  11636. * Value: lower 4 bytes of peer node's MAC address
  11637. * - MAC_ADDR_U16
  11638. * Bits 15:0
  11639. * Purpose: Identifies which peer node the peer ID is for.
  11640. * Value: upper 2 bytes of peer node's MAC address
  11641. * - HW_PEER_ID / AST_INDEX_0
  11642. * Bits 31:16
  11643. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11644. * address, so for rx frames marked for rx --> tx forwarding, the
  11645. * host can determine from the HW peer ID provided as meta-data with
  11646. * the rx frame which peer the frame is supposed to be forwarded to.
  11647. * Value: ID used by the MAC HW to identify the peer
  11648. * - AST_HASH_VALUE
  11649. * Bits 15:0
  11650. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11651. * override feature.
  11652. * - NEXT_HOP
  11653. * Bit 16
  11654. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11655. * (Wireless Distribution System).
  11656. * - AST_VALID_MASK
  11657. * Bits 19:17
  11658. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11659. * - ONCHIP_AST_VALID_FLAG
  11660. * Bit 20
  11661. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11662. * is valid.
  11663. * - AST_INDEX_1
  11664. * Bits 15:0
  11665. * Purpose: indicate the second AST index for this peer
  11666. * - AST_0_FLOW_MASK
  11667. * Bits 19:16
  11668. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11669. * - AST_1_FLOW_MASK
  11670. * Bits 23:20
  11671. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11672. * - AST_2_FLOW_MASK
  11673. * Bits 27:24
  11674. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11675. * - AST_3_FLOW_MASK
  11676. * Bits 31:28
  11677. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11678. * - AST_INDEX_2
  11679. * Bits 15:0
  11680. * Purpose: indicate the third AST index for this peer
  11681. * - TID_VALID_HI_PRI
  11682. * Bits 23:16
  11683. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11684. * - TID_VALID_LOW_PRI
  11685. * Bits 31:24
  11686. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11687. * - AST_INDEX_3
  11688. * Bits 15:0
  11689. * Purpose: indicate the fourth AST index for this peer
  11690. * - ONCHIP_AST_IDX / RESERVED
  11691. * Bits 31:16
  11692. * Purpose: This field is valid only when split AST feature is enabled.
  11693. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11694. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11695. * address, this ast_idx is used for LMAC modules for RXPCU.
  11696. * Value: ID used by the LMAC HW to identify the peer
  11697. */
  11698. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11699. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11700. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11701. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11702. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11703. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11704. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11705. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11706. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11707. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11708. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11709. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11710. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11711. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11712. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11713. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11714. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11715. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11716. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11717. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11718. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11719. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11720. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11721. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11722. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11723. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11724. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11725. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11726. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11727. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11728. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11729. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11730. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11731. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11732. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11733. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11734. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11735. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11736. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11737. do { \
  11738. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11739. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11740. } while (0)
  11741. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11742. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11743. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11744. do { \
  11745. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11746. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11747. } while (0)
  11748. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11749. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11750. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11751. do { \
  11752. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11753. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11754. } while (0)
  11755. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11756. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11757. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11758. do { \
  11759. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11760. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11761. } while (0)
  11762. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11763. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11764. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11765. do { \
  11766. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11767. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11768. } while (0)
  11769. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11770. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11771. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11772. do { \
  11773. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11774. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11775. } while (0)
  11776. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11777. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11778. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11779. do { \
  11780. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11781. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11782. } while (0)
  11783. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11784. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11785. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11786. do { \
  11787. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11788. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11789. } while (0)
  11790. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11791. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11792. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11793. do { \
  11794. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11795. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11796. } while (0)
  11797. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11798. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11799. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11800. do { \
  11801. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11802. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11803. } while (0)
  11804. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11805. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11806. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11807. do { \
  11808. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11809. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11810. } while (0)
  11811. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11812. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11813. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11814. do { \
  11815. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11816. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11817. } while (0)
  11818. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11819. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11820. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11821. do { \
  11822. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11823. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11824. } while (0)
  11825. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11826. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11827. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11828. do { \
  11829. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11830. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11831. } while (0)
  11832. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11833. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11834. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11835. do { \
  11836. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11837. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11838. } while (0)
  11839. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11840. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11841. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11842. do { \
  11843. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11844. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11845. } while (0)
  11846. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11847. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11848. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11849. do { \
  11850. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11851. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11852. } while (0)
  11853. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11854. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11855. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11856. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11857. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11858. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11859. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11860. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11861. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11862. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11863. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11864. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11865. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11866. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11867. /**
  11868. * @brief target -> host rx peer map V3 message definition
  11869. *
  11870. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11871. *
  11872. * @details
  11873. * The following diagram shows the format of the rx peer map v3 message sent
  11874. * from the target to the host.
  11875. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11876. * This layout assumes the target operates as little-endian.
  11877. *
  11878. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11879. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11880. * | SW peer ID | VDEV ID | msg type |
  11881. * |-----------------+--------------------+-----------------+-----------------|
  11882. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11883. * |-----------------+--------------------+-----------------+-----------------|
  11884. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11885. * |-----------------+--------+-----------+-----------------+-----------------|
  11886. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11887. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11888. * | (8bits) | | (4bits) | |
  11889. * |-----------------+--------+--+--+--+--------------------------------------|
  11890. * | RESERVED |E |O | | |
  11891. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11892. * | |V |V | | |
  11893. * |-----------------+--------------------+-----------------------------------|
  11894. * | HTT_MSDU_IDX_ | RESERVED | |
  11895. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11896. * | (8bits) | | |
  11897. * |-----------------+--------------------+-----------------------------------|
  11898. * | Reserved_2 |
  11899. * |--------------------------------------------------------------------------|
  11900. * | Reserved_3 |
  11901. * |--------------------------------------------------------------------------|
  11902. *
  11903. * Where:
  11904. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11905. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11906. * NH = Next Hop
  11907. * The following field definitions describe the format of the rx peer map v3
  11908. * messages sent from the target to the host.
  11909. * - MSG_TYPE
  11910. * Bits 7:0
  11911. * Purpose: identifies this as a peer map v3 message
  11912. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11913. * - VDEV_ID
  11914. * Bits 15:8
  11915. * Purpose: Indicates which virtual device the peer is associated with.
  11916. * - SW_PEER_ID
  11917. * Bits 31:16
  11918. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11919. * - MAC_ADDR_L32
  11920. * Bits 31:0
  11921. * Purpose: Identifies which peer node the peer ID is for.
  11922. * Value: lower 4 bytes of peer node's MAC address
  11923. * - MAC_ADDR_U16
  11924. * Bits 15:0
  11925. * Purpose: Identifies which peer node the peer ID is for.
  11926. * Value: upper 2 bytes of peer node's MAC address
  11927. * - MULTICAST_SW_PEER_ID
  11928. * Bits 31:16
  11929. * Purpose: The multicast peer ID (index)
  11930. * Value: set to HTT_INVALID_PEER if not valid
  11931. * - HW_PEER_ID / AST_INDEX
  11932. * Bits 15:0
  11933. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11934. * address, so for rx frames marked for rx --> tx forwarding, the
  11935. * host can determine from the HW peer ID provided as meta-data with
  11936. * the rx frame which peer the frame is supposed to be forwarded to.
  11937. * - CACHE_SET_NUM
  11938. * Bits 19:16
  11939. * Purpose: Cache Set Number for AST_INDEX
  11940. * Cache set number that should be used to cache the index based
  11941. * search results, for address and flow search.
  11942. * This value should be equal to LSB 4 bits of the hash value
  11943. * of match data, in case of search index points to an entry which
  11944. * may be used in content based search also. The value can be
  11945. * anything when the entry pointed by search index will not be
  11946. * used for content based search.
  11947. * - HTT_MSDU_IDX_VALID_MASK
  11948. * Bits 31:24
  11949. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11950. * - ONCHIP_AST_IDX / RESERVED
  11951. * Bits 15:0
  11952. * Purpose: This field is valid only when split AST feature is enabled.
  11953. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11954. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11955. * address, this ast_idx is used for LMAC modules for RXPCU.
  11956. * - NEXT_HOP
  11957. * Bits 16
  11958. * Purpose: Flag indicates next_hop AST entry used for WDS
  11959. * (Wireless Distribution System).
  11960. * - ONCHIP_AST_VALID
  11961. * Bits 17
  11962. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11963. * - EXT_AST_VALID
  11964. * Bits 18
  11965. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11966. * - EXT_AST_INDEX
  11967. * Bits 15:0
  11968. * Purpose: This field describes Extended AST index
  11969. * Valid if EXT_AST_VALID flag set
  11970. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11971. * Bits 31:24
  11972. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11973. */
  11974. /* dword 0 */
  11975. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11976. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11977. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11978. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11979. /* dword 1 */
  11980. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11981. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11982. /* dword 2 */
  11983. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11984. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11985. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11986. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11987. /* dword 3 */
  11988. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11989. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11990. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11991. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11992. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11993. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11994. /* dword 4 */
  11995. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11996. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11997. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11998. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11999. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12000. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12001. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12002. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12003. /* dword 5 */
  12004. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12005. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12006. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12007. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12008. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12009. do { \
  12010. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12011. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12012. } while (0)
  12013. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12014. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12015. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12016. do { \
  12017. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12018. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12019. } while (0)
  12020. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12021. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12022. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12023. do { \
  12024. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12025. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12026. } while (0)
  12027. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12028. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12029. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12030. do { \
  12031. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12032. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12033. } while (0)
  12034. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12035. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12036. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12037. do { \
  12038. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12039. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12040. } while (0)
  12041. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12042. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12043. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12044. do { \
  12045. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12046. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12047. } while (0)
  12048. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12049. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12050. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12051. do { \
  12052. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12053. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12054. } while (0)
  12055. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12056. (((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)
  12057. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12058. do { \
  12059. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12060. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12061. } while (0)
  12062. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12063. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12064. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12065. do { \
  12066. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12067. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12068. } while (0)
  12069. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12070. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12071. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12072. do { \
  12073. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12074. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12075. } while (0)
  12076. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12077. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12078. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12079. do { \
  12080. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12081. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12082. } while (0)
  12083. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12084. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12085. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12086. do { \
  12087. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12088. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12089. } while (0)
  12090. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12091. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12092. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12093. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12094. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12095. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12096. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12097. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12098. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12099. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12100. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12101. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12102. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12103. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12104. /**
  12105. * @brief target -> host rx peer unmap V2 message definition
  12106. *
  12107. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12108. *
  12109. * The following diagram shows the format of the rx peer unmap message sent
  12110. * from the target to the host.
  12111. *
  12112. * |31 24|23 16|15 8|7 0|
  12113. * |-----------------------------------------------------------------------|
  12114. * | SW peer ID | VDEV ID | msg type |
  12115. * |-----------------------------------------------------------------------|
  12116. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12117. * |-----------------------------------------------------------------------|
  12118. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12119. * |-----------------------------------------------------------------------|
  12120. * | Peer Delete Duration |
  12121. * |-----------------------------------------------------------------------|
  12122. * | Reserved_0 | WDS Free Count |
  12123. * |-----------------------------------------------------------------------|
  12124. * | Reserved_1 |
  12125. * |-----------------------------------------------------------------------|
  12126. * | Reserved_2 |
  12127. * |-----------------------------------------------------------------------|
  12128. *
  12129. *
  12130. * The following field definitions describe the format of the rx peer unmap
  12131. * messages sent from the target to the host.
  12132. * - MSG_TYPE
  12133. * Bits 7:0
  12134. * Purpose: identifies this as an rx peer unmap v2 message
  12135. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12136. * - VDEV_ID
  12137. * Bits 15:8
  12138. * Purpose: Indicates which virtual device the peer is associated
  12139. * with.
  12140. * Value: vdev ID (used in the host to look up the vdev object)
  12141. * - SW_PEER_ID
  12142. * Bits 31:16
  12143. * Purpose: The peer ID (index) that WAL is freeing
  12144. * Value: (rx) peer ID
  12145. * - MAC_ADDR_L32
  12146. * Bits 31:0
  12147. * Purpose: Identifies which peer node the peer ID is for.
  12148. * Value: lower 4 bytes of peer node's MAC address
  12149. * - MAC_ADDR_U16
  12150. * Bits 15:0
  12151. * Purpose: Identifies which peer node the peer ID is for.
  12152. * Value: upper 2 bytes of peer node's MAC address
  12153. * - NEXT_HOP
  12154. * Bits 16
  12155. * Purpose: Bit indicates next_hop AST entry used for WDS
  12156. * (Wireless Distribution System).
  12157. * - PEER_DELETE_DURATION
  12158. * Bits 31:0
  12159. * Purpose: Time taken to delete peer, in msec,
  12160. * Used for monitoring / debugging PEER delete response delay
  12161. * - PEER_WDS_FREE_COUNT
  12162. * Bits 15:0
  12163. * Purpose: Count of WDS entries deleted associated to peer deleted
  12164. */
  12165. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12166. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12167. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12168. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12169. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12170. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12171. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12172. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12173. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12174. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12175. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12176. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12177. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12178. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12179. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12180. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12181. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12182. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12183. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12184. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12185. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12186. do { \
  12187. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12188. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12189. } while (0)
  12190. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12191. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12192. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12193. do { \
  12194. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12195. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12196. } while (0)
  12197. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12198. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12199. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12200. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12201. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12202. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12203. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12204. /**
  12205. * @brief target -> host rx peer mlo map message definition
  12206. *
  12207. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12208. *
  12209. * @details
  12210. * The following diagram shows the format of the rx mlo peer map message sent
  12211. * from the target to the host. This layout assumes the target operates
  12212. * as little-endian.
  12213. *
  12214. * MCC:
  12215. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12216. *
  12217. * WIN:
  12218. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12219. * It will be sent on the Assoc Link.
  12220. *
  12221. * This message always contains a MLO peer ID. The main purpose of the
  12222. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12223. * with, so that the host can use that MLO peer ID to determine which peer
  12224. * transmitted the rx frame.
  12225. *
  12226. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12227. * |-------------------------------------------------------------------------|
  12228. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12229. * |-------------------------------------------------------------------------|
  12230. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12231. * |-------------------------------------------------------------------------|
  12232. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12233. * |-------------------------------------------------------------------------|
  12234. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12235. * |-------------------------------------------------------------------------|
  12236. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12237. * |-------------------------------------------------------------------------|
  12238. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12239. * |-------------------------------------------------------------------------|
  12240. * |RSVD |
  12241. * |-------------------------------------------------------------------------|
  12242. * |RSVD |
  12243. * |-------------------------------------------------------------------------|
  12244. * | htt_tlv_hdr_t |
  12245. * |-------------------------------------------------------------------------|
  12246. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12247. * |-------------------------------------------------------------------------|
  12248. * | htt_tlv_hdr_t |
  12249. * |-------------------------------------------------------------------------|
  12250. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12251. * |-------------------------------------------------------------------------|
  12252. * | htt_tlv_hdr_t |
  12253. * |-------------------------------------------------------------------------|
  12254. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12255. * |-------------------------------------------------------------------------|
  12256. *
  12257. * Where:
  12258. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12259. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12260. * V (valid) - 1 Bit Bit17
  12261. * CHIPID - 3 Bits
  12262. * TIDMASK - 8 Bits
  12263. * CACHE_SET_NUM - 8 Bits
  12264. *
  12265. * The following field definitions describe the format of the rx MLO peer map
  12266. * messages sent from the target to the host.
  12267. * - MSG_TYPE
  12268. * Bits 7:0
  12269. * Purpose: identifies this as an rx mlo peer map message
  12270. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12271. *
  12272. * - MLO_PEER_ID
  12273. * Bits 23:8
  12274. * Purpose: The MLO peer ID (index).
  12275. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12276. * Value: MLO peer ID
  12277. *
  12278. * - NUMLINK
  12279. * Bits: 26:24 (3Bits)
  12280. * Purpose: Indicate the max number of logical links supported per client.
  12281. * Value: number of logical links
  12282. *
  12283. * - PRC
  12284. * Bits: 29:27 (3Bits)
  12285. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12286. * if there is migration of the primary chip.
  12287. * Value: Primary REO CHIPID
  12288. *
  12289. * - MAC_ADDR_L32
  12290. * Bits 31:0
  12291. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12292. * Value: lower 4 bytes of peer node's MAC address
  12293. *
  12294. * - MAC_ADDR_U16
  12295. * Bits 15:0
  12296. * Purpose: Identifies which peer node the peer ID is for.
  12297. * Value: upper 2 bytes of peer node's MAC address
  12298. *
  12299. * - PRIMARY_TCL_AST_IDX
  12300. * Bits 15:0
  12301. * Purpose: Primary TCL AST index for this peer.
  12302. *
  12303. * - V
  12304. * 1 Bit Position 16
  12305. * Purpose: If the ast idx is valid.
  12306. *
  12307. * - CHIPID
  12308. * Bits 19:17
  12309. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12310. *
  12311. * - TIDMASK
  12312. * Bits 27:20
  12313. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12314. *
  12315. * - CACHE_SET_NUM
  12316. * Bits 31:28
  12317. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12318. * Cache set number that should be used to cache the index based
  12319. * search results, for address and flow search.
  12320. * This value should be equal to LSB four bits of the hash value
  12321. * of match data, in case of search index points to an entry which
  12322. * may be used in content based search also. The value can be
  12323. * anything when the entry pointed by search index will not be
  12324. * used for content based search.
  12325. *
  12326. * - htt_tlv_hdr_t
  12327. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12328. *
  12329. * Bits 11:0
  12330. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12331. *
  12332. * Bits 23:12
  12333. * Purpose: Length, Length of the value that follows the header
  12334. *
  12335. * Bits 31:28
  12336. * Purpose: Reserved.
  12337. *
  12338. *
  12339. * - SW_PEER_ID
  12340. * Bits 15:0
  12341. * Purpose: The peer ID (index) that WAL is allocating
  12342. * Value: (rx) peer ID
  12343. *
  12344. * - VDEV_ID
  12345. * Bits 23:16
  12346. * Purpose: Indicates which virtual device the peer is associated with.
  12347. * Value: vdev ID (used in the host to look up the vdev object)
  12348. *
  12349. * - CHIPID
  12350. * Bits 26:24
  12351. * Purpose: Indicates which Chip id the peer is associated with.
  12352. * Value: chip ID (Provided by Host as part of QMI exchange)
  12353. */
  12354. typedef enum {
  12355. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12356. } MLO_PEER_MAP_TLV_TAG_ID;
  12357. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12358. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12359. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12360. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12361. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12362. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12363. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12364. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12365. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12366. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12367. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12368. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12369. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12370. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12371. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12372. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12373. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12374. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12375. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12376. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12377. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12378. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12379. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12380. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12381. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12382. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12383. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12384. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12385. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12386. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12387. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12388. do { \
  12389. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12390. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12391. } while (0)
  12392. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12393. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12394. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12395. do { \
  12396. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12397. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12398. } while (0)
  12399. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12400. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12401. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12402. do { \
  12403. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12404. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12405. } while (0)
  12406. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12407. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12408. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12409. do { \
  12410. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12411. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12412. } while (0)
  12413. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12414. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12415. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12416. do { \
  12417. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12418. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12419. } while (0)
  12420. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12421. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12422. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12423. do { \
  12424. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12425. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12426. } while (0)
  12427. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12428. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12429. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12430. do { \
  12431. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12432. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12433. } while (0)
  12434. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12435. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12436. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12437. do { \
  12438. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12439. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12440. } while (0)
  12441. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12442. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12443. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12444. do { \
  12445. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12446. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12447. } while (0)
  12448. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12449. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12450. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12451. do { \
  12452. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12453. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12454. } while (0)
  12455. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12456. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12457. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12458. do { \
  12459. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12460. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12461. } while (0)
  12462. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12463. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12464. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12465. do { \
  12466. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12467. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12468. } while (0)
  12469. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12470. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12471. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12472. do { \
  12473. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12474. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12475. } while (0)
  12476. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12477. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12478. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12479. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12480. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12481. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12482. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12483. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12484. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12485. *
  12486. * The following diagram shows the format of the rx mlo peer unmap message sent
  12487. * from the target to the host.
  12488. *
  12489. * |31 24|23 16|15 8|7 0|
  12490. * |-----------------------------------------------------------------------|
  12491. * | RSVD_24_31 | MLO peer ID | msg type |
  12492. * |-----------------------------------------------------------------------|
  12493. */
  12494. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12495. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12496. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12497. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12498. /**
  12499. * @brief target -> host message specifying security parameters
  12500. *
  12501. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12502. *
  12503. * @details
  12504. * The following diagram shows the format of the security specification
  12505. * message sent from the target to the host.
  12506. * This security specification message tells the host whether a PN check is
  12507. * necessary on rx data frames, and if so, how large the PN counter is.
  12508. * This message also tells the host about the security processing to apply
  12509. * to defragmented rx frames - specifically, whether a Message Integrity
  12510. * Check is required, and the Michael key to use.
  12511. *
  12512. * |31 24|23 16|15|14 8|7 0|
  12513. * |-----------------------------------------------------------------------|
  12514. * | peer ID | U| security type | msg type |
  12515. * |-----------------------------------------------------------------------|
  12516. * | Michael Key K0 |
  12517. * |-----------------------------------------------------------------------|
  12518. * | Michael Key K1 |
  12519. * |-----------------------------------------------------------------------|
  12520. * | WAPI RSC Low0 |
  12521. * |-----------------------------------------------------------------------|
  12522. * | WAPI RSC Low1 |
  12523. * |-----------------------------------------------------------------------|
  12524. * | WAPI RSC Hi0 |
  12525. * |-----------------------------------------------------------------------|
  12526. * | WAPI RSC Hi1 |
  12527. * |-----------------------------------------------------------------------|
  12528. *
  12529. * The following field definitions describe the format of the security
  12530. * indication message sent from the target to the host.
  12531. * - MSG_TYPE
  12532. * Bits 7:0
  12533. * Purpose: identifies this as a security specification message
  12534. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12535. * - SEC_TYPE
  12536. * Bits 14:8
  12537. * Purpose: specifies which type of security applies to the peer
  12538. * Value: htt_sec_type enum value
  12539. * - UNICAST
  12540. * Bit 15
  12541. * Purpose: whether this security is applied to unicast or multicast data
  12542. * Value: 1 -> unicast, 0 -> multicast
  12543. * - PEER_ID
  12544. * Bits 31:16
  12545. * Purpose: The ID number for the peer the security specification is for
  12546. * Value: peer ID
  12547. * - MICHAEL_KEY_K0
  12548. * Bits 31:0
  12549. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12550. * Value: Michael Key K0 (if security type is TKIP)
  12551. * - MICHAEL_KEY_K1
  12552. * Bits 31:0
  12553. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12554. * Value: Michael Key K1 (if security type is TKIP)
  12555. * - WAPI_RSC_LOW0
  12556. * Bits 31:0
  12557. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12558. * Value: WAPI RSC Low0 (if security type is WAPI)
  12559. * - WAPI_RSC_LOW1
  12560. * Bits 31:0
  12561. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12562. * Value: WAPI RSC Low1 (if security type is WAPI)
  12563. * - WAPI_RSC_HI0
  12564. * Bits 31:0
  12565. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12566. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12567. * - WAPI_RSC_HI1
  12568. * Bits 31:0
  12569. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12570. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12571. */
  12572. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12573. #define HTT_SEC_IND_SEC_TYPE_S 8
  12574. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12575. #define HTT_SEC_IND_UNICAST_S 15
  12576. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12577. #define HTT_SEC_IND_PEER_ID_S 16
  12578. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12579. do { \
  12580. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12581. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12582. } while (0)
  12583. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12584. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12585. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12586. do { \
  12587. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12588. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12589. } while (0)
  12590. #define HTT_SEC_IND_UNICAST_GET(word) \
  12591. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12592. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12593. do { \
  12594. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12595. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12596. } while (0)
  12597. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12598. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12599. #define HTT_SEC_IND_BYTES 28
  12600. /**
  12601. * @brief target -> host rx ADDBA / DELBA message definitions
  12602. *
  12603. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12604. *
  12605. * @details
  12606. * The following diagram shows the format of the rx ADDBA message sent
  12607. * from the target to the host:
  12608. *
  12609. * |31 20|19 16|15 8|7 0|
  12610. * |---------------------------------------------------------------------|
  12611. * | peer ID | TID | window size | msg type |
  12612. * |---------------------------------------------------------------------|
  12613. *
  12614. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12615. *
  12616. * The following diagram shows the format of the rx DELBA message sent
  12617. * from the target to the host:
  12618. *
  12619. * |31 20|19 16|15 10|9 8|7 0|
  12620. * |---------------------------------------------------------------------|
  12621. * | peer ID | TID | window size | IR| msg type |
  12622. * |---------------------------------------------------------------------|
  12623. *
  12624. * The following field definitions describe the format of the rx ADDBA
  12625. * and DELBA messages sent from the target to the host.
  12626. * - MSG_TYPE
  12627. * Bits 7:0
  12628. * Purpose: identifies this as an rx ADDBA or DELBA message
  12629. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12630. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12631. * - IR (initiator / recipient)
  12632. * Bits 9:8 (DELBA only)
  12633. * Purpose: specify whether the DELBA handshake was initiated by the
  12634. * local STA/AP, or by the peer STA/AP
  12635. * Value:
  12636. * 0 - unspecified
  12637. * 1 - initiator (a.k.a. originator)
  12638. * 2 - recipient (a.k.a. responder)
  12639. * 3 - unused / reserved
  12640. * - WIN_SIZE
  12641. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12642. * Purpose: Specifies the length of the block ack window (max = 64).
  12643. * Value:
  12644. * block ack window length specified by the received ADDBA/DELBA
  12645. * management message.
  12646. * - TID
  12647. * Bits 19:16
  12648. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12649. * Value:
  12650. * TID specified by the received ADDBA or DELBA management message.
  12651. * - PEER_ID
  12652. * Bits 31:20
  12653. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12654. * Value:
  12655. * ID (hash value) used by the host for fast, direct lookup of
  12656. * host SW peer info, including rx reorder states.
  12657. */
  12658. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12659. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12660. #define HTT_RX_ADDBA_TID_M 0xf0000
  12661. #define HTT_RX_ADDBA_TID_S 16
  12662. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12663. #define HTT_RX_ADDBA_PEER_ID_S 20
  12664. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12665. do { \
  12666. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12667. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12668. } while (0)
  12669. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12670. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12671. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12672. do { \
  12673. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12674. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12675. } while (0)
  12676. #define HTT_RX_ADDBA_TID_GET(word) \
  12677. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12678. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12679. do { \
  12680. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12681. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12682. } while (0)
  12683. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12684. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12685. #define HTT_RX_ADDBA_BYTES 4
  12686. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12687. #define HTT_RX_DELBA_INITIATOR_S 8
  12688. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12689. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12690. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12691. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12692. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12693. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12694. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12695. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12696. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12697. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12698. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12699. do { \
  12700. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12701. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12702. } while (0)
  12703. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12704. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12705. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12706. do { \
  12707. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12708. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12709. } while (0)
  12710. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12711. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12712. #define HTT_RX_DELBA_BYTES 4
  12713. /**
  12714. * @brief target -> host rx ADDBA / DELBA message definitions
  12715. *
  12716. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12717. *
  12718. * @details
  12719. * The following diagram shows the format of the rx ADDBA extn message sent
  12720. * from the target to the host:
  12721. *
  12722. * |31 20|19 16|15 13|12 8|7 0|
  12723. * |---------------------------------------------------------------------|
  12724. * | peer ID | TID | reserved | msg type |
  12725. * |---------------------------------------------------------------------|
  12726. * | reserved | window size |
  12727. * |---------------------------------------------------------------------|
  12728. *
  12729. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12730. *
  12731. * The following diagram shows the format of the rx DELBA message sent
  12732. * from the target to the host:
  12733. *
  12734. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12735. * |---------------------------------------------------------------------|
  12736. * | peer ID | TID | reserved | IR| msg type |
  12737. * |---------------------------------------------------------------------|
  12738. * | reserved | window size |
  12739. * |---------------------------------------------------------------------|
  12740. *
  12741. * The following field definitions describe the format of the rx ADDBA
  12742. * and DELBA messages sent from the target to the host.
  12743. * - MSG_TYPE
  12744. * Bits 7:0
  12745. * Purpose: identifies this as an rx ADDBA or DELBA message
  12746. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12747. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12748. * - IR (initiator / recipient)
  12749. * Bits 9:8 (DELBA only)
  12750. * Purpose: specify whether the DELBA handshake was initiated by the
  12751. * local STA/AP, or by the peer STA/AP
  12752. * Value:
  12753. * 0 - unspecified
  12754. * 1 - initiator (a.k.a. originator)
  12755. * 2 - recipient (a.k.a. responder)
  12756. * 3 - unused / reserved
  12757. * Value:
  12758. * block ack window length specified by the received ADDBA/DELBA
  12759. * management message.
  12760. * - TID
  12761. * Bits 19:16
  12762. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12763. * Value:
  12764. * TID specified by the received ADDBA or DELBA management message.
  12765. * - PEER_ID
  12766. * Bits 31:20
  12767. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12768. * Value:
  12769. * ID (hash value) used by the host for fast, direct lookup of
  12770. * host SW peer info, including rx reorder states.
  12771. * == DWORD 1
  12772. * - WIN_SIZE
  12773. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12774. * Purpose: Specifies the length of the block ack window (max = 8191).
  12775. */
  12776. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12777. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12778. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12779. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12780. /*--- Dword 0 ---*/
  12781. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12782. do { \
  12783. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12784. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12785. } while (0)
  12786. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12787. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12788. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12789. do { \
  12790. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12791. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12792. } while (0)
  12793. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12794. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12795. /*--- Dword 1 ---*/
  12796. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12797. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12798. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12799. do { \
  12800. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12801. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12802. } while (0)
  12803. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12804. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12805. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12806. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12807. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12808. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12809. #define HTT_RX_DELBA_EXTN_TID_S 16
  12810. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12811. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12812. /*--- Dword 0 ---*/
  12813. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12814. do { \
  12815. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12816. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12817. } while (0)
  12818. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12819. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12820. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12821. do { \
  12822. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12823. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12824. } while (0)
  12825. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12826. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12827. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12828. do { \
  12829. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12830. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12831. } while (0)
  12832. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12833. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12834. /*--- Dword 1 ---*/
  12835. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12836. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12837. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12838. do { \
  12839. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12840. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12841. } while (0)
  12842. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12843. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12844. #define HTT_RX_DELBA_EXTN_BYTES 8
  12845. /**
  12846. * @brief tx queue group information element definition
  12847. *
  12848. * @details
  12849. * The following diagram shows the format of the tx queue group
  12850. * information element, which can be included in target --> host
  12851. * messages to specify the number of tx "credits" (tx descriptors
  12852. * for LL, or tx buffers for HL) available to a particular group
  12853. * of host-side tx queues, and which host-side tx queues belong to
  12854. * the group.
  12855. *
  12856. * |31|30 24|23 16|15|14|13 0|
  12857. * |------------------------------------------------------------------------|
  12858. * | X| reserved | tx queue grp ID | A| S| credit count |
  12859. * |------------------------------------------------------------------------|
  12860. * | vdev ID mask | AC mask |
  12861. * |------------------------------------------------------------------------|
  12862. *
  12863. * The following definitions describe the fields within the tx queue group
  12864. * information element:
  12865. * - credit_count
  12866. * Bits 13:1
  12867. * Purpose: specify how many tx credits are available to the tx queue group
  12868. * Value: An absolute or relative, positive or negative credit value
  12869. * The 'A' bit specifies whether the value is absolute or relative.
  12870. * The 'S' bit specifies whether the value is positive or negative.
  12871. * A negative value can only be relative, not absolute.
  12872. * An absolute value replaces any prior credit value the host has for
  12873. * the tx queue group in question.
  12874. * A relative value is added to the prior credit value the host has for
  12875. * the tx queue group in question.
  12876. * - sign
  12877. * Bit 14
  12878. * Purpose: specify whether the credit count is positive or negative
  12879. * Value: 0 -> positive, 1 -> negative
  12880. * - absolute
  12881. * Bit 15
  12882. * Purpose: specify whether the credit count is absolute or relative
  12883. * Value: 0 -> relative, 1 -> absolute
  12884. * - txq_group_id
  12885. * Bits 23:16
  12886. * Purpose: indicate which tx queue group's credit and/or membership are
  12887. * being specified
  12888. * Value: 0 to max_tx_queue_groups-1
  12889. * - reserved
  12890. * Bits 30:16
  12891. * Value: 0x0
  12892. * - eXtension
  12893. * Bit 31
  12894. * Purpose: specify whether another tx queue group info element follows
  12895. * Value: 0 -> no more tx queue group information elements
  12896. * 1 -> another tx queue group information element immediately follows
  12897. * - ac_mask
  12898. * Bits 15:0
  12899. * Purpose: specify which Access Categories belong to the tx queue group
  12900. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12901. * the tx queue group.
  12902. * The AC bit-mask values are obtained by left-shifting by the
  12903. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12904. * - vdev_id_mask
  12905. * Bits 31:16
  12906. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12907. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12908. * belong to the tx queue group.
  12909. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12910. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12911. */
  12912. PREPACK struct htt_txq_group {
  12913. A_UINT32
  12914. credit_count: 14,
  12915. sign: 1,
  12916. absolute: 1,
  12917. tx_queue_group_id: 8,
  12918. reserved0: 7,
  12919. extension: 1;
  12920. A_UINT32
  12921. ac_mask: 16,
  12922. vdev_id_mask: 16;
  12923. } POSTPACK;
  12924. /* first word */
  12925. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12926. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12927. #define HTT_TXQ_GROUP_SIGN_S 14
  12928. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12929. #define HTT_TXQ_GROUP_ABS_S 15
  12930. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12931. #define HTT_TXQ_GROUP_ID_S 16
  12932. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12933. #define HTT_TXQ_GROUP_EXT_S 31
  12934. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12935. /* second word */
  12936. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12937. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12938. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12939. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12940. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12941. do { \
  12942. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12943. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12944. } while (0)
  12945. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12946. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12947. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12948. do { \
  12949. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12950. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12951. } while (0)
  12952. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12953. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12954. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12955. do { \
  12956. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12957. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12958. } while (0)
  12959. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12960. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12961. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12962. do { \
  12963. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12964. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12965. } while (0)
  12966. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12967. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12968. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12969. do { \
  12970. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12971. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12972. } while (0)
  12973. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12974. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12975. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12976. do { \
  12977. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12978. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12979. } while (0)
  12980. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12981. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12982. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12983. do { \
  12984. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12985. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12986. } while (0)
  12987. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12988. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12989. /**
  12990. * @brief target -> host TX completion indication message definition
  12991. *
  12992. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12993. *
  12994. * @details
  12995. * The following diagram shows the format of the TX completion indication sent
  12996. * from the target to the host
  12997. *
  12998. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12999. * |-------------------------------------------------------------------|
  13000. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13001. * |-------------------------------------------------------------------|
  13002. * payload:| MSDU1 ID | MSDU0 ID |
  13003. * |-------------------------------------------------------------------|
  13004. * : MSDU3 ID | MSDU2 ID :
  13005. * |-------------------------------------------------------------------|
  13006. * | struct htt_tx_compl_ind_append_retries |
  13007. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13008. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13009. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13010. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13011. * |-------------------------------------------------------------------|
  13012. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13013. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13014. * | MSDU0 tx_tsf64_low |
  13015. * |-------------------------------------------------------------------|
  13016. * | MSDU0 tx_tsf64_high |
  13017. * |-------------------------------------------------------------------|
  13018. * | MSDU1 tx_tsf64_low |
  13019. * |-------------------------------------------------------------------|
  13020. * | MSDU1 tx_tsf64_high |
  13021. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13022. * | phy_timestamp |
  13023. * |-------------------------------------------------------------------|
  13024. * | rate specs (see below) |
  13025. * |-------------------------------------------------------------------|
  13026. * | seqctrl | framectrl |
  13027. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13028. * Where:
  13029. * A0 = append (a.k.a. append0)
  13030. * A1 = append1
  13031. * TP = MSDU tx power presence
  13032. * A2 = append2
  13033. * A3 = append3
  13034. * A4 = append4
  13035. *
  13036. * The following field definitions describe the format of the TX completion
  13037. * indication sent from the target to the host
  13038. * Header fields:
  13039. * - msg_type
  13040. * Bits 7:0
  13041. * Purpose: identifies this as HTT TX completion indication
  13042. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13043. * - status
  13044. * Bits 10:8
  13045. * Purpose: the TX completion status of payload fragmentations descriptors
  13046. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13047. * - tid
  13048. * Bits 14:11
  13049. * Purpose: the tid associated with those fragmentation descriptors. It is
  13050. * valid or not, depending on the tid_invalid bit.
  13051. * Value: 0 to 15
  13052. * - tid_invalid
  13053. * Bits 15:15
  13054. * Purpose: this bit indicates whether the tid field is valid or not
  13055. * Value: 0 indicates valid; 1 indicates invalid
  13056. * - num
  13057. * Bits 23:16
  13058. * Purpose: the number of payload in this indication
  13059. * Value: 1 to 255
  13060. * - append (a.k.a. append0)
  13061. * Bits 24:24
  13062. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13063. * the number of tx retries for one MSDU at the end of this message
  13064. * Value: 0 indicates no appending; 1 indicates appending
  13065. * - append1
  13066. * Bits 25:25
  13067. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13068. * contains the timestamp info for each TX msdu id in payload.
  13069. * The order of the timestamps matches the order of the MSDU IDs.
  13070. * Note that a big-endian host needs to account for the reordering
  13071. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13072. * conversion) when determining which tx timestamp corresponds to
  13073. * which MSDU ID.
  13074. * Value: 0 indicates no appending; 1 indicates appending
  13075. * - msdu_tx_power_presence
  13076. * Bits 26:26
  13077. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13078. * for each MSDU referenced by the TX_COMPL_IND message.
  13079. * The tx power is reported in 0.5 dBm units.
  13080. * The order of the per-MSDU tx power reports matches the order
  13081. * of the MSDU IDs.
  13082. * Note that a big-endian host needs to account for the reordering
  13083. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13084. * conversion) when determining which Tx Power corresponds to
  13085. * which MSDU ID.
  13086. * Value: 0 indicates MSDU tx power reports are not appended,
  13087. * 1 indicates MSDU tx power reports are appended
  13088. * - append2
  13089. * Bits 27:27
  13090. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13091. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13092. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13093. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13094. * for each MSDU, for convenience.
  13095. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13096. * this append2 bit is set).
  13097. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13098. * dB above the noise floor.
  13099. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13100. * 1 indicates MSDU ACK RSSI values are appended.
  13101. * - append3
  13102. * Bits 28:28
  13103. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13104. * contains the tx tsf info based on wlan global TSF for
  13105. * each TX msdu id in payload.
  13106. * The order of the tx tsf matches the order of the MSDU IDs.
  13107. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13108. * values to indicate the the lower 32 bits and higher 32 bits of
  13109. * the tx tsf.
  13110. * The tx_tsf64 here represents the time MSDU was acked and the
  13111. * tx_tsf64 has microseconds units.
  13112. * Value: 0 indicates no appending; 1 indicates appending
  13113. * - append4
  13114. * Bits 29:29
  13115. * Purpose: Indicate whether data frame control fields and fields required
  13116. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13117. * message. The order of the this message matches the order of
  13118. * the MSDU IDs.
  13119. * Value: 0 indicates frame control fields and fields required for
  13120. * radio tap header values are not appended,
  13121. * 1 indicates frame control fields and fields required for
  13122. * radio tap header values are appended.
  13123. * Payload fields:
  13124. * - hmsdu_id
  13125. * Bits 15:0
  13126. * Purpose: this ID is used to track the Tx buffer in host
  13127. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13128. */
  13129. PREPACK struct htt_tx_data_hdr_information {
  13130. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13131. A_UINT32 /* word 1 */
  13132. /* preamble:
  13133. * 0-OFDM,
  13134. * 1-CCk,
  13135. * 2-HT,
  13136. * 3-VHT
  13137. */
  13138. preamble: 2, /* [1:0] */
  13139. /* mcs:
  13140. * In case of HT preamble interpret
  13141. * MCS along with NSS.
  13142. * Valid values for HT are 0 to 7.
  13143. * HT mcs 0 with NSS 2 is mcs 8.
  13144. * Valid values for VHT are 0 to 9.
  13145. */
  13146. mcs: 4, /* [5:2] */
  13147. /* rate:
  13148. * This is applicable only for
  13149. * CCK and OFDM preamble type
  13150. * rate 0: OFDM 48 Mbps,
  13151. * 1: OFDM 24 Mbps,
  13152. * 2: OFDM 12 Mbps
  13153. * 3: OFDM 6 Mbps
  13154. * 4: OFDM 54 Mbps
  13155. * 5: OFDM 36 Mbps
  13156. * 6: OFDM 18 Mbps
  13157. * 7: OFDM 9 Mbps
  13158. * rate 0: CCK 11 Mbps Long
  13159. * 1: CCK 5.5 Mbps Long
  13160. * 2: CCK 2 Mbps Long
  13161. * 3: CCK 1 Mbps Long
  13162. * 4: CCK 11 Mbps Short
  13163. * 5: CCK 5.5 Mbps Short
  13164. * 6: CCK 2 Mbps Short
  13165. */
  13166. rate : 3, /* [ 8: 6] */
  13167. rssi : 8, /* [16: 9] units=dBm */
  13168. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13169. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13170. stbc : 1, /* [22] */
  13171. sgi : 1, /* [23] */
  13172. ldpc : 1, /* [24] */
  13173. beamformed: 1, /* [25] */
  13174. /* tx_retry_cnt:
  13175. * Indicates retry count of data tx frames provided by the host.
  13176. */
  13177. tx_retry_cnt: 6; /* [31:26] */
  13178. A_UINT32 /* word 2 */
  13179. framectrl:16, /* [15: 0] */
  13180. seqno:16; /* [31:16] */
  13181. } POSTPACK;
  13182. #define HTT_TX_COMPL_IND_STATUS_S 8
  13183. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13184. #define HTT_TX_COMPL_IND_TID_S 11
  13185. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13186. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13187. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13188. #define HTT_TX_COMPL_IND_NUM_S 16
  13189. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13190. #define HTT_TX_COMPL_IND_APPEND_S 24
  13191. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13192. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13193. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13194. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13195. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13196. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13197. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13198. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13199. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13200. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13201. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13202. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13203. do { \
  13204. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13205. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13206. } while (0)
  13207. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13208. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13209. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13210. do { \
  13211. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13212. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13213. } while (0)
  13214. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13215. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13216. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13217. do { \
  13218. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13219. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13220. } while (0)
  13221. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13222. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13223. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13224. do { \
  13225. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13226. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13227. } while (0)
  13228. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13229. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13230. HTT_TX_COMPL_IND_TID_INV_S)
  13231. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13232. do { \
  13233. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13234. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13235. } while (0)
  13236. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13237. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13238. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13239. do { \
  13240. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13241. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13242. } while (0)
  13243. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13244. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13245. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13246. do { \
  13247. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13248. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13249. } while (0)
  13250. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13251. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13252. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13253. do { \
  13254. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13255. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13256. } while (0)
  13257. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13258. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13259. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13260. do { \
  13261. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13262. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13263. } while (0)
  13264. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13265. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13266. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13267. do { \
  13268. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13269. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13270. } while (0)
  13271. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13272. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13273. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13274. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13275. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13276. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13277. #define HTT_TX_COMPL_IND_STAT_OK 0
  13278. /* DISCARD:
  13279. * current meaning:
  13280. * MSDUs were queued for transmission but filtered by HW or SW
  13281. * without any over the air attempts
  13282. * legacy meaning (HL Rome):
  13283. * MSDUs were discarded by the target FW without any over the air
  13284. * attempts due to lack of space
  13285. */
  13286. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13287. /* NO_ACK:
  13288. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13289. */
  13290. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13291. /* POSTPONE:
  13292. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13293. * be downloaded again later (in the appropriate order), when they are
  13294. * deliverable.
  13295. */
  13296. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13297. /*
  13298. * The PEER_DEL tx completion status is used for HL cases
  13299. * where the peer the frame is for has been deleted.
  13300. * The host has already discarded its copy of the frame, but
  13301. * it still needs the tx completion to restore its credit.
  13302. */
  13303. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13304. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13305. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13306. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13307. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13308. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13309. PREPACK struct htt_tx_compl_ind_base {
  13310. A_UINT32 hdr;
  13311. A_UINT16 payload[1/*or more*/];
  13312. } POSTPACK;
  13313. PREPACK struct htt_tx_compl_ind_append_retries {
  13314. A_UINT16 msdu_id;
  13315. A_UINT8 tx_retries;
  13316. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13317. 0: this is the last append_retries struct */
  13318. } POSTPACK;
  13319. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13320. A_UINT32 timestamp[1/*or more*/];
  13321. } POSTPACK;
  13322. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13323. A_UINT32 tx_tsf64_low;
  13324. A_UINT32 tx_tsf64_high;
  13325. } POSTPACK;
  13326. /* htt_tx_data_hdr_information payload extension fields: */
  13327. /* DWORD zero */
  13328. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13329. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13330. /* DWORD one */
  13331. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13332. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13333. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13334. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13335. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13336. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13337. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13338. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13339. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13340. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13341. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13342. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13343. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13344. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13345. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13346. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13347. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13348. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13349. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13350. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13351. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13352. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13353. /* DWORD two */
  13354. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13355. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13356. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13357. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13358. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13359. do { \
  13360. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13361. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13362. } while (0)
  13363. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13364. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13365. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13366. do { \
  13367. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13368. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13369. } while (0)
  13370. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13371. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13372. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13373. do { \
  13374. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13375. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13376. } while (0)
  13377. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13378. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13379. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13380. do { \
  13381. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13382. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13383. } while (0)
  13384. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13385. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13386. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13387. do { \
  13388. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13389. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13390. } while (0)
  13391. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13392. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13393. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13394. do { \
  13395. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13396. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13397. } while (0)
  13398. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13399. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13400. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13401. do { \
  13402. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13403. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13404. } while (0)
  13405. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13406. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13407. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13408. do { \
  13409. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13410. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13411. } while (0)
  13412. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13413. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13414. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13415. do { \
  13416. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13417. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13418. } while (0)
  13419. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13420. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13421. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13422. do { \
  13423. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13424. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13425. } while (0)
  13426. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13427. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13428. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13429. do { \
  13430. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13431. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13432. } while (0)
  13433. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13434. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13435. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13436. do { \
  13437. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13438. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13439. } while (0)
  13440. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13441. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13442. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13443. do { \
  13444. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13445. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13446. } while (0)
  13447. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13448. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13449. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13450. do { \
  13451. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13452. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13453. } while (0)
  13454. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13455. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13456. /**
  13457. * @brief target -> host rate-control update indication message
  13458. *
  13459. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  13460. *
  13461. * @details
  13462. * The following diagram shows the format of the RC Update message
  13463. * sent from the target to the host, while processing the tx-completion
  13464. * of a transmitted PPDU.
  13465. *
  13466. * |31 24|23 16|15 8|7 0|
  13467. * |-------------------------------------------------------------|
  13468. * | peer ID | vdev ID | msg_type |
  13469. * |-------------------------------------------------------------|
  13470. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  13471. * |-------------------------------------------------------------|
  13472. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  13473. * |-------------------------------------------------------------|
  13474. * | : |
  13475. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13476. * | : |
  13477. * |-------------------------------------------------------------|
  13478. * | : |
  13479. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13480. * | : |
  13481. * |-------------------------------------------------------------|
  13482. * : :
  13483. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13484. *
  13485. */
  13486. typedef struct {
  13487. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  13488. A_UINT32 rate_code_flags;
  13489. A_UINT32 flags; /* Encodes information such as excessive
  13490. retransmission, aggregate, some info
  13491. from .11 frame control,
  13492. STBC, LDPC, (SGI and Tx Chain Mask
  13493. are encoded in ptx_rc->flags field),
  13494. AMPDU truncation (BT/time based etc.),
  13495. RTS/CTS attempt */
  13496. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13497. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13498. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13499. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13500. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13501. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13502. } HTT_RC_TX_DONE_PARAMS;
  13503. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13504. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13505. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13506. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13507. #define HTT_RC_UPDATE_VDEVID_S 8
  13508. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13509. #define HTT_RC_UPDATE_PEERID_S 16
  13510. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13511. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13512. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13513. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13514. do { \
  13515. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13516. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13517. } while (0)
  13518. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13519. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13520. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13521. do { \
  13522. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13523. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13524. } while (0)
  13525. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13526. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13527. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13528. do { \
  13529. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13530. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13531. } while (0)
  13532. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13533. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13534. /**
  13535. * @brief target -> host rx fragment indication message definition
  13536. *
  13537. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13538. *
  13539. * @details
  13540. * The following field definitions describe the format of the rx fragment
  13541. * indication message sent from the target to the host.
  13542. * The rx fragment indication message shares the format of the
  13543. * rx indication message, but not all fields from the rx indication message
  13544. * are relevant to the rx fragment indication message.
  13545. *
  13546. *
  13547. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13548. * |-----------+-------------------+---------------------+-------------|
  13549. * | peer ID | |FV| ext TID | msg type |
  13550. * |-------------------------------------------------------------------|
  13551. * | | flush | flush |
  13552. * | | end | start |
  13553. * | | seq num | seq num |
  13554. * |-------------------------------------------------------------------|
  13555. * | reserved | FW rx desc bytes |
  13556. * |-------------------------------------------------------------------|
  13557. * | | FW MSDU Rx |
  13558. * | | desc B0 |
  13559. * |-------------------------------------------------------------------|
  13560. * Header fields:
  13561. * - MSG_TYPE
  13562. * Bits 7:0
  13563. * Purpose: identifies this as an rx fragment indication message
  13564. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13565. * - EXT_TID
  13566. * Bits 12:8
  13567. * Purpose: identify the traffic ID of the rx data, including
  13568. * special "extended" TID values for multicast, broadcast, and
  13569. * non-QoS data frames
  13570. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13571. * - FLUSH_VALID (FV)
  13572. * Bit 13
  13573. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13574. * is valid
  13575. * Value:
  13576. * 1 -> flush IE is valid and needs to be processed
  13577. * 0 -> flush IE is not valid and should be ignored
  13578. * - PEER_ID
  13579. * Bits 31:16
  13580. * Purpose: Identify, by ID, which peer sent the rx data
  13581. * Value: ID of the peer who sent the rx data
  13582. * - FLUSH_SEQ_NUM_START
  13583. * Bits 5:0
  13584. * Purpose: Indicate the start of a series of MPDUs to flush
  13585. * Not all MPDUs within this series are necessarily valid - the host
  13586. * must check each sequence number within this range to see if the
  13587. * corresponding MPDU is actually present.
  13588. * This field is only valid if the FV bit is set.
  13589. * Value:
  13590. * The sequence number for the first MPDUs to check to flush.
  13591. * The sequence number is masked by 0x3f.
  13592. * - FLUSH_SEQ_NUM_END
  13593. * Bits 11:6
  13594. * Purpose: Indicate the end of a series of MPDUs to flush
  13595. * Value:
  13596. * The sequence number one larger than the sequence number of the
  13597. * last MPDU to check to flush.
  13598. * The sequence number is masked by 0x3f.
  13599. * Not all MPDUs within this series are necessarily valid - the host
  13600. * must check each sequence number within this range to see if the
  13601. * corresponding MPDU is actually present.
  13602. * This field is only valid if the FV bit is set.
  13603. * Rx descriptor fields:
  13604. * - FW_RX_DESC_BYTES
  13605. * Bits 15:0
  13606. * Purpose: Indicate how many bytes in the Rx indication are used for
  13607. * FW Rx descriptors
  13608. * Value: 1
  13609. */
  13610. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13611. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13612. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13613. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13614. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13615. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13616. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13617. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13618. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13619. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13620. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13621. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13622. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13623. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13624. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13625. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13626. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13627. #define HTT_RX_FRAG_IND_BYTES \
  13628. (4 /* msg hdr */ + \
  13629. 4 /* flush spec */ + \
  13630. 4 /* (unused) FW rx desc bytes spec */ + \
  13631. 4 /* FW rx desc */)
  13632. /**
  13633. * @brief target -> host test message definition
  13634. *
  13635. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13636. *
  13637. * @details
  13638. * The following field definitions describe the format of the test
  13639. * message sent from the target to the host.
  13640. * The message consists of a 4-octet header, followed by a variable
  13641. * number of 32-bit integer values, followed by a variable number
  13642. * of 8-bit character values.
  13643. *
  13644. * |31 16|15 8|7 0|
  13645. * |-----------------------------------------------------------|
  13646. * | num chars | num ints | msg type |
  13647. * |-----------------------------------------------------------|
  13648. * | int 0 |
  13649. * |-----------------------------------------------------------|
  13650. * | int 1 |
  13651. * |-----------------------------------------------------------|
  13652. * | ... |
  13653. * |-----------------------------------------------------------|
  13654. * | char 3 | char 2 | char 1 | char 0 |
  13655. * |-----------------------------------------------------------|
  13656. * | | | ... | char 4 |
  13657. * |-----------------------------------------------------------|
  13658. * - MSG_TYPE
  13659. * Bits 7:0
  13660. * Purpose: identifies this as a test message
  13661. * Value: HTT_MSG_TYPE_TEST
  13662. * - NUM_INTS
  13663. * Bits 15:8
  13664. * Purpose: indicate how many 32-bit integers follow the message header
  13665. * - NUM_CHARS
  13666. * Bits 31:16
  13667. * Purpose: indicate how many 8-bit characters follow the series of integers
  13668. */
  13669. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13670. #define HTT_RX_TEST_NUM_INTS_S 8
  13671. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13672. #define HTT_RX_TEST_NUM_CHARS_S 16
  13673. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13674. do { \
  13675. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13676. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13677. } while (0)
  13678. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13679. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13680. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13681. do { \
  13682. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13683. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13684. } while (0)
  13685. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13686. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13687. /**
  13688. * @brief target -> host packet log message
  13689. *
  13690. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13691. *
  13692. * @details
  13693. * The following field definitions describe the format of the packet log
  13694. * message sent from the target to the host.
  13695. * The message consists of a 4-octet header,followed by a variable number
  13696. * of 32-bit character values.
  13697. *
  13698. * |31 16|15 12|11 10|9 8|7 0|
  13699. * |------------------------------------------------------------------|
  13700. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13701. * |------------------------------------------------------------------|
  13702. * | payload |
  13703. * |------------------------------------------------------------------|
  13704. * - MSG_TYPE
  13705. * Bits 7:0
  13706. * Purpose: identifies this as a pktlog message
  13707. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13708. * - mac_id
  13709. * Bits 9:8
  13710. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13711. * Value: 0-3
  13712. * - pdev_id
  13713. * Bits 11:10
  13714. * Purpose: pdev_id
  13715. * Value: 0-3
  13716. * 0 (for rings at SOC level),
  13717. * 1/2/3 PDEV -> 0/1/2
  13718. * - payload_size
  13719. * Bits 31:16
  13720. * Purpose: explicitly specify the payload size
  13721. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13722. */
  13723. PREPACK struct htt_pktlog_msg {
  13724. A_UINT32 header;
  13725. A_UINT32 payload[1/* or more */];
  13726. } POSTPACK;
  13727. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13728. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13729. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13730. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13731. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13732. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13733. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13734. do { \
  13735. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13736. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13737. } while (0)
  13738. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13739. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13740. HTT_T2H_PKTLOG_MAC_ID_S)
  13741. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13742. do { \
  13743. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13744. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13745. } while (0)
  13746. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13747. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13748. HTT_T2H_PKTLOG_PDEV_ID_S)
  13749. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13750. do { \
  13751. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13752. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13753. } while (0)
  13754. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13755. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13756. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13757. /*
  13758. * Rx reorder statistics
  13759. * NB: all the fields must be defined in 4 octets size.
  13760. */
  13761. struct rx_reorder_stats {
  13762. /* Non QoS MPDUs received */
  13763. A_UINT32 deliver_non_qos;
  13764. /* MPDUs received in-order */
  13765. A_UINT32 deliver_in_order;
  13766. /* Flush due to reorder timer expired */
  13767. A_UINT32 deliver_flush_timeout;
  13768. /* Flush due to move out of window */
  13769. A_UINT32 deliver_flush_oow;
  13770. /* Flush due to DELBA */
  13771. A_UINT32 deliver_flush_delba;
  13772. /* MPDUs dropped due to FCS error */
  13773. A_UINT32 fcs_error;
  13774. /* MPDUs dropped due to monitor mode non-data packet */
  13775. A_UINT32 mgmt_ctrl;
  13776. /* Unicast-data MPDUs dropped due to invalid peer */
  13777. A_UINT32 invalid_peer;
  13778. /* MPDUs dropped due to duplication (non aggregation) */
  13779. A_UINT32 dup_non_aggr;
  13780. /* MPDUs dropped due to processed before */
  13781. A_UINT32 dup_past;
  13782. /* MPDUs dropped due to duplicate in reorder queue */
  13783. A_UINT32 dup_in_reorder;
  13784. /* Reorder timeout happened */
  13785. A_UINT32 reorder_timeout;
  13786. /* invalid bar ssn */
  13787. A_UINT32 invalid_bar_ssn;
  13788. /* reorder reset due to bar ssn */
  13789. A_UINT32 ssn_reset;
  13790. /* Flush due to delete peer */
  13791. A_UINT32 deliver_flush_delpeer;
  13792. /* Flush due to offload*/
  13793. A_UINT32 deliver_flush_offload;
  13794. /* Flush due to out of buffer*/
  13795. A_UINT32 deliver_flush_oob;
  13796. /* MPDUs dropped due to PN check fail */
  13797. A_UINT32 pn_fail;
  13798. /* MPDUs dropped due to unable to allocate memory */
  13799. A_UINT32 store_fail;
  13800. /* Number of times the tid pool alloc succeeded */
  13801. A_UINT32 tid_pool_alloc_succ;
  13802. /* Number of times the MPDU pool alloc succeeded */
  13803. A_UINT32 mpdu_pool_alloc_succ;
  13804. /* Number of times the MSDU pool alloc succeeded */
  13805. A_UINT32 msdu_pool_alloc_succ;
  13806. /* Number of times the tid pool alloc failed */
  13807. A_UINT32 tid_pool_alloc_fail;
  13808. /* Number of times the MPDU pool alloc failed */
  13809. A_UINT32 mpdu_pool_alloc_fail;
  13810. /* Number of times the MSDU pool alloc failed */
  13811. A_UINT32 msdu_pool_alloc_fail;
  13812. /* Number of times the tid pool freed */
  13813. A_UINT32 tid_pool_free;
  13814. /* Number of times the MPDU pool freed */
  13815. A_UINT32 mpdu_pool_free;
  13816. /* Number of times the MSDU pool freed */
  13817. A_UINT32 msdu_pool_free;
  13818. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13819. A_UINT32 msdu_queued;
  13820. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13821. A_UINT32 msdu_recycled;
  13822. /* Number of MPDUs with invalid peer but A2 found in AST */
  13823. A_UINT32 invalid_peer_a2_in_ast;
  13824. /* Number of MPDUs with invalid peer but A3 found in AST */
  13825. A_UINT32 invalid_peer_a3_in_ast;
  13826. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13827. A_UINT32 invalid_peer_bmc_mpdus;
  13828. /* Number of MSDUs with err attention word */
  13829. A_UINT32 rxdesc_err_att;
  13830. /* Number of MSDUs with flag of peer_idx_invalid */
  13831. A_UINT32 rxdesc_err_peer_idx_inv;
  13832. /* Number of MSDUs with flag of peer_idx_timeout */
  13833. A_UINT32 rxdesc_err_peer_idx_to;
  13834. /* Number of MSDUs with flag of overflow */
  13835. A_UINT32 rxdesc_err_ov;
  13836. /* Number of MSDUs with flag of msdu_length_err */
  13837. A_UINT32 rxdesc_err_msdu_len;
  13838. /* Number of MSDUs with flag of mpdu_length_err */
  13839. A_UINT32 rxdesc_err_mpdu_len;
  13840. /* Number of MSDUs with flag of tkip_mic_err */
  13841. A_UINT32 rxdesc_err_tkip_mic;
  13842. /* Number of MSDUs with flag of decrypt_err */
  13843. A_UINT32 rxdesc_err_decrypt;
  13844. /* Number of MSDUs with flag of fcs_err */
  13845. A_UINT32 rxdesc_err_fcs;
  13846. /* Number of Unicast (bc_mc bit is not set in attention word)
  13847. * frames with invalid peer handler
  13848. */
  13849. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13850. /* Number of unicast frame directly (direct bit is set in attention word)
  13851. * to DUT with invalid peer handler
  13852. */
  13853. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13854. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13855. * frames with invalid peer handler
  13856. */
  13857. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13858. /* Number of MSDUs dropped due to no first MSDU flag */
  13859. A_UINT32 rxdesc_no_1st_msdu;
  13860. /* Number of MSDUs dropped due to ring overflow */
  13861. A_UINT32 msdu_drop_ring_ov;
  13862. /* Number of MSDUs dropped due to FC mismatch */
  13863. A_UINT32 msdu_drop_fc_mismatch;
  13864. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13865. A_UINT32 msdu_drop_mgmt_remote_ring;
  13866. /* Number of MSDUs dropped due to errors not reported in attention word */
  13867. A_UINT32 msdu_drop_misc;
  13868. /* Number of MSDUs go to offload before reorder */
  13869. A_UINT32 offload_msdu_wal;
  13870. /* Number of data frame dropped by offload after reorder */
  13871. A_UINT32 offload_msdu_reorder;
  13872. /* Number of MPDUs with sequence number in the past and within the BA window */
  13873. A_UINT32 dup_past_within_window;
  13874. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13875. A_UINT32 dup_past_outside_window;
  13876. /* Number of MSDUs with decrypt/MIC error */
  13877. A_UINT32 rxdesc_err_decrypt_mic;
  13878. /* Number of data MSDUs received on both local and remote rings */
  13879. A_UINT32 data_msdus_on_both_rings;
  13880. /* MPDUs never filled */
  13881. A_UINT32 holes_not_filled;
  13882. };
  13883. /*
  13884. * Rx Remote buffer statistics
  13885. * NB: all the fields must be defined in 4 octets size.
  13886. */
  13887. struct rx_remote_buffer_mgmt_stats {
  13888. /* Total number of MSDUs reaped for Rx processing */
  13889. A_UINT32 remote_reaped;
  13890. /* MSDUs recycled within firmware */
  13891. A_UINT32 remote_recycled;
  13892. /* MSDUs stored by Data Rx */
  13893. A_UINT32 data_rx_msdus_stored;
  13894. /* Number of HTT indications from WAL Rx MSDU */
  13895. A_UINT32 wal_rx_ind;
  13896. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13897. A_UINT32 wal_rx_ind_unconsumed;
  13898. /* Number of HTT indications from Data Rx MSDU */
  13899. A_UINT32 data_rx_ind;
  13900. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13901. A_UINT32 data_rx_ind_unconsumed;
  13902. /* Number of HTT indications from ATHBUF */
  13903. A_UINT32 athbuf_rx_ind;
  13904. /* Number of remote buffers requested for refill */
  13905. A_UINT32 refill_buf_req;
  13906. /* Number of remote buffers filled by the host */
  13907. A_UINT32 refill_buf_rsp;
  13908. /* Number of times MAC hw_index = f/w write_index */
  13909. A_INT32 mac_no_bufs;
  13910. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13911. A_INT32 fw_indices_equal;
  13912. /* Number of times f/w finds no buffers to post */
  13913. A_INT32 host_no_bufs;
  13914. };
  13915. /*
  13916. * TXBF MU/SU packets and NDPA statistics
  13917. * NB: all the fields must be defined in 4 octets size.
  13918. */
  13919. struct rx_txbf_musu_ndpa_pkts_stats {
  13920. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13921. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13922. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13923. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13924. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13925. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13926. };
  13927. /*
  13928. * htt_dbg_stats_status -
  13929. * present - The requested stats have been delivered in full.
  13930. * This indicates that either the stats information was contained
  13931. * in its entirety within this message, or else this message
  13932. * completes the delivery of the requested stats info that was
  13933. * partially delivered through earlier STATS_CONF messages.
  13934. * partial - The requested stats have been delivered in part.
  13935. * One or more subsequent STATS_CONF messages with the same
  13936. * cookie value will be sent to deliver the remainder of the
  13937. * information.
  13938. * error - The requested stats could not be delivered, for example due
  13939. * to a shortage of memory to construct a message holding the
  13940. * requested stats.
  13941. * invalid - The requested stat type is either not recognized, or the
  13942. * target is configured to not gather the stats type in question.
  13943. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13944. * series_done - This special value indicates that no further stats info
  13945. * elements are present within a series of stats info elems
  13946. * (within a stats upload confirmation message).
  13947. */
  13948. enum htt_dbg_stats_status {
  13949. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13950. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13951. HTT_DBG_STATS_STATUS_ERROR = 2,
  13952. HTT_DBG_STATS_STATUS_INVALID = 3,
  13953. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13954. };
  13955. /**
  13956. * @brief target -> host statistics upload
  13957. *
  13958. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13959. *
  13960. * @details
  13961. * The following field definitions describe the format of the HTT target
  13962. * to host stats upload confirmation message.
  13963. * The message contains a cookie echoed from the HTT host->target stats
  13964. * upload request, which identifies which request the confirmation is
  13965. * for, and a series of tag-length-value stats information elements.
  13966. * The tag-length header for each stats info element also includes a
  13967. * status field, to indicate whether the request for the stat type in
  13968. * question was fully met, partially met, unable to be met, or invalid
  13969. * (if the stat type in question is disabled in the target).
  13970. * A special value of all 1's in this status field is used to indicate
  13971. * the end of the series of stats info elements.
  13972. *
  13973. *
  13974. * |31 16|15 8|7 5|4 0|
  13975. * |------------------------------------------------------------|
  13976. * | reserved | msg type |
  13977. * |------------------------------------------------------------|
  13978. * | cookie LSBs |
  13979. * |------------------------------------------------------------|
  13980. * | cookie MSBs |
  13981. * |------------------------------------------------------------|
  13982. * | stats entry length | reserved | S |stat type|
  13983. * |------------------------------------------------------------|
  13984. * | |
  13985. * | type-specific stats info |
  13986. * | |
  13987. * |------------------------------------------------------------|
  13988. * | stats entry length | reserved | S |stat type|
  13989. * |------------------------------------------------------------|
  13990. * | |
  13991. * | type-specific stats info |
  13992. * | |
  13993. * |------------------------------------------------------------|
  13994. * | n/a | reserved | 111 | n/a |
  13995. * |------------------------------------------------------------|
  13996. * Header fields:
  13997. * - MSG_TYPE
  13998. * Bits 7:0
  13999. * Purpose: identifies this is a statistics upload confirmation message
  14000. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  14001. * - COOKIE_LSBS
  14002. * Bits 31:0
  14003. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14004. * message with its preceding host->target stats request message.
  14005. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14006. * - COOKIE_MSBS
  14007. * Bits 31:0
  14008. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14009. * message with its preceding host->target stats request message.
  14010. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14011. *
  14012. * Stats Information Element tag-length header fields:
  14013. * - STAT_TYPE
  14014. * Bits 4:0
  14015. * Purpose: identifies the type of statistics info held in the
  14016. * following information element
  14017. * Value: htt_dbg_stats_type
  14018. * - STATUS
  14019. * Bits 7:5
  14020. * Purpose: indicate whether the requested stats are present
  14021. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  14022. * the completion of the stats entry series
  14023. * - LENGTH
  14024. * Bits 31:16
  14025. * Purpose: indicate the stats information size
  14026. * Value: This field specifies the number of bytes of stats information
  14027. * that follows the element tag-length header.
  14028. * It is expected but not required that this length is a multiple of
  14029. * 4 bytes. Even if the length is not an integer multiple of 4, the
  14030. * subsequent stats entry header will begin on a 4-byte aligned
  14031. * boundary.
  14032. */
  14033. #define HTT_T2H_STATS_COOKIE_SIZE 8
  14034. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  14035. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  14036. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  14037. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  14038. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  14039. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  14040. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  14041. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14042. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  14043. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  14044. do { \
  14045. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  14046. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  14047. } while (0)
  14048. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  14049. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  14050. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  14051. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  14052. do { \
  14053. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  14054. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  14055. } while (0)
  14056. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  14057. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  14058. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  14059. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14060. do { \
  14061. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  14062. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  14063. } while (0)
  14064. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  14065. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  14066. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  14067. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  14068. #define HTT_MAX_AGGR 64
  14069. #define HTT_HL_MAX_AGGR 18
  14070. /**
  14071. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  14072. *
  14073. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  14074. *
  14075. * @details
  14076. * The following field definitions describe the format of the HTT host
  14077. * to target frag_desc/msdu_ext bank configuration message.
  14078. * The message contains the based address and the min and max id of the
  14079. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  14080. * MSDU_EXT/FRAG_DESC.
  14081. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  14082. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  14083. * the hardware does the mapping/translation.
  14084. *
  14085. * Total banks that can be configured is configured to 16.
  14086. *
  14087. * This should be called before any TX has be initiated by the HTT
  14088. *
  14089. * |31 16|15 8|7 5|4 0|
  14090. * |------------------------------------------------------------|
  14091. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  14092. * |------------------------------------------------------------|
  14093. * | BANK0_BASE_ADDRESS (bits 31:0) |
  14094. #if HTT_PADDR64
  14095. * | BANK0_BASE_ADDRESS (bits 63:32) |
  14096. #endif
  14097. * |------------------------------------------------------------|
  14098. * | ... |
  14099. * |------------------------------------------------------------|
  14100. * | BANK15_BASE_ADDRESS (bits 31:0) |
  14101. #if HTT_PADDR64
  14102. * | BANK15_BASE_ADDRESS (bits 63:32) |
  14103. #endif
  14104. * |------------------------------------------------------------|
  14105. * | BANK0_MAX_ID | BANK0_MIN_ID |
  14106. * |------------------------------------------------------------|
  14107. * | ... |
  14108. * |------------------------------------------------------------|
  14109. * | BANK15_MAX_ID | BANK15_MIN_ID |
  14110. * |------------------------------------------------------------|
  14111. * Header fields:
  14112. * - MSG_TYPE
  14113. * Bits 7:0
  14114. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  14115. * for systems with 64-bit format for bus addresses:
  14116. * - BANKx_BASE_ADDRESS_LO
  14117. * Bits 31:0
  14118. * Purpose: Provide a mechanism to specify the base address of the
  14119. * MSDU_EXT bank physical/bus address.
  14120. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  14121. * - BANKx_BASE_ADDRESS_HI
  14122. * Bits 31:0
  14123. * Purpose: Provide a mechanism to specify the base address of the
  14124. * MSDU_EXT bank physical/bus address.
  14125. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  14126. * for systems with 32-bit format for bus addresses:
  14127. * - BANKx_BASE_ADDRESS
  14128. * Bits 31:0
  14129. * Purpose: Provide a mechanism to specify the base address of the
  14130. * MSDU_EXT bank physical/bus address.
  14131. * Value: MSDU_EXT bank physical / bus address
  14132. * - BANKx_MIN_ID
  14133. * Bits 15:0
  14134. * Purpose: Provide a mechanism to specify the min index that needs to
  14135. * mapped.
  14136. * - BANKx_MAX_ID
  14137. * Bits 31:16
  14138. * Purpose: Provide a mechanism to specify the max index that needs to
  14139. * mapped.
  14140. *
  14141. */
  14142. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  14143. * safe value.
  14144. * @note MAX supported banks is 16.
  14145. */
  14146. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  14147. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  14148. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  14149. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  14150. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  14151. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  14152. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  14153. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  14154. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  14155. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  14156. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  14157. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  14158. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  14159. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  14160. do { \
  14161. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  14162. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  14163. } while (0)
  14164. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  14165. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  14166. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  14167. do { \
  14168. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  14169. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  14170. } while (0)
  14171. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  14172. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  14173. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  14174. do { \
  14175. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  14176. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  14177. } while (0)
  14178. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  14179. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  14180. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  14181. do { \
  14182. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  14183. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  14184. } while (0)
  14185. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  14186. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  14187. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  14188. do { \
  14189. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  14190. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  14191. } while (0)
  14192. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  14193. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  14194. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  14195. do { \
  14196. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  14197. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  14198. } while (0)
  14199. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  14200. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  14201. /*
  14202. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  14203. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  14204. * addresses are stored in a XXX-bit field.
  14205. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  14206. * htt_tx_frag_desc64_bank_cfg_t structs.
  14207. */
  14208. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  14209. _paddr_bits_, \
  14210. _paddr__bank_base_address_) \
  14211. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  14212. /** word 0 \
  14213. * msg_type: 8, \
  14214. * pdev_id: 2, \
  14215. * swap: 1, \
  14216. * reserved0: 5, \
  14217. * num_banks: 8, \
  14218. * desc_size: 8; \
  14219. */ \
  14220. A_UINT32 word0; \
  14221. /* \
  14222. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  14223. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  14224. * the second A_UINT32). \
  14225. */ \
  14226. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14227. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14228. } POSTPACK
  14229. /* define htt_tx_frag_desc32_bank_cfg_t */
  14230. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  14231. /* define htt_tx_frag_desc64_bank_cfg_t */
  14232. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  14233. /*
  14234. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  14235. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  14236. */
  14237. #if HTT_PADDR64
  14238. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  14239. #else
  14240. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  14241. #endif
  14242. /**
  14243. * @brief target -> host HTT TX Credit total count update message definition
  14244. *
  14245. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  14246. *
  14247. *|31 16|15|14 9| 8 |7 0 |
  14248. *|---------------------+--+----------+-------+----------|
  14249. *|cur htt credit delta | Q| reserved | sign | msg type |
  14250. *|------------------------------------------------------|
  14251. *
  14252. * Header fields:
  14253. * - MSG_TYPE
  14254. * Bits 7:0
  14255. * Purpose: identifies this as a htt tx credit delta update message
  14256. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14257. * - SIGN
  14258. * Bits 8
  14259. * identifies whether credit delta is positive or negative
  14260. * Value:
  14261. * - 0x0: credit delta is positive, rebalance in some buffers
  14262. * - 0x1: credit delta is negative, rebalance out some buffers
  14263. * - reserved
  14264. * Bits 14:9
  14265. * Value: 0x0
  14266. * - TXQ_GRP
  14267. * Bit 15
  14268. * Purpose: indicates whether any tx queue group information elements
  14269. * are appended to the tx credit update message
  14270. * Value: 0 -> no tx queue group information element is present
  14271. * 1 -> a tx queue group information element immediately follows
  14272. * - DELTA_COUNT
  14273. * Bits 31:16
  14274. * Purpose: Specify current htt credit delta absolute count
  14275. */
  14276. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14277. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14278. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14279. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14280. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14281. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14282. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14283. do { \
  14284. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14285. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14286. } while (0)
  14287. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14288. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14289. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14290. do { \
  14291. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14292. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14293. } while (0)
  14294. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14295. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14296. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14297. do { \
  14298. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14299. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14300. } while (0)
  14301. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14302. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14303. #define HTT_TX_CREDIT_MSG_BYTES 4
  14304. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14305. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14306. /**
  14307. * @brief HTT WDI_IPA Operation Response Message
  14308. *
  14309. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14310. *
  14311. * @details
  14312. * HTT WDI_IPA Operation Response message is sent by target
  14313. * to host confirming suspend or resume operation.
  14314. * |31 24|23 16|15 8|7 0|
  14315. * |----------------+----------------+----------------+----------------|
  14316. * | op_code | Rsvd | msg_type |
  14317. * |-------------------------------------------------------------------|
  14318. * | Rsvd | Response len |
  14319. * |-------------------------------------------------------------------|
  14320. * | |
  14321. * | Response-type specific info |
  14322. * | |
  14323. * | |
  14324. * |-------------------------------------------------------------------|
  14325. * Header fields:
  14326. * - MSG_TYPE
  14327. * Bits 7:0
  14328. * Purpose: Identifies this as WDI_IPA Operation Response message
  14329. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14330. * - OP_CODE
  14331. * Bits 31:16
  14332. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  14333. * value: = enum htt_wdi_ipa_op_code
  14334. * - RSP_LEN
  14335. * Bits 16:0
  14336. * Purpose: length for the response-type specific info
  14337. * value: = length in bytes for response-type specific info
  14338. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  14339. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  14340. */
  14341. PREPACK struct htt_wdi_ipa_op_response_t
  14342. {
  14343. /* DWORD 0: flags and meta-data */
  14344. A_UINT32
  14345. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14346. reserved1: 8,
  14347. op_code: 16;
  14348. A_UINT32
  14349. rsp_len: 16,
  14350. reserved2: 16;
  14351. } POSTPACK;
  14352. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  14353. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  14354. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  14355. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  14356. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  14357. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  14358. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  14359. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  14360. do { \
  14361. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  14362. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  14363. } while (0)
  14364. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  14365. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  14366. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  14367. do { \
  14368. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  14369. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  14370. } while (0)
  14371. enum htt_phy_mode {
  14372. htt_phy_mode_11a = 0,
  14373. htt_phy_mode_11g = 1,
  14374. htt_phy_mode_11b = 2,
  14375. htt_phy_mode_11g_only = 3,
  14376. htt_phy_mode_11na_ht20 = 4,
  14377. htt_phy_mode_11ng_ht20 = 5,
  14378. htt_phy_mode_11na_ht40 = 6,
  14379. htt_phy_mode_11ng_ht40 = 7,
  14380. htt_phy_mode_11ac_vht20 = 8,
  14381. htt_phy_mode_11ac_vht40 = 9,
  14382. htt_phy_mode_11ac_vht80 = 10,
  14383. htt_phy_mode_11ac_vht20_2g = 11,
  14384. htt_phy_mode_11ac_vht40_2g = 12,
  14385. htt_phy_mode_11ac_vht80_2g = 13,
  14386. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  14387. htt_phy_mode_11ac_vht160 = 15,
  14388. htt_phy_mode_max,
  14389. };
  14390. /**
  14391. * @brief target -> host HTT channel change indication
  14392. *
  14393. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  14394. *
  14395. * @details
  14396. * Specify when a channel change occurs.
  14397. * This allows the host to precisely determine which rx frames arrived
  14398. * on the old channel and which rx frames arrived on the new channel.
  14399. *
  14400. *|31 |7 0 |
  14401. *|-------------------------------------------+----------|
  14402. *| reserved | msg type |
  14403. *|------------------------------------------------------|
  14404. *| primary_chan_center_freq_mhz |
  14405. *|------------------------------------------------------|
  14406. *| contiguous_chan1_center_freq_mhz |
  14407. *|------------------------------------------------------|
  14408. *| contiguous_chan2_center_freq_mhz |
  14409. *|------------------------------------------------------|
  14410. *| phy_mode |
  14411. *|------------------------------------------------------|
  14412. *
  14413. * Header fields:
  14414. * - MSG_TYPE
  14415. * Bits 7:0
  14416. * Purpose: identifies this as a htt channel change indication message
  14417. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  14418. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  14419. * Bits 31:0
  14420. * Purpose: identify the (center of the) new 20 MHz primary channel
  14421. * Value: center frequency of the 20 MHz primary channel, in MHz units
  14422. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  14423. * Bits 31:0
  14424. * Purpose: identify the (center of the) contiguous frequency range
  14425. * comprising the new channel.
  14426. * For example, if the new channel is a 80 MHz channel extending
  14427. * 60 MHz beyond the primary channel, this field would be 30 larger
  14428. * than the primary channel center frequency field.
  14429. * Value: center frequency of the contiguous frequency range comprising
  14430. * the full channel in MHz units
  14431. * (80+80 channels also use the CONTIG_CHAN2 field)
  14432. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  14433. * Bits 31:0
  14434. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  14435. * within a VHT 80+80 channel.
  14436. * This field is only relevant for VHT 80+80 channels.
  14437. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  14438. * channel (arbitrary value for cases besides VHT 80+80)
  14439. * - PHY_MODE
  14440. * Bits 31:0
  14441. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  14442. * and band
  14443. * Value: htt_phy_mode enum value
  14444. */
  14445. PREPACK struct htt_chan_change_t
  14446. {
  14447. /* DWORD 0: flags and meta-data */
  14448. A_UINT32
  14449. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14450. reserved1: 24;
  14451. A_UINT32 primary_chan_center_freq_mhz;
  14452. A_UINT32 contig_chan1_center_freq_mhz;
  14453. A_UINT32 contig_chan2_center_freq_mhz;
  14454. A_UINT32 phy_mode;
  14455. } POSTPACK;
  14456. /*
  14457. * Due to historical / backwards-compatibility reasons, maintain the
  14458. * below htt_chan_change_msg struct definition, which needs to be
  14459. * consistent with the above htt_chan_change_t struct definition
  14460. * (aside from the htt_chan_change_t definition including the msg_type
  14461. * dword within the message, and the htt_chan_change_msg only containing
  14462. * the payload of the message that follows the msg_type dword).
  14463. */
  14464. PREPACK struct htt_chan_change_msg {
  14465. A_UINT32 chan_mhz; /* frequency in mhz */
  14466. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  14467. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  14468. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  14469. } POSTPACK;
  14470. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  14471. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  14472. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  14473. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  14474. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  14475. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  14476. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  14477. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  14478. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  14479. do { \
  14480. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  14481. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  14482. } while (0)
  14483. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  14484. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  14485. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  14486. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  14487. do { \
  14488. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  14489. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  14490. } while (0)
  14491. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  14492. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  14493. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  14494. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14495. do { \
  14496. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14497. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14498. } while (0)
  14499. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14500. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14501. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14502. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14503. do { \
  14504. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14505. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14506. } while (0)
  14507. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14508. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14509. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14510. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14511. /**
  14512. * @brief rx offload packet error message
  14513. *
  14514. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14515. *
  14516. * @details
  14517. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14518. * of target payload like mic err.
  14519. *
  14520. * |31 24|23 16|15 8|7 0|
  14521. * |----------------+----------------+----------------+----------------|
  14522. * | tid | vdev_id | msg_sub_type | msg_type |
  14523. * |-------------------------------------------------------------------|
  14524. * : (sub-type dependent content) :
  14525. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14526. * Header fields:
  14527. * - msg_type
  14528. * Bits 7:0
  14529. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14530. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14531. * - msg_sub_type
  14532. * Bits 15:8
  14533. * Purpose: Identifies which type of rx error is reported by this message
  14534. * value: htt_rx_ofld_pkt_err_type
  14535. * - vdev_id
  14536. * Bits 23:16
  14537. * Purpose: Identifies which vdev received the erroneous rx frame
  14538. * value:
  14539. * - tid
  14540. * Bits 31:24
  14541. * Purpose: Identifies the traffic type of the rx frame
  14542. * value:
  14543. *
  14544. * - The payload fields used if the sub-type == MIC error are shown below.
  14545. * Note - MIC err is per MSDU, while PN is per MPDU.
  14546. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14547. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14548. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14549. * instead of sending separate HTT messages for each wrong MSDU within
  14550. * the MPDU.
  14551. *
  14552. * |31 24|23 16|15 8|7 0|
  14553. * |----------------+----------------+----------------+----------------|
  14554. * | Rsvd | key_id | peer_id |
  14555. * |-------------------------------------------------------------------|
  14556. * | receiver MAC addr 31:0 |
  14557. * |-------------------------------------------------------------------|
  14558. * | Rsvd | receiver MAC addr 47:32 |
  14559. * |-------------------------------------------------------------------|
  14560. * | transmitter MAC addr 31:0 |
  14561. * |-------------------------------------------------------------------|
  14562. * | Rsvd | transmitter MAC addr 47:32 |
  14563. * |-------------------------------------------------------------------|
  14564. * | PN 31:0 |
  14565. * |-------------------------------------------------------------------|
  14566. * | Rsvd | PN 47:32 |
  14567. * |-------------------------------------------------------------------|
  14568. * - peer_id
  14569. * Bits 15:0
  14570. * Purpose: identifies which peer is frame is from
  14571. * value:
  14572. * - key_id
  14573. * Bits 23:16
  14574. * Purpose: identifies key_id of rx frame
  14575. * value:
  14576. * - RA_31_0 (receiver MAC addr 31:0)
  14577. * Bits 31:0
  14578. * Purpose: identifies by MAC address which vdev received the frame
  14579. * value: MAC address lower 4 bytes
  14580. * - RA_47_32 (receiver MAC addr 47:32)
  14581. * Bits 15:0
  14582. * Purpose: identifies by MAC address which vdev received the frame
  14583. * value: MAC address upper 2 bytes
  14584. * - TA_31_0 (transmitter MAC addr 31:0)
  14585. * Bits 31:0
  14586. * Purpose: identifies by MAC address which peer transmitted the frame
  14587. * value: MAC address lower 4 bytes
  14588. * - TA_47_32 (transmitter MAC addr 47:32)
  14589. * Bits 15:0
  14590. * Purpose: identifies by MAC address which peer transmitted the frame
  14591. * value: MAC address upper 2 bytes
  14592. * - PN_31_0
  14593. * Bits 31:0
  14594. * Purpose: Identifies pn of rx frame
  14595. * value: PN lower 4 bytes
  14596. * - PN_47_32
  14597. * Bits 15:0
  14598. * Purpose: Identifies pn of rx frame
  14599. * value:
  14600. * TKIP or CCMP: PN upper 2 bytes
  14601. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14602. */
  14603. enum htt_rx_ofld_pkt_err_type {
  14604. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14605. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14606. };
  14607. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14608. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14609. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14610. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14611. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14612. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14613. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14614. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14615. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14616. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14617. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14618. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14619. do { \
  14620. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14621. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14622. } while (0)
  14623. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14624. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14625. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14626. do { \
  14627. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14628. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14629. } while (0)
  14630. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14631. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14632. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14633. do { \
  14634. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14635. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14636. } while (0)
  14637. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14638. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14639. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14640. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14641. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14642. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14643. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14644. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14646. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14648. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14649. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14651. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14656. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14657. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14659. do { \
  14660. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14661. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14662. } while (0)
  14663. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14664. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14665. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14667. do { \
  14668. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14669. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14670. } while (0)
  14671. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14672. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14673. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14674. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14675. do { \
  14676. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14677. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14678. } while (0)
  14679. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14680. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14681. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14682. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14683. do { \
  14684. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14685. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14686. } while (0)
  14687. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14688. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14689. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14690. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14691. do { \
  14692. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14693. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14694. } while (0)
  14695. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14696. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14697. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14698. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14699. do { \
  14700. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14701. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14702. } while (0)
  14703. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14704. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14705. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14706. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14707. do { \
  14708. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14709. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14710. } while (0)
  14711. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14712. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14713. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14714. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14715. do { \
  14716. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14717. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14718. } while (0)
  14719. /**
  14720. * @brief target -> host peer rate report message
  14721. *
  14722. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14723. *
  14724. * @details
  14725. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14726. * justified rate of all the peers.
  14727. *
  14728. * |31 24|23 16|15 8|7 0|
  14729. * |----------------+----------------+----------------+----------------|
  14730. * | peer_count | | msg_type |
  14731. * |-------------------------------------------------------------------|
  14732. * : Payload (variant number of peer rate report) :
  14733. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14734. * Header fields:
  14735. * - msg_type
  14736. * Bits 7:0
  14737. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14738. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14739. * - reserved
  14740. * Bits 15:8
  14741. * Purpose:
  14742. * value:
  14743. * - peer_count
  14744. * Bits 31:16
  14745. * Purpose: Specify how many peer rate report elements are present in the payload.
  14746. * value:
  14747. *
  14748. * Payload:
  14749. * There are variant number of peer rate report follow the first 32 bits.
  14750. * The peer rate report is defined as follows.
  14751. *
  14752. * |31 20|19 16|15 0|
  14753. * |-----------------------+---------+---------------------------------|-
  14754. * | reserved | phy | peer_id | \
  14755. * |-------------------------------------------------------------------| -> report #0
  14756. * | rate | /
  14757. * |-----------------------+---------+---------------------------------|-
  14758. * | reserved | phy | peer_id | \
  14759. * |-------------------------------------------------------------------| -> report #1
  14760. * | rate | /
  14761. * |-----------------------+---------+---------------------------------|-
  14762. * | reserved | phy | peer_id | \
  14763. * |-------------------------------------------------------------------| -> report #2
  14764. * | rate | /
  14765. * |-------------------------------------------------------------------|-
  14766. * : :
  14767. * : :
  14768. * : :
  14769. * :-------------------------------------------------------------------:
  14770. *
  14771. * - peer_id
  14772. * Bits 15:0
  14773. * Purpose: identify the peer
  14774. * value:
  14775. * - phy
  14776. * Bits 19:16
  14777. * Purpose: identify which phy is in use
  14778. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14779. * Please see enum htt_peer_report_phy_type for detail.
  14780. * - reserved
  14781. * Bits 31:20
  14782. * Purpose:
  14783. * value:
  14784. * - rate
  14785. * Bits 31:0
  14786. * Purpose: represent the justified rate of the peer specified by peer_id
  14787. * value:
  14788. */
  14789. enum htt_peer_rate_report_phy_type {
  14790. HTT_PEER_RATE_REPORT_11B = 0,
  14791. HTT_PEER_RATE_REPORT_11A_G,
  14792. HTT_PEER_RATE_REPORT_11N,
  14793. HTT_PEER_RATE_REPORT_11AC,
  14794. };
  14795. #define HTT_PEER_RATE_REPORT_SIZE 8
  14796. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14797. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14798. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14799. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14800. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14801. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14802. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14803. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14804. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14805. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14806. do { \
  14807. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14808. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14809. } while (0)
  14810. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14811. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14812. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14813. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14814. do { \
  14815. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14816. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14817. } while (0)
  14818. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14819. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14820. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14821. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14822. do { \
  14823. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14824. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14825. } while (0)
  14826. /**
  14827. * @brief target -> host flow pool map message
  14828. *
  14829. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14830. *
  14831. * @details
  14832. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14833. * a flow of descriptors.
  14834. *
  14835. * This message is in TLV format and indicates the parameters to be setup a
  14836. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14837. * receive descriptors from a specified pool.
  14838. *
  14839. * The message would appear as follows:
  14840. *
  14841. * |31 24|23 16|15 8|7 0|
  14842. * |----------------+----------------+----------------+----------------|
  14843. * header | reserved | num_flows | msg_type |
  14844. * |-------------------------------------------------------------------|
  14845. * | |
  14846. * : payload :
  14847. * | |
  14848. * |-------------------------------------------------------------------|
  14849. *
  14850. * The header field is one DWORD long and is interpreted as follows:
  14851. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14852. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14853. * this message
  14854. * b'16-31 - reserved: These bits are reserved for future use
  14855. *
  14856. * Payload:
  14857. * The payload would contain multiple objects of the following structure. Each
  14858. * object represents a flow.
  14859. *
  14860. * |31 24|23 16|15 8|7 0|
  14861. * |----------------+----------------+----------------+----------------|
  14862. * header | reserved | num_flows | msg_type |
  14863. * |-------------------------------------------------------------------|
  14864. * payload0| flow_type |
  14865. * |-------------------------------------------------------------------|
  14866. * | flow_id |
  14867. * |-------------------------------------------------------------------|
  14868. * | reserved0 | flow_pool_id |
  14869. * |-------------------------------------------------------------------|
  14870. * | reserved1 | flow_pool_size |
  14871. * |-------------------------------------------------------------------|
  14872. * | reserved2 |
  14873. * |-------------------------------------------------------------------|
  14874. * payload1| flow_type |
  14875. * |-------------------------------------------------------------------|
  14876. * | flow_id |
  14877. * |-------------------------------------------------------------------|
  14878. * | reserved0 | flow_pool_id |
  14879. * |-------------------------------------------------------------------|
  14880. * | reserved1 | flow_pool_size |
  14881. * |-------------------------------------------------------------------|
  14882. * | reserved2 |
  14883. * |-------------------------------------------------------------------|
  14884. * | . |
  14885. * | . |
  14886. * | . |
  14887. * |-------------------------------------------------------------------|
  14888. *
  14889. * Each payload is 5 DWORDS long and is interpreted as follows:
  14890. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14891. * this flow is associated. It can be VDEV, peer,
  14892. * or tid (AC). Based on enum htt_flow_type.
  14893. *
  14894. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14895. * object. For flow_type vdev it is set to the
  14896. * vdevid, for peer it is peerid and for tid, it is
  14897. * tid_num.
  14898. *
  14899. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14900. * in the host for this flow
  14901. * b'16:31 - reserved0: This field in reserved for the future. In case
  14902. * we have a hierarchical implementation (HCM) of
  14903. * pools, it can be used to indicate the ID of the
  14904. * parent-pool.
  14905. *
  14906. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14907. * Descriptors for this flow will be
  14908. * allocated from this pool in the host.
  14909. * b'16:31 - reserved1: This field in reserved for the future. In case
  14910. * we have a hierarchical implementation of pools,
  14911. * it can be used to indicate the max number of
  14912. * descriptors in the pool. The b'0:15 can be used
  14913. * to indicate min number of descriptors in the
  14914. * HCM scheme.
  14915. *
  14916. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14917. * we have a hierarchical implementation of pools,
  14918. * b'0:15 can be used to indicate the
  14919. * priority-based borrowing (PBB) threshold of
  14920. * the flow's pool. The b'16:31 are still left
  14921. * reserved.
  14922. */
  14923. enum htt_flow_type {
  14924. FLOW_TYPE_VDEV = 0,
  14925. /* Insert new flow types above this line */
  14926. };
  14927. PREPACK struct htt_flow_pool_map_payload_t {
  14928. A_UINT32 flow_type;
  14929. A_UINT32 flow_id;
  14930. A_UINT32 flow_pool_id:16,
  14931. reserved0:16;
  14932. A_UINT32 flow_pool_size:16,
  14933. reserved1:16;
  14934. A_UINT32 reserved2;
  14935. } POSTPACK;
  14936. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14937. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14938. (sizeof(struct htt_flow_pool_map_payload_t))
  14939. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14940. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14941. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14942. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14943. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14944. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14945. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14946. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14947. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14948. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14949. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14950. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14951. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14952. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14953. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14954. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14955. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14956. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14957. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14958. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14959. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14960. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14961. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14962. do { \
  14963. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14964. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14965. } while (0)
  14966. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14967. do { \
  14968. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14969. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14970. } while (0)
  14971. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14972. do { \
  14973. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14974. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14975. } while (0)
  14976. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14977. do { \
  14978. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14979. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14980. } while (0)
  14981. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14982. do { \
  14983. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14984. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14985. } while (0)
  14986. /**
  14987. * @brief target -> host flow pool unmap message
  14988. *
  14989. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14990. *
  14991. * @details
  14992. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14993. * down a flow of descriptors.
  14994. * This message indicates that for the flow (whose ID is provided) is wanting
  14995. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14996. * pool of descriptors from where descriptors are being allocated for this
  14997. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14998. * be unmapped by the host.
  14999. *
  15000. * The message would appear as follows:
  15001. *
  15002. * |31 24|23 16|15 8|7 0|
  15003. * |----------------+----------------+----------------+----------------|
  15004. * | reserved0 | msg_type |
  15005. * |-------------------------------------------------------------------|
  15006. * | flow_type |
  15007. * |-------------------------------------------------------------------|
  15008. * | flow_id |
  15009. * |-------------------------------------------------------------------|
  15010. * | reserved1 | flow_pool_id |
  15011. * |-------------------------------------------------------------------|
  15012. *
  15013. * The message is interpreted as follows:
  15014. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  15015. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  15016. * b'8:31 - reserved0: Reserved for future use
  15017. *
  15018. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  15019. * this flow is associated. It can be VDEV, peer,
  15020. * or tid (AC). Based on enum htt_flow_type.
  15021. *
  15022. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15023. * object. For flow_type vdev it is set to the
  15024. * vdevid, for peer it is peerid and for tid, it is
  15025. * tid_num.
  15026. *
  15027. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  15028. * used in the host for this flow
  15029. * b'16:31 - reserved0: This field in reserved for the future.
  15030. *
  15031. */
  15032. PREPACK struct htt_flow_pool_unmap_t {
  15033. A_UINT32 msg_type:8,
  15034. reserved0:24;
  15035. A_UINT32 flow_type;
  15036. A_UINT32 flow_id;
  15037. A_UINT32 flow_pool_id:16,
  15038. reserved1:16;
  15039. } POSTPACK;
  15040. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  15041. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  15042. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  15043. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  15044. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  15045. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  15046. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  15047. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  15048. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  15049. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  15050. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  15051. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  15052. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  15053. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  15054. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  15055. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  15056. do { \
  15057. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  15058. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  15059. } while (0)
  15060. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  15061. do { \
  15062. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  15063. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  15064. } while (0)
  15065. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  15066. do { \
  15067. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  15068. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  15069. } while (0)
  15070. /**
  15071. * @brief target -> host SRING setup done message
  15072. *
  15073. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  15074. *
  15075. * @details
  15076. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  15077. * SRNG ring setup is done
  15078. *
  15079. * This message indicates whether the last setup operation is successful.
  15080. * It will be sent to host when host set respose_required bit in
  15081. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  15082. * The message would appear as follows:
  15083. *
  15084. * |31 24|23 16|15 8|7 0|
  15085. * |--------------- +----------------+----------------+----------------|
  15086. * | setup_status | ring_id | pdev_id | msg_type |
  15087. * |-------------------------------------------------------------------|
  15088. *
  15089. * The message is interpreted as follows:
  15090. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  15091. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  15092. * b'8:15 - pdev_id:
  15093. * 0 (for rings at SOC/UMAC level),
  15094. * 1/2/3 mac id (for rings at LMAC level)
  15095. * b'16:23 - ring_id: Identify the ring which is set up
  15096. * More details can be got from enum htt_srng_ring_id
  15097. * b'24:31 - setup_status: Indicate status of setup operation
  15098. * Refer to htt_ring_setup_status
  15099. */
  15100. PREPACK struct htt_sring_setup_done_t {
  15101. A_UINT32 msg_type: 8,
  15102. pdev_id: 8,
  15103. ring_id: 8,
  15104. setup_status: 8;
  15105. } POSTPACK;
  15106. enum htt_ring_setup_status {
  15107. htt_ring_setup_status_ok = 0,
  15108. htt_ring_setup_status_error,
  15109. };
  15110. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  15111. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  15112. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  15113. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  15114. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  15115. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  15116. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  15117. do { \
  15118. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  15119. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15120. } while (0)
  15121. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  15122. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  15123. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  15124. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  15125. HTT_SRING_SETUP_DONE_RING_ID_S)
  15126. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  15127. do { \
  15128. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  15129. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  15130. } while (0)
  15131. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  15132. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  15133. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  15134. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  15135. HTT_SRING_SETUP_DONE_STATUS_S)
  15136. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  15137. do { \
  15138. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  15139. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  15140. } while (0)
  15141. /**
  15142. * @brief target -> flow map flow info
  15143. *
  15144. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  15145. *
  15146. * @details
  15147. * HTT TX map flow entry with tqm flow pointer
  15148. * Sent from firmware to host to add tqm flow pointer in corresponding
  15149. * flow search entry. Flow metadata is replayed back to host as part of this
  15150. * struct to enable host to find the specific flow search entry
  15151. *
  15152. * The message would appear as follows:
  15153. *
  15154. * |31 28|27 18|17 14|13 8|7 0|
  15155. * |-------+------------------------------------------+----------------|
  15156. * | rsvd0 | fse_hsh_idx | msg_type |
  15157. * |-------------------------------------------------------------------|
  15158. * | rsvd1 | tid | peer_id |
  15159. * |-------------------------------------------------------------------|
  15160. * | tqm_flow_pntr_lo |
  15161. * |-------------------------------------------------------------------|
  15162. * | tqm_flow_pntr_hi |
  15163. * |-------------------------------------------------------------------|
  15164. * | fse_meta_data |
  15165. * |-------------------------------------------------------------------|
  15166. *
  15167. * The message is interpreted as follows:
  15168. *
  15169. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  15170. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  15171. *
  15172. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  15173. * for this flow entry
  15174. *
  15175. * dword0 - b'28:31 - rsvd0: Reserved for future use
  15176. *
  15177. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  15178. *
  15179. * dword1 - b'14:17 - tid
  15180. *
  15181. * dword1 - b'18:31 - rsvd1: Reserved for future use
  15182. *
  15183. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  15184. *
  15185. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  15186. *
  15187. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  15188. * given by host
  15189. */
  15190. PREPACK struct htt_tx_map_flow_info {
  15191. A_UINT32
  15192. msg_type: 8,
  15193. fse_hsh_idx: 20,
  15194. rsvd0: 4;
  15195. A_UINT32
  15196. peer_id: 14,
  15197. tid: 4,
  15198. rsvd1: 14;
  15199. A_UINT32 tqm_flow_pntr_lo;
  15200. A_UINT32 tqm_flow_pntr_hi;
  15201. struct htt_tx_flow_metadata fse_meta_data;
  15202. } POSTPACK;
  15203. /* DWORD 0 */
  15204. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  15205. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  15206. /* DWORD 1 */
  15207. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  15208. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  15209. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  15210. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  15211. /* DWORD 0 */
  15212. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  15213. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  15214. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  15215. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  15216. do { \
  15217. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  15218. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  15219. } while (0)
  15220. /* DWORD 1 */
  15221. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  15222. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  15223. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  15224. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  15225. do { \
  15226. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  15227. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  15228. } while (0)
  15229. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  15230. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  15231. HTT_TX_MAP_FLOW_INFO_TID_S)
  15232. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  15233. do { \
  15234. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  15235. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  15236. } while (0)
  15237. /*
  15238. * htt_dbg_ext_stats_status -
  15239. * present - The requested stats have been delivered in full.
  15240. * This indicates that either the stats information was contained
  15241. * in its entirety within this message, or else this message
  15242. * completes the delivery of the requested stats info that was
  15243. * partially delivered through earlier STATS_CONF messages.
  15244. * partial - The requested stats have been delivered in part.
  15245. * One or more subsequent STATS_CONF messages with the same
  15246. * cookie value will be sent to deliver the remainder of the
  15247. * information.
  15248. * error - The requested stats could not be delivered, for example due
  15249. * to a shortage of memory to construct a message holding the
  15250. * requested stats.
  15251. * invalid - The requested stat type is either not recognized, or the
  15252. * target is configured to not gather the stats type in question.
  15253. */
  15254. enum htt_dbg_ext_stats_status {
  15255. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15256. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15257. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15258. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15259. };
  15260. /**
  15261. * @brief target -> host ppdu stats upload
  15262. *
  15263. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15264. *
  15265. * @details
  15266. * The following field definitions describe the format of the HTT target
  15267. * to host ppdu stats indication message.
  15268. *
  15269. *
  15270. * |31 16|15 12|11 10|9 8|7 0 |
  15271. * |----------------------------------------------------------------------|
  15272. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15273. * |----------------------------------------------------------------------|
  15274. * | ppdu_id |
  15275. * |----------------------------------------------------------------------|
  15276. * | Timestamp in us |
  15277. * |----------------------------------------------------------------------|
  15278. * | reserved |
  15279. * |----------------------------------------------------------------------|
  15280. * | type-specific stats info |
  15281. * | (see htt_ppdu_stats.h) |
  15282. * |----------------------------------------------------------------------|
  15283. * Header fields:
  15284. * - MSG_TYPE
  15285. * Bits 7:0
  15286. * Purpose: Identifies this is a PPDU STATS indication
  15287. * message.
  15288. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15289. * - mac_id
  15290. * Bits 9:8
  15291. * Purpose: mac_id of this ppdu_id
  15292. * Value: 0-3
  15293. * - pdev_id
  15294. * Bits 11:10
  15295. * Purpose: pdev_id of this ppdu_id
  15296. * Value: 0-3
  15297. * 0 (for rings at SOC level),
  15298. * 1/2/3 PDEV -> 0/1/2
  15299. * - payload_size
  15300. * Bits 31:16
  15301. * Purpose: total tlv size
  15302. * Value: payload_size in bytes
  15303. */
  15304. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15305. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15306. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15307. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15308. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15309. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15310. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15311. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15312. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15313. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15314. do { \
  15315. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15316. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15317. } while (0)
  15318. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15319. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15320. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15321. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15322. do { \
  15323. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15324. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15325. } while (0)
  15326. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15327. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15328. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15329. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15330. do { \
  15331. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  15332. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  15333. } while (0)
  15334. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  15335. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  15336. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  15337. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  15338. do { \
  15339. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  15340. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  15341. } while (0)
  15342. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  15343. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  15344. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  15345. /* htt_t2h_ppdu_stats_ind_hdr_t
  15346. * This struct contains the fields within the header of the
  15347. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  15348. * stats info.
  15349. * This struct assumes little-endian layout, and thus is only
  15350. * suitable for use within processors known to be little-endian
  15351. * (such as the target).
  15352. * In contrast, the above macros provide endian-portable methods
  15353. * to get and set the bitfields within this PPDU_STATS_IND header.
  15354. */
  15355. typedef struct {
  15356. A_UINT32 msg_type: 8, /* bits 7:0 */
  15357. mac_id: 2, /* bits 9:8 */
  15358. pdev_id: 2, /* bits 11:10 */
  15359. reserved1: 4, /* bits 15:12 */
  15360. payload_size: 16; /* bits 31:16 */
  15361. A_UINT32 ppdu_id;
  15362. A_UINT32 timestamp_us;
  15363. A_UINT32 reserved2;
  15364. } htt_t2h_ppdu_stats_ind_hdr_t;
  15365. /**
  15366. * @brief target -> host extended statistics upload
  15367. *
  15368. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  15369. *
  15370. * @details
  15371. * The following field definitions describe the format of the HTT target
  15372. * to host stats upload confirmation message.
  15373. * The message contains a cookie echoed from the HTT host->target stats
  15374. * upload request, which identifies which request the confirmation is
  15375. * for, and a single stats can span over multiple HTT stats indication
  15376. * due to the HTT message size limitation so every HTT ext stats indication
  15377. * will have tag-length-value stats information elements.
  15378. * The tag-length header for each HTT stats IND message also includes a
  15379. * status field, to indicate whether the request for the stat type in
  15380. * question was fully met, partially met, unable to be met, or invalid
  15381. * (if the stat type in question is disabled in the target).
  15382. * A Done bit 1's indicate the end of the of stats info elements.
  15383. *
  15384. *
  15385. * |31 16|15 12|11|10 8|7 5|4 0|
  15386. * |--------------------------------------------------------------|
  15387. * | reserved | msg type |
  15388. * |--------------------------------------------------------------|
  15389. * | cookie LSBs |
  15390. * |--------------------------------------------------------------|
  15391. * | cookie MSBs |
  15392. * |--------------------------------------------------------------|
  15393. * | stats entry length | rsvd | D| S | stat type |
  15394. * |--------------------------------------------------------------|
  15395. * | type-specific stats info |
  15396. * | (see htt_stats.h) |
  15397. * |--------------------------------------------------------------|
  15398. * Header fields:
  15399. * - MSG_TYPE
  15400. * Bits 7:0
  15401. * Purpose: Identifies this is a extended statistics upload confirmation
  15402. * message.
  15403. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  15404. * - COOKIE_LSBS
  15405. * Bits 31:0
  15406. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15407. * message with its preceding host->target stats request message.
  15408. * Value: LSBs of the opaque cookie specified by the host-side requestor
  15409. * - COOKIE_MSBS
  15410. * Bits 31:0
  15411. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15412. * message with its preceding host->target stats request message.
  15413. * Value: MSBs of the opaque cookie specified by the host-side requestor
  15414. *
  15415. * Stats Information Element tag-length header fields:
  15416. * - STAT_TYPE
  15417. * Bits 7:0
  15418. * Purpose: identifies the type of statistics info held in the
  15419. * following information element
  15420. * Value: htt_dbg_ext_stats_type
  15421. * - STATUS
  15422. * Bits 10:8
  15423. * Purpose: indicate whether the requested stats are present
  15424. * Value: htt_dbg_ext_stats_status
  15425. * - DONE
  15426. * Bits 11
  15427. * Purpose:
  15428. * Indicates the completion of the stats entry, this will be the last
  15429. * stats conf HTT segment for the requested stats type.
  15430. * Value:
  15431. * 0 -> the stats retrieval is ongoing
  15432. * 1 -> the stats retrieval is complete
  15433. * - LENGTH
  15434. * Bits 31:16
  15435. * Purpose: indicate the stats information size
  15436. * Value: This field specifies the number of bytes of stats information
  15437. * that follows the element tag-length header.
  15438. * It is expected but not required that this length is a multiple of
  15439. * 4 bytes.
  15440. */
  15441. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  15442. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  15443. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  15444. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  15445. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  15446. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  15447. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  15448. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  15449. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  15450. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  15451. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  15452. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  15453. do { \
  15454. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  15455. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  15456. } while (0)
  15457. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  15458. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  15459. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  15460. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  15461. do { \
  15462. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  15463. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  15464. } while (0)
  15465. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  15466. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  15467. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  15468. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  15469. do { \
  15470. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  15471. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  15472. } while (0)
  15473. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  15474. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  15475. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  15476. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  15477. do { \
  15478. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  15479. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  15480. } while (0)
  15481. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  15482. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  15483. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  15484. /**
  15485. * @brief target -> host streaming statistics upload
  15486. *
  15487. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  15488. *
  15489. * @details
  15490. * The following field definitions describe the format of the HTT target
  15491. * to host streaming stats upload indication message.
  15492. * The host can use a STREAMING_STATS_REQ message to enable the target to
  15493. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  15494. * use the STREAMING_STATS_REQ message to halt the target's production of
  15495. * STREAMING_STATS_IND messages.
  15496. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15497. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15498. *
  15499. * |31 8|7 0|
  15500. * |--------------------------------------------------------------|
  15501. * | reserved | msg type |
  15502. * |--------------------------------------------------------------|
  15503. * | type-specific stats info |
  15504. * | (see htt_stats.h) |
  15505. * |--------------------------------------------------------------|
  15506. * Header fields:
  15507. * - MSG_TYPE
  15508. * Bits 7:0
  15509. * Purpose: Identifies this as a streaming statistics upload indication
  15510. * message.
  15511. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15512. */
  15513. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15514. typedef enum {
  15515. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15516. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15517. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15518. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15519. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15520. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15521. /* Reserved from 128 - 255 for target internal use.*/
  15522. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15523. } HTT_PEER_TYPE;
  15524. /** macro to convert MAC address from char array to HTT word format */
  15525. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15526. (phtt_mac_addr)->mac_addr31to0 = \
  15527. (((c_macaddr)[0] << 0) | \
  15528. ((c_macaddr)[1] << 8) | \
  15529. ((c_macaddr)[2] << 16) | \
  15530. ((c_macaddr)[3] << 24)); \
  15531. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15532. } while (0)
  15533. /**
  15534. * @brief target -> host monitor mac header indication message
  15535. *
  15536. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15537. *
  15538. * @details
  15539. * The following diagram shows the format of the monitor mac header message
  15540. * sent from the target to the host.
  15541. * This message is primarily sent when promiscuous rx mode is enabled.
  15542. * One message is sent per rx PPDU.
  15543. *
  15544. * |31 24|23 16|15 8|7 0|
  15545. * |-------------------------------------------------------------|
  15546. * | peer_id | reserved0 | msg_type |
  15547. * |-------------------------------------------------------------|
  15548. * | reserved1 | num_mpdu |
  15549. * |-------------------------------------------------------------|
  15550. * | struct hw_rx_desc |
  15551. * | (see wal_rx_desc.h) |
  15552. * |-------------------------------------------------------------|
  15553. * | struct ieee80211_frame_addr4 |
  15554. * | (see ieee80211_defs.h) |
  15555. * |-------------------------------------------------------------|
  15556. * | struct ieee80211_frame_addr4 |
  15557. * | (see ieee80211_defs.h) |
  15558. * |-------------------------------------------------------------|
  15559. * | ...... |
  15560. * |-------------------------------------------------------------|
  15561. *
  15562. * Header fields:
  15563. * - msg_type
  15564. * Bits 7:0
  15565. * Purpose: Identifies this is a monitor mac header indication message.
  15566. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15567. * - peer_id
  15568. * Bits 31:16
  15569. * Purpose: Software peer id given by host during association,
  15570. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15571. * for rx PPDUs received from unassociated peers.
  15572. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15573. * - num_mpdu
  15574. * Bits 15:0
  15575. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15576. * delivered within the message.
  15577. * Value: 1 to 32
  15578. * num_mpdu is limited to a maximum value of 32, due to buffer
  15579. * size limits. For PPDUs with more than 32 MPDUs, only the
  15580. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15581. * the PPDU will be provided.
  15582. */
  15583. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15584. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15585. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15586. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15587. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15588. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15589. do { \
  15590. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15591. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15592. } while (0)
  15593. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15594. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15595. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15596. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15597. do { \
  15598. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15599. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15600. } while (0)
  15601. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15602. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15603. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15604. /**
  15605. * @brief target -> host flow pool resize Message
  15606. *
  15607. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15608. *
  15609. * @details
  15610. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15611. * the flow pool associated with the specified ID is resized
  15612. *
  15613. * The message would appear as follows:
  15614. *
  15615. * |31 16|15 8|7 0|
  15616. * |---------------------------------+----------------+----------------|
  15617. * | reserved0 | Msg type |
  15618. * |-------------------------------------------------------------------|
  15619. * | flow pool new size | flow pool ID |
  15620. * |-------------------------------------------------------------------|
  15621. *
  15622. * The message is interpreted as follows:
  15623. * b'0:7 - msg_type: This will be set to 0x21
  15624. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15625. *
  15626. * b'0:15 - flow pool ID: Existing flow pool ID
  15627. *
  15628. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15629. *
  15630. */
  15631. PREPACK struct htt_flow_pool_resize_t {
  15632. A_UINT32 msg_type:8,
  15633. reserved0:24;
  15634. A_UINT32 flow_pool_id:16,
  15635. flow_pool_new_size:16;
  15636. } POSTPACK;
  15637. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15638. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15639. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15640. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15641. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15642. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15643. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15644. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15645. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15646. do { \
  15647. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15648. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15649. } while (0)
  15650. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15651. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15652. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15653. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15654. do { \
  15655. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15656. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15657. } while (0)
  15658. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15659. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15660. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15661. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15662. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15663. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15664. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15665. /*
  15666. * The read and write indices point to the data within the host buffer.
  15667. * Because the first 4 bytes of the host buffer is used for the read index and
  15668. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15669. * The read index and write index are the byte offsets from the base of the
  15670. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15671. * Refer the ASCII text picture below.
  15672. */
  15673. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15674. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15675. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15676. /*
  15677. ***************************************************************************
  15678. *
  15679. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15680. *
  15681. ***************************************************************************
  15682. *
  15683. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15684. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15685. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15686. * written into the Host memory region mentioned below.
  15687. *
  15688. * Read index is updated by the Host. At any point of time, the read index will
  15689. * indicate the index that will next be read by the Host. The read index is
  15690. * in units of bytes offset from the base of the meta-data buffer.
  15691. *
  15692. * Write index is updated by the FW. At any point of time, the write index will
  15693. * indicate from where the FW can start writing any new data. The write index is
  15694. * in units of bytes offset from the base of the meta-data buffer.
  15695. *
  15696. * If the Host is not fast enough in reading the CFR data, any new capture data
  15697. * would be dropped if there is no space left to write the new captures.
  15698. *
  15699. * The last 4 bytes of the memory region will have the magic pattern
  15700. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15701. * not overrun the host buffer.
  15702. *
  15703. * ,--------------------. read and write indices store the
  15704. * | | byte offset from the base of the
  15705. * | ,--------+--------. meta-data buffer to the next
  15706. * | | | | location within the data buffer
  15707. * | | v v that will be read / written
  15708. * ************************************************************************
  15709. * * Read * Write * * Magic *
  15710. * * index * index * CFR data1 ...... CFR data N * pattern *
  15711. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15712. * ************************************************************************
  15713. * |<---------- data buffer ---------->|
  15714. *
  15715. * |<----------------- meta-data buffer allocated in Host ----------------|
  15716. *
  15717. * Note:
  15718. * - Considering the 4 bytes needed to store the Read index (R) and the
  15719. * Write index (W), the initial value is as follows:
  15720. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15721. * - Buffer empty condition:
  15722. * R = W
  15723. *
  15724. * Regarding CFR data format:
  15725. * --------------------------
  15726. *
  15727. * Each CFR tone is stored in HW as 16-bits with the following format:
  15728. * {bits[15:12], bits[11:6], bits[5:0]} =
  15729. * {unsigned exponent (4 bits),
  15730. * signed mantissa_real (6 bits),
  15731. * signed mantissa_imag (6 bits)}
  15732. *
  15733. * CFR_real = mantissa_real * 2^(exponent-5)
  15734. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15735. *
  15736. *
  15737. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15738. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15739. *
  15740. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15741. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15742. * .
  15743. * .
  15744. * .
  15745. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15746. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15747. */
  15748. /* Bandwidth of peer CFR captures */
  15749. typedef enum {
  15750. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15751. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15752. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15753. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15754. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15755. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15756. } HTT_PEER_CFR_CAPTURE_BW;
  15757. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15758. * was captured
  15759. */
  15760. typedef enum {
  15761. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15762. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15763. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15764. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15765. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15766. } HTT_PEER_CFR_CAPTURE_MODE;
  15767. typedef enum {
  15768. /* This message type is currently used for the below purpose:
  15769. *
  15770. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15771. * wmi_peer_cfr_capture_cmd.
  15772. * If payload_present bit is set to 0 then the associated memory region
  15773. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15774. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15775. * message; the CFR dump will be present at the end of the message,
  15776. * after the chan_phy_mode.
  15777. */
  15778. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15779. /* Always keep this last */
  15780. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15781. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15782. /**
  15783. * @brief target -> host CFR dump completion indication message definition
  15784. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15785. *
  15786. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15787. *
  15788. * @details
  15789. * The following diagram shows the format of the Channel Frequency Response
  15790. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15791. * the channel capture of a peer is copied by Firmware into the Host memory
  15792. *
  15793. * **************************************************************************
  15794. *
  15795. * Message format when the CFR capture message type is
  15796. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15797. *
  15798. * **************************************************************************
  15799. *
  15800. * |31 16|15 |8|7 0|
  15801. * |----------------------------------------------------------------|
  15802. * header: | reserved |P| msg_type |
  15803. * word 0 | | | |
  15804. * |----------------------------------------------------------------|
  15805. * payload: | cfr_capture_msg_type |
  15806. * word 1 | |
  15807. * |----------------------------------------------------------------|
  15808. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15809. * word 2 | | | | | | | | |
  15810. * |----------------------------------------------------------------|
  15811. * | mac_addr31to0 |
  15812. * word 3 | |
  15813. * |----------------------------------------------------------------|
  15814. * | unused / reserved | mac_addr47to32 |
  15815. * word 4 | | |
  15816. * |----------------------------------------------------------------|
  15817. * | index |
  15818. * word 5 | |
  15819. * |----------------------------------------------------------------|
  15820. * | length |
  15821. * word 6 | |
  15822. * |----------------------------------------------------------------|
  15823. * | timestamp |
  15824. * word 7 | |
  15825. * |----------------------------------------------------------------|
  15826. * | counter |
  15827. * word 8 | |
  15828. * |----------------------------------------------------------------|
  15829. * | chan_mhz |
  15830. * word 9 | |
  15831. * |----------------------------------------------------------------|
  15832. * | band_center_freq1 |
  15833. * word 10 | |
  15834. * |----------------------------------------------------------------|
  15835. * | band_center_freq2 |
  15836. * word 11 | |
  15837. * |----------------------------------------------------------------|
  15838. * | chan_phy_mode |
  15839. * word 12 | |
  15840. * |----------------------------------------------------------------|
  15841. * where,
  15842. * P - payload present bit (payload_present explained below)
  15843. * req_id - memory request id (mem_req_id explained below)
  15844. * S - status field (status explained below)
  15845. * capbw - capture bandwidth (capture_bw explained below)
  15846. * mode - mode of capture (mode explained below)
  15847. * sts - space time streams (sts_count explained below)
  15848. * chbw - channel bandwidth (channel_bw explained below)
  15849. * captype - capture type (cap_type explained below)
  15850. *
  15851. * The following field definitions describe the format of the CFR dump
  15852. * completion indication sent from the target to the host
  15853. *
  15854. * Header fields:
  15855. *
  15856. * Word 0
  15857. * - msg_type
  15858. * Bits 7:0
  15859. * Purpose: Identifies this as CFR TX completion indication
  15860. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15861. * - payload_present
  15862. * Bit 8
  15863. * Purpose: Identifies how CFR data is sent to host
  15864. * Value: 0 - If CFR Payload is written to host memory
  15865. * 1 - If CFR Payload is sent as part of HTT message
  15866. * (This is the requirement for SDIO/USB where it is
  15867. * not possible to write CFR data to host memory)
  15868. * - reserved
  15869. * Bits 31:9
  15870. * Purpose: Reserved
  15871. * Value: 0
  15872. *
  15873. * Payload fields:
  15874. *
  15875. * Word 1
  15876. * - cfr_capture_msg_type
  15877. * Bits 31:0
  15878. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15879. * to specify the format used for the remainder of the message
  15880. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15881. * (currently only MSG_TYPE_1 is defined)
  15882. *
  15883. * Word 2
  15884. * - mem_req_id
  15885. * Bits 6:0
  15886. * Purpose: Contain the mem request id of the region where the CFR capture
  15887. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15888. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15889. this value is invalid)
  15890. * - status
  15891. * Bit 7
  15892. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15893. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15894. * - capture_bw
  15895. * Bits 10:8
  15896. * Purpose: Carry the bandwidth of the CFR capture
  15897. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15898. * - mode
  15899. * Bits 13:11
  15900. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15901. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15902. * - sts_count
  15903. * Bits 16:14
  15904. * Purpose: Carry the number of space time streams
  15905. * Value: Number of space time streams
  15906. * - channel_bw
  15907. * Bits 19:17
  15908. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15909. * measurement
  15910. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15911. * - cap_type
  15912. * Bits 23:20
  15913. * Purpose: Carry the type of the capture
  15914. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15915. * - vdev_id
  15916. * Bits 31:24
  15917. * Purpose: Carry the virtual device id
  15918. * Value: vdev ID
  15919. *
  15920. * Word 3
  15921. * - mac_addr31to0
  15922. * Bits 31:0
  15923. * Purpose: Contain the bits 31:0 of the peer MAC address
  15924. * Value: Bits 31:0 of the peer MAC address
  15925. *
  15926. * Word 4
  15927. * - mac_addr47to32
  15928. * Bits 15:0
  15929. * Purpose: Contain the bits 47:32 of the peer MAC address
  15930. * Value: Bits 47:32 of the peer MAC address
  15931. *
  15932. * Word 5
  15933. * - index
  15934. * Bits 31:0
  15935. * Purpose: Contain the index at which this CFR dump was written in the Host
  15936. * allocated memory. This index is the number of bytes from the base address.
  15937. * Value: Index position
  15938. *
  15939. * Word 6
  15940. * - length
  15941. * Bits 31:0
  15942. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15943. * Value: Length of the CFR capture of the peer
  15944. *
  15945. * Word 7
  15946. * - timestamp
  15947. * Bits 31:0
  15948. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15949. * clock used for this timestamp is private to the target and not visible to
  15950. * the host i.e., Host can interpret only the relative timestamp deltas from
  15951. * one message to the next, but can't interpret the absolute timestamp from a
  15952. * single message.
  15953. * Value: Timestamp in microseconds
  15954. *
  15955. * Word 8
  15956. * - counter
  15957. * Bits 31:0
  15958. * Purpose: Carry the count of the current CFR capture from FW. This is
  15959. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15960. * in host memory)
  15961. * Value: Count of the current CFR capture
  15962. *
  15963. * Word 9
  15964. * - chan_mhz
  15965. * Bits 31:0
  15966. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15967. * Value: Primary 20 channel frequency
  15968. *
  15969. * Word 10
  15970. * - band_center_freq1
  15971. * Bits 31:0
  15972. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15973. * Value: Center frequency 1 in MHz
  15974. *
  15975. * Word 11
  15976. * - band_center_freq2
  15977. * Bits 31:0
  15978. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15979. * the VDEV
  15980. * 80plus80 mode
  15981. * Value: Center frequency 2 in MHz
  15982. *
  15983. * Word 12
  15984. * - chan_phy_mode
  15985. * Bits 31:0
  15986. * Purpose: Carry the phy mode of the channel, of the VDEV
  15987. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15988. */
  15989. PREPACK struct htt_cfr_dump_ind_type_1 {
  15990. A_UINT32 mem_req_id:7,
  15991. status:1,
  15992. capture_bw:3,
  15993. mode:3,
  15994. sts_count:3,
  15995. channel_bw:3,
  15996. cap_type:4,
  15997. vdev_id:8;
  15998. htt_mac_addr addr;
  15999. A_UINT32 index;
  16000. A_UINT32 length;
  16001. A_UINT32 timestamp;
  16002. A_UINT32 counter;
  16003. struct htt_chan_change_msg chan;
  16004. } POSTPACK;
  16005. PREPACK struct htt_cfr_dump_compl_ind {
  16006. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  16007. union {
  16008. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  16009. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  16010. /* If there is a need to change the memory layout and its associated
  16011. * HTT indication format, a new CFR capture message type can be
  16012. * introduced and added into this union.
  16013. */
  16014. };
  16015. } POSTPACK;
  16016. /*
  16017. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  16018. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16019. */
  16020. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  16021. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  16022. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  16023. do { \
  16024. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  16025. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  16026. } while(0)
  16027. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  16028. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  16029. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  16030. /*
  16031. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  16032. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16033. */
  16034. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  16035. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  16036. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  16037. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  16038. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  16039. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  16040. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  16041. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  16042. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  16043. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  16044. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  16045. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  16046. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  16047. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  16048. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  16049. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  16050. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  16051. do { \
  16052. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  16053. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  16054. } while (0)
  16055. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  16056. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  16057. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  16058. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  16059. do { \
  16060. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  16061. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  16062. } while (0)
  16063. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  16064. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  16065. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  16066. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  16067. do { \
  16068. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  16069. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  16070. } while (0)
  16071. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  16072. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  16073. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  16074. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  16075. do { \
  16076. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  16077. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  16078. } while (0)
  16079. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  16080. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  16081. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  16082. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  16083. do { \
  16084. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  16085. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  16086. } while (0)
  16087. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  16088. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  16089. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  16090. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  16091. do { \
  16092. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  16093. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  16094. } while (0)
  16095. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  16096. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  16097. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  16098. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  16099. do { \
  16100. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  16101. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  16102. } while (0)
  16103. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  16104. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  16105. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  16106. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  16107. do { \
  16108. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  16109. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  16110. } while (0)
  16111. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  16112. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  16113. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  16114. /**
  16115. * @brief target -> host peer (PPDU) stats message
  16116. *
  16117. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  16118. *
  16119. * @details
  16120. * This message is generated by FW when FW is sending stats to host
  16121. * about one or more PPDUs that the FW has transmitted to one or more peers.
  16122. * This message is sent autonomously by the target rather than upon request
  16123. * by the host.
  16124. * The following field definitions describe the format of the HTT target
  16125. * to host peer stats indication message.
  16126. *
  16127. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  16128. * or more PPDU stats records.
  16129. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  16130. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  16131. * then the message would start with the
  16132. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  16133. * below.
  16134. *
  16135. * |31 16|15|14|13 11|10 9|8|7 0|
  16136. * |-------------------------------------------------------------|
  16137. * | reserved |MSG_TYPE |
  16138. * |-------------------------------------------------------------|
  16139. * rec 0 | TLV header |
  16140. * rec 0 |-------------------------------------------------------------|
  16141. * rec 0 | ppdu successful bytes |
  16142. * rec 0 |-------------------------------------------------------------|
  16143. * rec 0 | ppdu retry bytes |
  16144. * rec 0 |-------------------------------------------------------------|
  16145. * rec 0 | ppdu failed bytes |
  16146. * rec 0 |-------------------------------------------------------------|
  16147. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  16148. * rec 0 |-------------------------------------------------------------|
  16149. * rec 0 | retried MSDUs | successful MSDUs |
  16150. * rec 0 |-------------------------------------------------------------|
  16151. * rec 0 | TX duration | failed MSDUs |
  16152. * rec 0 |-------------------------------------------------------------|
  16153. * ...
  16154. * |-------------------------------------------------------------|
  16155. * rec N | TLV header |
  16156. * rec N |-------------------------------------------------------------|
  16157. * rec N | ppdu successful bytes |
  16158. * rec N |-------------------------------------------------------------|
  16159. * rec N | ppdu retry bytes |
  16160. * rec N |-------------------------------------------------------------|
  16161. * rec N | ppdu failed bytes |
  16162. * rec N |-------------------------------------------------------------|
  16163. * rec N | peer id | S|SG| BW | BA |A|rate code|
  16164. * rec N |-------------------------------------------------------------|
  16165. * rec N | retried MSDUs | successful MSDUs |
  16166. * rec N |-------------------------------------------------------------|
  16167. * rec N | TX duration | failed MSDUs |
  16168. * rec N |-------------------------------------------------------------|
  16169. *
  16170. * where:
  16171. * A = is A-MPDU flag
  16172. * BA = block-ack failure flags
  16173. * BW = bandwidth spec
  16174. * SG = SGI enabled spec
  16175. * S = skipped rate ctrl
  16176. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  16177. *
  16178. * Header
  16179. * ------
  16180. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  16181. * dword0 - b'8:31 - reserved : Reserved for future use
  16182. *
  16183. * payload include below peer_stats information
  16184. * --------------------------------------------
  16185. * @TLV : HTT_PPDU_STATS_INFO_TLV
  16186. * @tx_success_bytes : total successful bytes in the PPDU.
  16187. * @tx_retry_bytes : total retried bytes in the PPDU.
  16188. * @tx_failed_bytes : total failed bytes in the PPDU.
  16189. * @tx_ratecode : rate code used for the PPDU.
  16190. * @is_ampdu : Indicates PPDU is AMPDU or not.
  16191. * @ba_ack_failed : BA/ACK failed for this PPDU
  16192. * b00 -> BA received
  16193. * b01 -> BA failed once
  16194. * b10 -> BA failed twice, when HW retry is enabled.
  16195. * @bw : BW
  16196. * b00 -> 20 MHz
  16197. * b01 -> 40 MHz
  16198. * b10 -> 80 MHz
  16199. * b11 -> 160 MHz (or 80+80)
  16200. * @sg : SGI enabled
  16201. * @s : skipped ratectrl
  16202. * @peer_id : peer id
  16203. * @tx_success_msdus : successful MSDUs
  16204. * @tx_retry_msdus : retried MSDUs
  16205. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  16206. * @tx_duration : Tx duration for the PPDU (microsecond units)
  16207. */
  16208. /**
  16209. * @brief target -> host backpressure event
  16210. *
  16211. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  16212. *
  16213. * @details
  16214. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  16215. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  16216. * This message will only be sent if the backpressure condition has existed
  16217. * continuously for an initial period (100 ms).
  16218. * Repeat messages with updated information will be sent after each
  16219. * subsequent period (100 ms) as long as the backpressure remains unabated.
  16220. * This message indicates the ring id along with current head and tail index
  16221. * locations (i.e. write and read indices).
  16222. * The backpressure time indicates the time in ms for which continuous
  16223. * backpressure has been observed in the ring.
  16224. *
  16225. * The message format is as follows:
  16226. *
  16227. * |31 24|23 16|15 8|7 0|
  16228. * |----------------+----------------+----------------+----------------|
  16229. * | ring_id | ring_type | pdev_id | msg_type |
  16230. * |-------------------------------------------------------------------|
  16231. * | tail_idx | head_idx |
  16232. * |-------------------------------------------------------------------|
  16233. * | backpressure_time_ms |
  16234. * |-------------------------------------------------------------------|
  16235. *
  16236. * The message is interpreted as follows:
  16237. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  16238. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  16239. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  16240. * 1, 2, 3 indicates pdev_id 0,1,2 and
  16241. * the msg is for LMAC ring.
  16242. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  16243. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  16244. * htt_backpressure_lmac_ring_id. This represents
  16245. * the ring id for which continuous backpressure
  16246. * is seen
  16247. *
  16248. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  16249. * the ring indicated by the ring_id
  16250. *
  16251. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16252. * the ring indicated by the ring id
  16253. *
  16254. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16255. * backpressure has been seen in the ring
  16256. * indicated by the ring_id.
  16257. * Units = milliseconds
  16258. */
  16259. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16260. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16261. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16262. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16263. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16264. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16265. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16266. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16267. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16268. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16269. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16270. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16271. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16272. do { \
  16273. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16274. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16275. } while (0)
  16276. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16277. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16278. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16279. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16280. do { \
  16281. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16282. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16283. } while (0)
  16284. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16285. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16286. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16287. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16288. do { \
  16289. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16290. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16291. } while (0)
  16292. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16293. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16294. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16295. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16296. do { \
  16297. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16298. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16299. } while (0)
  16300. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16301. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16302. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16303. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16304. do { \
  16305. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16306. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16307. } while (0)
  16308. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16309. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16310. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16311. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16312. do { \
  16313. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16314. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16315. } while (0)
  16316. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16317. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16318. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16319. enum htt_backpressure_ring_type {
  16320. HTT_SW_RING_TYPE_UMAC,
  16321. HTT_SW_RING_TYPE_LMAC,
  16322. HTT_SW_RING_TYPE_MAX,
  16323. };
  16324. /* Ring id for which the message is sent to host */
  16325. enum htt_backpressure_umac_ringid {
  16326. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16327. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16328. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16329. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16330. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16331. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  16332. HTT_SW_RING_IDX_REO_REO2FW_RING,
  16333. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  16334. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  16335. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  16336. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  16337. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  16338. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  16339. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  16340. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  16341. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  16342. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  16343. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  16344. HTT_SW_UMAC_RING_IDX_MAX,
  16345. };
  16346. enum htt_backpressure_lmac_ringid {
  16347. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  16348. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  16349. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  16350. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  16351. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  16352. HTT_SW_RING_IDX_RXDMA2FW_RING,
  16353. HTT_SW_RING_IDX_RXDMA2SW_RING,
  16354. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  16355. HTT_SW_RING_IDX_RXDMA2REO_RING,
  16356. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  16357. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  16358. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  16359. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  16360. HTT_SW_LMAC_RING_IDX_MAX,
  16361. };
  16362. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  16363. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  16364. pdev_id: 8,
  16365. ring_type: 8, /* htt_backpressure_ring_type */
  16366. /*
  16367. * ring_id holds an enum value from either
  16368. * htt_backpressure_umac_ringid or
  16369. * htt_backpressure_lmac_ringid, based on
  16370. * the ring_type setting.
  16371. */
  16372. ring_id: 8;
  16373. A_UINT16 head_idx;
  16374. A_UINT16 tail_idx;
  16375. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  16376. } POSTPACK;
  16377. /*
  16378. * Defines two 32 bit words that can be used by the target to indicate a per
  16379. * user RU allocation and rate information.
  16380. *
  16381. * This information is currently provided in the "sw_response_reference_ptr"
  16382. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  16383. * "rx_ppdu_end_user_stats" TLV.
  16384. *
  16385. * VALID:
  16386. * The consumer of these words must explicitly check the valid bit,
  16387. * and only attempt interpretation of any of the remaining fields if
  16388. * the valid bit is set to 1.
  16389. *
  16390. * VERSION:
  16391. * The consumer of these words must also explicitly check the version bit,
  16392. * and only use the V0 definition if the VERSION field is set to 0.
  16393. *
  16394. * Version 1 is currently undefined, with the exception of the VALID and
  16395. * VERSION fields.
  16396. *
  16397. * Version 0:
  16398. *
  16399. * The fields below are duplicated per BW.
  16400. *
  16401. * The consumer must determine which BW field to use, based on the UL OFDMA
  16402. * PPDU BW indicated by HW.
  16403. *
  16404. * RU_START: RU26 start index for the user.
  16405. * Note that this is always using the RU26 index, regardless
  16406. * of the actual RU assigned to the user
  16407. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  16408. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  16409. *
  16410. * For example, 20MHz (the value in the top row is RU_START)
  16411. *
  16412. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  16413. * RU Size 1 (52): | | | | | |
  16414. * RU Size 2 (106): | | | |
  16415. * RU Size 3 (242): | |
  16416. *
  16417. * RU_SIZE: Indicates the RU size, as defined by enum
  16418. * htt_ul_ofdma_user_info_ru_size.
  16419. *
  16420. * LDPC: LDPC enabled (if 0, BCC is used)
  16421. *
  16422. * DCM: DCM enabled
  16423. *
  16424. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  16425. * |---------------------------------+--------------------------------|
  16426. * |Ver|Valid| FW internal |
  16427. * |---------------------------------+--------------------------------|
  16428. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  16429. * |---------------------------------+--------------------------------|
  16430. */
  16431. enum htt_ul_ofdma_user_info_ru_size {
  16432. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  16433. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  16434. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  16435. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  16436. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  16437. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  16438. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  16439. };
  16440. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  16441. struct htt_ul_ofdma_user_info_v0 {
  16442. A_UINT32 word0;
  16443. A_UINT32 word1;
  16444. };
  16445. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  16446. A_UINT32 w0_fw_rsvd:30; \
  16447. A_UINT32 w0_valid:1; \
  16448. A_UINT32 w0_version:1;
  16449. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  16450. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16451. };
  16452. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  16453. A_UINT32 w1_nss:3; \
  16454. A_UINT32 w1_mcs:4; \
  16455. A_UINT32 w1_ldpc:1; \
  16456. A_UINT32 w1_dcm:1; \
  16457. A_UINT32 w1_ru_start:7; \
  16458. A_UINT32 w1_ru_size:3; \
  16459. A_UINT32 w1_trig_type:4; \
  16460. A_UINT32 w1_unused:9;
  16461. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  16462. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16463. };
  16464. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  16465. A_UINT32 w0_fw_rsvd:27; \
  16466. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  16467. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  16468. 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) */
  16469. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  16470. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16471. };
  16472. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  16473. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  16474. A_UINT32 w1_trig_type:4; \
  16475. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  16476. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  16477. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16478. };
  16479. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  16480. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  16481. union {
  16482. A_UINT32 word0;
  16483. struct {
  16484. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16485. };
  16486. };
  16487. union {
  16488. A_UINT32 word1;
  16489. struct {
  16490. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16491. };
  16492. };
  16493. } POSTPACK;
  16494. /*
  16495. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16496. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16497. * this should be picked.
  16498. */
  16499. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16500. union {
  16501. A_UINT32 word0;
  16502. struct {
  16503. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16504. };
  16505. };
  16506. union {
  16507. A_UINT32 word1;
  16508. struct {
  16509. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16510. };
  16511. };
  16512. } POSTPACK;
  16513. enum HTT_UL_OFDMA_TRIG_TYPE {
  16514. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16515. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16516. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16517. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16518. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16519. };
  16520. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16521. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16522. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16523. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16524. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16525. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16526. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16527. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16528. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16529. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16530. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16531. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16532. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16533. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16534. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16535. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16536. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16537. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16538. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16539. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16540. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16541. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16542. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16543. /*--- word 0 ---*/
  16544. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16545. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16546. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16547. do { \
  16548. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16549. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16550. } while (0)
  16551. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16552. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16553. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16554. do { \
  16555. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16556. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16557. } while (0)
  16558. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16559. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16560. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16561. do { \
  16562. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16563. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16564. } while (0)
  16565. /*--- word 1 ---*/
  16566. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16567. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16568. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16569. do { \
  16570. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16571. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16572. } while (0)
  16573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16574. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16576. do { \
  16577. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16578. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16579. } while (0)
  16580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16581. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16582. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16583. do { \
  16584. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16585. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16586. } while (0)
  16587. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16588. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16589. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16590. do { \
  16591. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16592. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16593. } while (0)
  16594. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16595. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16596. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16597. do { \
  16598. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16599. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16600. } while (0)
  16601. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16602. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16603. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16604. do { \
  16605. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16606. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16607. } while (0)
  16608. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16609. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16610. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16611. do { \
  16612. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16613. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16614. } while (0)
  16615. /**
  16616. * @brief target -> host channel calibration data message
  16617. *
  16618. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16619. *
  16620. * @brief host -> target channel calibration data message
  16621. *
  16622. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16623. *
  16624. * @details
  16625. * The following field definitions describe the format of the channel
  16626. * calibration data message sent from the target to the host when
  16627. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16628. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16629. * The message is defined as htt_chan_caldata_msg followed by a variable
  16630. * number of 32-bit character values.
  16631. *
  16632. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16633. * |------------------------------------------------------------------|
  16634. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16635. * |------------------------------------------------------------------|
  16636. * | payload size | mhz |
  16637. * |------------------------------------------------------------------|
  16638. * | center frequency 2 | center frequency 1 |
  16639. * |------------------------------------------------------------------|
  16640. * | check sum |
  16641. * |------------------------------------------------------------------|
  16642. * | payload |
  16643. * |------------------------------------------------------------------|
  16644. * message info field:
  16645. * - MSG_TYPE
  16646. * Bits 7:0
  16647. * Purpose: identifies this as a channel calibration data message
  16648. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16649. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16650. * - SUB_TYPE
  16651. * Bits 11:8
  16652. * Purpose: T2H: indicates whether target is providing chan cal data
  16653. * to the host to store, or requesting that the host
  16654. * download previously-stored data.
  16655. * H2T: indicates whether the host is providing the requested
  16656. * channel cal data, or if it is rejecting the data
  16657. * request because it does not have the requested data.
  16658. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16659. * - CHKSUM_VALID
  16660. * Bit 12
  16661. * Purpose: indicates if the checksum field is valid
  16662. * value:
  16663. * - FRAG
  16664. * Bit 19:16
  16665. * Purpose: indicates the fragment index for message
  16666. * value: 0 for first fragment, 1 for second fragment, ...
  16667. * - APPEND
  16668. * Bit 20
  16669. * Purpose: indicates if this is the last fragment
  16670. * value: 0 = final fragment, 1 = more fragments will be appended
  16671. *
  16672. * channel and payload size field
  16673. * - MHZ
  16674. * Bits 15:0
  16675. * Purpose: indicates the channel primary frequency
  16676. * Value:
  16677. * - PAYLOAD_SIZE
  16678. * Bits 31:16
  16679. * Purpose: indicates the bytes of calibration data in payload
  16680. * Value:
  16681. *
  16682. * center frequency field
  16683. * - CENTER FREQUENCY 1
  16684. * Bits 15:0
  16685. * Purpose: indicates the channel center frequency
  16686. * Value: channel center frequency, in MHz units
  16687. * - CENTER FREQUENCY 2
  16688. * Bits 31:16
  16689. * Purpose: indicates the secondary channel center frequency,
  16690. * only for 11acvht 80plus80 mode
  16691. * Value: secondary channel center frequency, in MHz units, if applicable
  16692. *
  16693. * checksum field
  16694. * - CHECK_SUM
  16695. * Bits 31:0
  16696. * Purpose: check the payload data, it is just for this fragment.
  16697. * This is intended for the target to check that the channel
  16698. * calibration data returned by the host is the unmodified data
  16699. * that was previously provided to the host by the target.
  16700. * value: checksum of fragment payload
  16701. */
  16702. PREPACK struct htt_chan_caldata_msg {
  16703. /* DWORD 0: message info */
  16704. A_UINT32
  16705. msg_type: 8,
  16706. sub_type: 4 ,
  16707. chksum_valid: 1, /** 1:valid, 0:invalid */
  16708. reserved1: 3,
  16709. frag_idx: 4, /** fragment index for calibration data */
  16710. appending: 1, /** 0: no fragment appending,
  16711. * 1: extra fragment appending */
  16712. reserved2: 11;
  16713. /* DWORD 1: channel and payload size */
  16714. A_UINT32
  16715. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16716. payload_size: 16; /** unit: bytes */
  16717. /* DWORD 2: center frequency */
  16718. A_UINT32
  16719. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16720. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16721. * valid only for 11acvht 80plus80 mode */
  16722. /* DWORD 3: check sum */
  16723. A_UINT32 chksum;
  16724. /* variable length for calibration data */
  16725. A_UINT32 payload[1/* or more */];
  16726. } POSTPACK;
  16727. /* T2H SUBTYPE */
  16728. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16729. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16730. /* H2T SUBTYPE */
  16731. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16732. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16733. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16734. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16735. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16736. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16737. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16738. do { \
  16739. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16740. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16741. } while (0)
  16742. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16743. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16744. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16745. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16746. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16747. do { \
  16748. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16749. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16750. } while (0)
  16751. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16752. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16753. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16754. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16755. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16756. do { \
  16757. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16758. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16759. } while (0)
  16760. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16761. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16762. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16763. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16764. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16765. do { \
  16766. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16767. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16768. } while (0)
  16769. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16770. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16771. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16772. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16773. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16774. do { \
  16775. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16776. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16777. } while (0)
  16778. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16779. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16780. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16781. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16782. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16783. do { \
  16784. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16785. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16786. } while (0)
  16787. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16788. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16789. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16790. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16791. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16792. do { \
  16793. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16794. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16795. } while (0)
  16796. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16797. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16798. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16799. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16800. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16801. do { \
  16802. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16803. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16804. } while (0)
  16805. /**
  16806. * @brief target -> host FSE CMEM based send
  16807. *
  16808. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16809. *
  16810. * @details
  16811. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16812. * FSE placement in CMEM is enabled.
  16813. *
  16814. * This message sends the non-secure CMEM base address.
  16815. * It will be sent to host in response to message
  16816. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16817. * The message would appear as follows:
  16818. *
  16819. * |31 24|23 16|15 8|7 0|
  16820. * |----------------+----------------+----------------+----------------|
  16821. * | reserved | num_entries | msg_type |
  16822. * |----------------+----------------+----------------+----------------|
  16823. * | base_address_lo |
  16824. * |----------------+----------------+----------------+----------------|
  16825. * | base_address_hi |
  16826. * |-------------------------------------------------------------------|
  16827. *
  16828. * The message is interpreted as follows:
  16829. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16830. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16831. * b'8:15 - number_entries: Indicated the number of entries
  16832. * programmed.
  16833. * b'16:31 - reserved.
  16834. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16835. * CMEM base address
  16836. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16837. * CMEM base address
  16838. */
  16839. PREPACK struct htt_cmem_base_send_t {
  16840. A_UINT32 msg_type: 8,
  16841. num_entries: 8,
  16842. reserved: 16;
  16843. A_UINT32 base_address_lo;
  16844. A_UINT32 base_address_hi;
  16845. } POSTPACK;
  16846. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16847. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16848. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16849. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16850. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16851. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16852. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16853. do { \
  16854. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16855. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16856. } while (0)
  16857. /**
  16858. * @brief - HTT PPDU ID format
  16859. *
  16860. * @details
  16861. * The following field definitions describe the format of the PPDU ID.
  16862. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16863. *
  16864. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16865. * +--------------------------------------------------------------------------
  16866. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16867. * +--------------------------------------------------------------------------
  16868. *
  16869. * sch id :Schedule command id
  16870. * Bits [11 : 0] : monotonically increasing counter to track the
  16871. * PPDU posted to a specific transmit queue.
  16872. *
  16873. * hwq_id: Hardware Queue ID.
  16874. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16875. *
  16876. * mac_id: MAC ID
  16877. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16878. *
  16879. * seq_idx: Sequence index.
  16880. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16881. * a particular TXOP.
  16882. *
  16883. * tqm_cmd: HWSCH/TQM flag.
  16884. * Bit [23] : Always set to 0.
  16885. *
  16886. * seq_cmd_type: Sequence command type.
  16887. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16888. * Refer to enum HTT_STATS_FTYPE for values.
  16889. */
  16890. PREPACK struct htt_ppdu_id {
  16891. A_UINT32
  16892. sch_id: 12,
  16893. hwq_id: 5,
  16894. mac_id: 2,
  16895. seq_idx: 2,
  16896. reserved1: 2,
  16897. tqm_cmd: 1,
  16898. seq_cmd_type: 6,
  16899. reserved2: 2;
  16900. } POSTPACK;
  16901. #define HTT_PPDU_ID_SCH_ID_S 0
  16902. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16903. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16904. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16905. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16906. do { \
  16907. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16908. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16909. } while (0)
  16910. #define HTT_PPDU_ID_HWQ_ID_S 12
  16911. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16912. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16913. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16914. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16915. do { \
  16916. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16917. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16918. } while (0)
  16919. #define HTT_PPDU_ID_MAC_ID_S 17
  16920. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16921. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16922. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16923. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16924. do { \
  16925. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16926. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16927. } while (0)
  16928. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16929. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16930. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16931. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16932. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16933. do { \
  16934. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16935. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16936. } while (0)
  16937. #define HTT_PPDU_ID_TQM_CMD_S 23
  16938. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16939. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16940. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16941. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16942. do { \
  16943. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16944. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16945. } while (0)
  16946. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16947. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16948. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16949. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16950. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16951. do { \
  16952. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16953. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16954. } while (0)
  16955. /**
  16956. * @brief target -> RX PEER METADATA V0 format
  16957. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16958. * message from target, and will confirm to the target which peer metadata
  16959. * version to use in the wmi_init message.
  16960. *
  16961. * The following diagram shows the format of the RX PEER METADATA.
  16962. *
  16963. * |31 24|23 16|15 8|7 0|
  16964. * |-----------------------------------------------------------------------|
  16965. * | Reserved | VDEV ID | PEER ID |
  16966. * |-----------------------------------------------------------------------|
  16967. */
  16968. PREPACK struct htt_rx_peer_metadata_v0 {
  16969. A_UINT32
  16970. peer_id: 16,
  16971. vdev_id: 8,
  16972. reserved1: 8;
  16973. } POSTPACK;
  16974. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16975. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16976. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16977. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16978. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16979. do { \
  16980. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16981. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16982. } while (0)
  16983. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16984. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16985. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16986. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16987. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16988. do { \
  16989. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16990. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16991. } while (0)
  16992. /**
  16993. * @brief target -> RX PEER METADATA V1 format
  16994. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16995. * message from target, and will confirm to the target which peer metadata
  16996. * version to use in the wmi_init message.
  16997. *
  16998. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16999. *
  17000. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  17001. * |---------------------------------------------------------------------------|
  17002. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  17003. * |---------------------------------------------------------------------------|
  17004. */
  17005. PREPACK struct htt_rx_peer_metadata_v1 {
  17006. A_UINT32
  17007. peer_id: 13,
  17008. ml_peer_valid: 1,
  17009. logical_link_id: 2,
  17010. vdev_id: 8,
  17011. lmac_id: 2,
  17012. chip_id: 3,
  17013. reserved2: 3;
  17014. } POSTPACK;
  17015. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  17016. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  17017. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  17018. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  17019. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  17020. do { \
  17021. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  17022. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  17023. } while (0)
  17024. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  17025. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  17026. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  17027. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  17028. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  17029. do { \
  17030. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  17031. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  17032. } while (0)
  17033. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  17034. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  17035. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  17036. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  17037. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  17038. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  17039. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  17040. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  17041. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  17042. do { \
  17043. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  17044. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  17045. } while (0)
  17046. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  17047. do { \
  17048. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  17049. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  17050. } while (0)
  17051. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  17052. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  17053. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  17054. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  17055. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  17056. do { \
  17057. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  17058. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  17059. } while (0)
  17060. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  17061. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  17062. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  17063. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  17064. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  17065. do { \
  17066. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  17067. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  17068. } while (0)
  17069. /*
  17070. * In some systems, the host SW wants to specify priorities between
  17071. * different MSDU / flow queues within the same peer-TID.
  17072. * The below enums are used for the host to identify to the target
  17073. * which MSDU queue's priority it wants to adjust.
  17074. */
  17075. /*
  17076. * The MSDUQ index describe index of TCL HW, where each index is
  17077. * used for queuing particular types of MSDUs.
  17078. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  17079. */
  17080. enum HTT_MSDUQ_INDEX {
  17081. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  17082. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  17083. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  17084. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  17085. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  17086. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  17087. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  17088. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  17089. HTT_MSDUQ_MAX_INDEX,
  17090. };
  17091. /* MSDU qtype definition */
  17092. enum HTT_MSDU_QTYPE {
  17093. /*
  17094. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  17095. * relative priority. Instead, the relative priority of CRIT_0 versus
  17096. * CRIT_1 is controlled by the FW, through the configuration parameters
  17097. * it applies to the queues.
  17098. */
  17099. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  17100. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  17101. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  17102. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  17103. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  17104. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  17105. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  17106. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  17107. /* New MSDU_QTYPE should be added above this line */
  17108. /*
  17109. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  17110. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  17111. * any host/target message definitions. The QTYPE_MAX value can
  17112. * only be used internally within the host or within the target.
  17113. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  17114. * it must regard the unexpected value as a default qtype value,
  17115. * or ignore it.
  17116. */
  17117. HTT_MSDU_QTYPE_MAX,
  17118. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  17119. };
  17120. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  17121. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  17122. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  17123. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  17124. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  17125. };
  17126. /**
  17127. * @brief target -> host mlo timestamp offset indication
  17128. *
  17129. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17130. *
  17131. * @details
  17132. * The following field definitions describe the format of the HTT target
  17133. * to host mlo timestamp offset indication message.
  17134. *
  17135. *
  17136. * |31 16|15 12|11 10|9 8|7 0 |
  17137. * |----------------------------------------------------------------------|
  17138. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  17139. * |----------------------------------------------------------------------|
  17140. * | Sync time stamp lo in us |
  17141. * |----------------------------------------------------------------------|
  17142. * | Sync time stamp hi in us |
  17143. * |----------------------------------------------------------------------|
  17144. * | mlo time stamp offset lo in us |
  17145. * |----------------------------------------------------------------------|
  17146. * | mlo time stamp offset hi in us |
  17147. * |----------------------------------------------------------------------|
  17148. * | mlo time stamp offset clocks in clock ticks |
  17149. * |----------------------------------------------------------------------|
  17150. * |31 26|25 16|15 0 |
  17151. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  17152. * | | compensation in clks | |
  17153. * |----------------------------------------------------------------------|
  17154. * |31 22|21 0 |
  17155. * | rsvd 3 | mlo time stamp comp timer period |
  17156. * |----------------------------------------------------------------------|
  17157. * The message is interpreted as follows:
  17158. *
  17159. * dword0 - b'0:7 - msg_type: This will be set to
  17160. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17161. * value: 0x28
  17162. *
  17163. * dword0 - b'9:8 - pdev_id
  17164. *
  17165. * dword0 - b'11:10 - chip_id
  17166. *
  17167. * dword0 - b'15:12 - rsvd1: Reserved for future use
  17168. *
  17169. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  17170. *
  17171. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  17172. * which last sync interrupt was received
  17173. *
  17174. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  17175. * which last sync interrupt was received
  17176. *
  17177. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  17178. *
  17179. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  17180. *
  17181. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  17182. *
  17183. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  17184. *
  17185. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  17186. * for sub us resolution
  17187. *
  17188. * dword6 - b'31:26 - rsvd2: Reserved for future use
  17189. *
  17190. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  17191. * is applied, in us
  17192. *
  17193. * dword7 - b'31:22 - rsvd3: Reserved for future use
  17194. */
  17195. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  17196. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  17197. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  17198. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  17199. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  17200. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  17201. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  17202. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  17203. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  17204. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  17205. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  17206. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  17207. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  17208. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  17209. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  17210. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  17211. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  17212. do { \
  17213. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  17214. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  17215. } while (0)
  17216. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  17217. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  17218. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  17219. do { \
  17220. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  17221. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  17222. } while (0)
  17223. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  17224. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  17225. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  17226. do { \
  17227. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  17228. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  17229. } while (0)
  17230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  17231. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  17232. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  17233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  17234. do { \
  17235. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  17236. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  17237. } while (0)
  17238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  17239. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  17240. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  17241. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  17242. do { \
  17243. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  17244. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  17245. } while (0)
  17246. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  17247. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  17248. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  17249. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  17250. do { \
  17251. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  17252. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  17253. } while (0)
  17254. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  17255. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  17256. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  17257. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  17258. do { \
  17259. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  17260. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  17261. } while (0)
  17262. typedef struct {
  17263. A_UINT32 msg_type: 8, /* bits 7:0 */
  17264. pdev_id: 2, /* bits 9:8 */
  17265. chip_id: 2, /* bits 11:10 */
  17266. reserved1: 4, /* bits 15:12 */
  17267. mac_clk_freq_mhz: 16; /* bits 31:16 */
  17268. A_UINT32 sync_timestamp_lo_us;
  17269. A_UINT32 sync_timestamp_hi_us;
  17270. A_UINT32 mlo_timestamp_offset_lo_us;
  17271. A_UINT32 mlo_timestamp_offset_hi_us;
  17272. A_UINT32 mlo_timestamp_offset_clks;
  17273. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  17274. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  17275. reserved2: 6; /* bits 31:26 */
  17276. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  17277. reserved3: 10; /* bits 31:22 */
  17278. } htt_t2h_mlo_offset_ind_t;
  17279. /*
  17280. * @brief target -> host VDEV TX RX STATS
  17281. *
  17282. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  17283. *
  17284. * @details
  17285. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  17286. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  17287. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  17288. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  17289. * periodically by target even in the absence of any further HTT request
  17290. * messages from host.
  17291. *
  17292. * The message is formatted as follows:
  17293. *
  17294. * |31 16|15 8|7 0|
  17295. * |---------------------------------+----------------+----------------|
  17296. * | payload_size | pdev_id | msg_type |
  17297. * |---------------------------------+----------------+----------------|
  17298. * | reserved0 |
  17299. * |-------------------------------------------------------------------|
  17300. * | reserved1 |
  17301. * |-------------------------------------------------------------------|
  17302. * | reserved2 |
  17303. * |-------------------------------------------------------------------|
  17304. * | |
  17305. * | VDEV specific Tx Rx stats info |
  17306. * | |
  17307. * |-------------------------------------------------------------------|
  17308. *
  17309. * The message is interpreted as follows:
  17310. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  17311. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  17312. * b'8:15 - pdev_id
  17313. * b'16:31 - size in bytes of the payload that follows the 16-byte
  17314. * message header fields (msg_type through reserved2)
  17315. * dword1 - b'0:31 - reserved0.
  17316. * dword2 - b'0:31 - reserved1.
  17317. * dword3 - b'0:31 - reserved2.
  17318. */
  17319. typedef struct {
  17320. A_UINT32 msg_type: 8,
  17321. pdev_id: 8,
  17322. payload_size: 16;
  17323. A_UINT32 reserved0;
  17324. A_UINT32 reserved1;
  17325. A_UINT32 reserved2;
  17326. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  17327. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  17328. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  17329. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  17330. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  17331. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  17332. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  17333. do { \
  17334. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  17335. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  17336. } while (0)
  17337. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  17338. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  17339. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  17340. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  17341. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  17342. do { \
  17343. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  17344. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  17345. } while (0)
  17346. /* SOC related stats */
  17347. typedef struct {
  17348. htt_tlv_hdr_t tlv_hdr;
  17349. /* When TQM is not able to find the peers during Tx, then it drops the packets
  17350. * This can be due to either the peer is deleted or deletion is ongoing
  17351. * */
  17352. A_UINT32 inv_peers_msdu_drop_count_lo;
  17353. A_UINT32 inv_peers_msdu_drop_count_hi;
  17354. } htt_t2h_soc_txrx_stats_common_tlv;
  17355. /* VDEV HW Tx/Rx stats */
  17356. typedef struct {
  17357. htt_tlv_hdr_t tlv_hdr;
  17358. A_UINT32 vdev_id;
  17359. /* Rx msdu byte cnt */
  17360. A_UINT32 rx_msdu_byte_cnt_lo;
  17361. A_UINT32 rx_msdu_byte_cnt_hi;
  17362. /* Rx msdu cnt */
  17363. A_UINT32 rx_msdu_cnt_lo;
  17364. A_UINT32 rx_msdu_cnt_hi;
  17365. /* tx msdu byte cnt */
  17366. A_UINT32 tx_msdu_byte_cnt_lo;
  17367. A_UINT32 tx_msdu_byte_cnt_hi;
  17368. /* tx msdu cnt */
  17369. A_UINT32 tx_msdu_cnt_lo;
  17370. A_UINT32 tx_msdu_cnt_hi;
  17371. /* tx excessive retry discarded msdu cnt */
  17372. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  17373. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  17374. /* TX congestion ctrl msdu drop cnt */
  17375. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  17376. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  17377. /* discarded tx msdus cnt coz of time to live expiry */
  17378. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  17379. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  17380. /* tx excessive retry discarded msdu byte cnt */
  17381. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  17382. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  17383. /* TX congestion ctrl msdu drop byte cnt */
  17384. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  17385. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  17386. /* discarded tx msdus byte cnt coz of time to live expiry */
  17387. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  17388. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  17389. /* TQM bypass frame cnt */
  17390. A_UINT32 tqm_bypass_frame_cnt_lo;
  17391. A_UINT32 tqm_bypass_frame_cnt_hi;
  17392. /* TQM bypass byte cnt */
  17393. A_UINT32 tqm_bypass_byte_cnt_lo;
  17394. A_UINT32 tqm_bypass_byte_cnt_hi;
  17395. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  17396. /*
  17397. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  17398. *
  17399. * @details
  17400. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  17401. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  17402. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  17403. * the default MSDU queues of each of the specified TIDs for the peer
  17404. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  17405. * If the default MSDU queues of a given TID within the peer are not linked
  17406. * to a service class, the svc_class_id field for that TID will have a
  17407. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  17408. * queues for that TID are not mapped to any service class.
  17409. *
  17410. * |31 16|15 8|7 0|
  17411. * |------------------------------+--------------+--------------|
  17412. * | peer ID | reserved | msg type |
  17413. * |------------------------------+--------------+------+-------|
  17414. * | reserved | svc class ID | TID |
  17415. * |------------------------------------------------------------|
  17416. * ...
  17417. * |------------------------------------------------------------|
  17418. * | reserved | svc class ID | TID |
  17419. * |------------------------------------------------------------|
  17420. * Header fields:
  17421. * dword0 - b'7:0 - msg_type: This will be set to
  17422. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  17423. * b'31:16 - peer ID
  17424. * dword1 - b'7:0 - TID
  17425. * b'15:8 - svc class ID
  17426. * (dword2, etc. same format as dword1)
  17427. */
  17428. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  17429. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  17430. A_UINT32 msg_type :8,
  17431. reserved0 :8,
  17432. peer_id :16;
  17433. struct {
  17434. A_UINT32 tid :8,
  17435. svc_class_id :8,
  17436. reserved1 :16;
  17437. } tid_reports[1/*or more*/];
  17438. } POSTPACK;
  17439. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  17440. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  17441. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  17442. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  17443. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  17444. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  17445. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  17446. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  17447. do { \
  17448. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  17449. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  17450. } while (0)
  17451. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  17452. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  17453. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  17454. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  17455. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  17456. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  17457. do { \
  17458. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  17459. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  17460. } while (0)
  17461. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  17462. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  17463. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  17464. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  17465. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  17466. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  17467. do { \
  17468. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  17469. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  17470. } while (0)
  17471. /*
  17472. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  17473. *
  17474. * @details
  17475. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  17476. * flow if the flow is seen the associated service class is conveyed to the
  17477. * target via TCL Data Command. Target on the other hand internally creates the
  17478. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  17479. * of the newly created MSDUQ and some other identifiers to uniquely identity
  17480. * the newly created MSDUQ
  17481. *
  17482. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  17483. * |------------------------------+------------------------+--------------|
  17484. * | peer ID | HTT qtype | msg type |
  17485. * |---------------------------------+--------------+--+---+-------+------|
  17486. * | reserved |AST list index|FO|WC | HLOS | remap|
  17487. * | | | | | TID | TID |
  17488. * |---------------------+------------------------------------------------|
  17489. * | reserved1 | tgt_opaque_id |
  17490. * |---------------------+------------------------------------------------|
  17491. *
  17492. * Header fields:
  17493. *
  17494. * dword0 - b'7:0 - msg_type: This will be set to
  17495. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  17496. * b'15:8 - HTT qtype
  17497. * b'31:16 - peer ID
  17498. *
  17499. * dword1 - b'3:0 - remap TID, as assigned in firmware
  17500. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  17501. * hlos_tid : Common to Lithium and Beryllium
  17502. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  17503. * TCL Data Command : Beryllium
  17504. * b10 - flow_override (FO), as sent by host in
  17505. * TCL Data Command: Beryllium
  17506. * b11:14 - ast_list_idx
  17507. * Array index into the list of extension AST entries
  17508. * (not the actual AST 16-bit index).
  17509. * The ast_list_idx is one-based, with the following
  17510. * range of values:
  17511. * - legacy targets supporting 16 user-defined
  17512. * MSDU queues: 1-2
  17513. * - legacy targets supporting 48 user-defined
  17514. * MSDU queues: 1-6
  17515. * - new targets: 0 (peer_id is used instead)
  17516. * Note that since ast_list_idx is one-based,
  17517. * the host will need to subtract 1 to use it as an
  17518. * index into a list of extension AST entries.
  17519. * b15:31 - reserved
  17520. *
  17521. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17522. * unique MSDUQ id in firmware
  17523. * b'24:31 - reserved1
  17524. */
  17525. PREPACK struct htt_t2h_sawf_msduq_event {
  17526. A_UINT32 msg_type : 8,
  17527. htt_qtype : 8,
  17528. peer_id :16;
  17529. A_UINT32 remap_tid : 4,
  17530. hlos_tid : 4,
  17531. who_classify_info_sel : 2,
  17532. flow_override : 1,
  17533. ast_list_idx : 4,
  17534. reserved :17;
  17535. A_UINT32 tgt_opaque_id :24,
  17536. reserved1 : 8;
  17537. } POSTPACK;
  17538. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17539. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17540. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17541. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17542. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17543. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17544. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17545. do { \
  17546. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17547. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17548. } while (0)
  17549. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17550. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17551. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17552. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17553. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17554. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17555. do { \
  17556. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17557. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17558. } while (0)
  17559. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17560. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17561. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17562. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17563. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17564. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17565. do { \
  17566. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17567. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17568. } while (0)
  17569. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17570. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17571. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17572. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17573. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17574. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17575. do { \
  17576. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17577. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17578. } while (0)
  17579. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17580. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17581. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17582. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17583. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17584. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17585. do { \
  17586. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17587. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17588. } while (0)
  17589. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17590. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17591. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17592. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17593. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17594. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17595. do { \
  17596. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17597. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17598. } while (0)
  17599. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17600. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17601. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17602. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17603. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17604. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17605. do { \
  17606. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17607. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17608. } while (0)
  17609. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17610. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17611. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17612. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17613. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17614. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17615. do { \
  17616. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17617. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17618. } while (0)
  17619. /**
  17620. * @brief target -> PPDU id format indication
  17621. *
  17622. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17623. *
  17624. * @details
  17625. * The following field definitions describe the format of the HTT target
  17626. * to host PPDU ID format indication message.
  17627. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17628. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17629. * seq_idx :- Sequence control index of this PPDU.
  17630. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17631. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17632. * tqm_cmd:-
  17633. *
  17634. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17635. * |--------------------------------------------------+------------------------|
  17636. * | rsvd0 | msg type |
  17637. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17638. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17639. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17640. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17641. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17642. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17643. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17644. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17645. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17646. * Where: OF = bit offset, NB = number of bits, V = valid
  17647. * The message is interpreted as follows:
  17648. *
  17649. * dword0 - b'7:0 - msg_type: This will be set to
  17650. * HTT_T2H_PPDU_ID_FMT_IND
  17651. * value: 0x30
  17652. *
  17653. * dword0 - b'31:8 - reserved
  17654. *
  17655. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17656. *
  17657. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17658. *
  17659. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17660. *
  17661. * dword1 - b'15:11 - reserved for future use
  17662. *
  17663. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17664. *
  17665. * dword1 - b'21:17 - number of bits in ring_id
  17666. *
  17667. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17668. *
  17669. * dword1 - b'31:27 - reserved for future use
  17670. *
  17671. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17672. *
  17673. * dword2 - b'5:1 - number of bits in sequence index
  17674. *
  17675. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17676. *
  17677. * dword2 - b'15:11 - reserved for future use
  17678. *
  17679. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17680. *
  17681. * dword2 - b'21:17 - number of bits in link_id
  17682. *
  17683. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17684. *
  17685. * dword2 - b'31:27 - reserved for future use
  17686. *
  17687. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17688. *
  17689. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17690. *
  17691. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17692. *
  17693. * dword3 - b'15:11 - reserved for future use
  17694. *
  17695. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17696. *
  17697. * dword3 - b'21:17 - number of bits in tqm_cmd
  17698. *
  17699. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17700. *
  17701. * dword3 - b'31:27 - reserved for future use
  17702. *
  17703. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17704. *
  17705. * dword4 - b'5:1 - number of bits in mac_id
  17706. *
  17707. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17708. *
  17709. * dword4 - b'15:11 - reserved for future use
  17710. *
  17711. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17712. *
  17713. * dword4 - b'21:17 - number of bits in crc
  17714. *
  17715. * dword4 - b'26:22 - offset of crc (in number of bits)
  17716. *
  17717. * dword4 - b'31:27 - reserved for future use
  17718. *
  17719. */
  17720. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17721. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17722. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17723. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17724. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17725. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17726. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17727. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17728. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17729. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17730. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17731. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17732. /* macros for accessing lower 16 bits in dword */
  17733. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17734. do { \
  17735. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17736. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17737. } while (0)
  17738. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17739. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17740. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17741. do { \
  17742. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17743. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17744. } while (0)
  17745. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17746. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17747. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17748. do { \
  17749. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17750. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17751. } while (0)
  17752. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17753. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17754. /* macros for accessing upper 16 bits in dword */
  17755. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17756. do { \
  17757. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17758. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17759. } while (0)
  17760. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17761. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17762. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17763. do { \
  17764. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17765. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17766. } while (0)
  17767. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17768. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17769. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17770. do { \
  17771. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17772. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17773. } while (0)
  17774. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17775. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17776. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17777. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17778. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17779. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17780. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17781. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17782. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17783. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17784. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17785. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17786. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17787. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17788. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17789. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17790. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17791. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17792. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17793. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17794. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17795. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17796. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17797. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17798. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17799. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17800. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17801. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17802. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17803. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17804. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17805. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17806. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17807. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17808. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17809. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17810. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17811. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17812. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17813. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17814. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17815. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17816. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17817. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17818. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17819. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17820. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17821. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17822. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17823. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17824. /* offsets in number dwords */
  17825. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17826. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17827. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17828. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17829. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17830. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17831. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17832. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17833. typedef struct {
  17834. A_UINT32 msg_type: 8, /* bits 7:0 */
  17835. rsvd0: 24;/* bits 31:8 */
  17836. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17837. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17838. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17839. rsvd1: 5, /* bits 15:11 */
  17840. ring_id_valid: 1, /* bits 16:16 */
  17841. ring_id_bits: 5, /* bits 21:17 */
  17842. ring_id_offset: 5, /* bits 26:22 */
  17843. rsvd2: 5; /* bits 31:27 */
  17844. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17845. seq_idx_bits: 5, /* bits 5:1 */
  17846. seq_idx_offset: 5, /* bits 10:6 */
  17847. rsvd3: 5, /* bits 15:11 */
  17848. link_id_valid: 1, /* bits 16:16 */
  17849. link_id_bits: 5, /* bits 21:17 */
  17850. link_id_offset: 5, /* bits 26:22 */
  17851. rsvd4: 5; /* bits 31:27 */
  17852. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17853. seq_cmd_type_bits: 5, /* bits 5:1 */
  17854. seq_cmd_type_offset: 5, /* bits 10:6 */
  17855. rsvd5: 5, /* bits 15:11 */
  17856. tqm_cmd_valid: 1, /* bits 16:16 */
  17857. tqm_cmd_bits: 5, /* bits 21:17 */
  17858. tqm_cmd_offset: 5, /* bits 26:12 */
  17859. rsvd6: 5; /* bits 31:27 */
  17860. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17861. mac_id_bits: 5, /* bits 5:1 */
  17862. mac_id_offset: 5, /* bits 10:6 */
  17863. rsvd8: 5, /* bits 15:11 */
  17864. crc_valid: 1, /* bits 16:16 */
  17865. crc_bits: 5, /* bits 21:17 */
  17866. crc_offset: 5, /* bits 26:12 */
  17867. rsvd9: 5; /* bits 31:27 */
  17868. } htt_t2h_ppdu_id_fmt_ind_t;
  17869. /**
  17870. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  17871. *
  17872. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  17873. *
  17874. * @details
  17875. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  17876. * when RX_CCE_SUPER_RULE setup is done
  17877. *
  17878. * This message shows the configuration results after the setup operation.
  17879. * It will always be sent to host.
  17880. * The message would appear as follows:
  17881. *
  17882. * |31 24|23 16|15 8|7 0|
  17883. * |-----------------+-----------------+----------------+----------------|
  17884. * | result | response_type | vdev_id | msg_type |
  17885. * |---------------------------------------------------------------------|
  17886. *
  17887. * The message is interpreted as follows:
  17888. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  17889. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  17890. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is setup on
  17891. * b'16:23 - response_type: Indicate the response type of this setup
  17892. * done msg
  17893. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  17894. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  17895. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  17896. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  17897. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  17898. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  17899. * b'24:31 - result: Indicate result of setup operation
  17900. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  17901. * b'24 - is_rule_enough: indicate if there are
  17902. * enough free cce rule slots
  17903. * 0: not enough
  17904. * 1: enough
  17905. * b'25:31 - avail_rule_num: indicate the number of
  17906. * remaining free cce rule slots, only makes sense
  17907. * when is_rule_enough = 0
  17908. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  17909. * b'24 - cfg_result_0: indicate the config result
  17910. * of RX_CCE_SUPER_RULE_0
  17911. * 0: Install/Uninstall fails
  17912. * 1: Install/Uninstall succeeds
  17913. * b'25 - cfg_result_1: indicate the config result
  17914. * of RX_CCE_SUPER_RULE_1
  17915. * 0: Install/Uninstall fails
  17916. * 1: Install/Uninstall succeeds
  17917. * b'26:31 - reserved
  17918. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  17919. * b'24 - cfg_result_0: indicate the config result
  17920. * of RX_CCE_SUPER_RULE_0
  17921. * 0: Release fails
  17922. * 1: Release succeeds
  17923. * b'25 - cfg_result_1: indicate the config result
  17924. * of RX_CCE_SUPER_RULE_1
  17925. * 0: Release fails
  17926. * 1: Release succeeds
  17927. * b'26:31 - reserved
  17928. */
  17929. enum htt_rx_cce_super_rule_setup_done_response_type {
  17930. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  17931. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  17932. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  17933. /*All reply type should be before this*/
  17934. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  17935. };
  17936. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  17937. A_UINT8 msg_type;
  17938. A_UINT8 vdev_id;
  17939. A_UINT8 response_type;
  17940. union {
  17941. struct {
  17942. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  17943. A_UINT8 is_rule_enough: 1,
  17944. avail_rule_num: 7;
  17945. };
  17946. struct {
  17947. /*
  17948. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  17949. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  17950. */
  17951. A_UINT8 cfg_result_0: 1,
  17952. cfg_result_1: 1,
  17953. rsvd: 6;
  17954. };
  17955. } result;
  17956. } POSTPACK;
  17957. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  17958. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M 0x0000ff00
  17959. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S 8
  17960. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_GET(_var) \
  17961. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M) >> \
  17962. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)
  17963. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_SET(_var, _val) \
  17964. do { \
  17965. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID, _val); \
  17966. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)); \
  17967. } while (0)
  17968. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  17969. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  17970. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  17971. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  17972. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  17973. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  17974. do { \
  17975. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  17976. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  17977. } while (0)
  17978. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  17979. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  17980. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  17981. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  17982. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  17983. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  17984. do { \
  17985. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  17986. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  17987. } while (0)
  17988. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  17989. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  17990. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  17991. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  17992. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  17993. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  17994. do { \
  17995. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  17996. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  17997. } while (0)
  17998. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  17999. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  18000. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  18001. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  18002. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  18003. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  18004. do { \
  18005. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  18006. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  18007. } while (0)
  18008. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  18009. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  18010. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  18011. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  18012. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  18013. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  18014. do { \
  18015. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  18016. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  18017. } while (0)
  18018. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  18019. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  18020. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  18021. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  18022. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  18023. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  18024. do { \
  18025. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  18026. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  18027. } while (0)
  18028. #endif