htt.h 977 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. * 3.113 Add add rx msdu,mpdu,ppdu fields in rx_ring_selection_cfg_t
  234. * 3.114 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET def.
  235. * 3.115 Add HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP and
  236. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE msg defs.
  237. * 3.116 Add HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE flag.
  238. * 3.117 Add HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND def.
  239. * 3.118 Add HTT_T2H_MSG_TYPE_RX_DATA_IND and _SOFT_UMAC_TX_COMPL_IND defs.
  240. */
  241. #define HTT_CURRENT_VERSION_MAJOR 3
  242. #define HTT_CURRENT_VERSION_MINOR 118
  243. #define HTT_NUM_TX_FRAG_DESC 1024
  244. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  245. #define HTT_CHECK_SET_VAL(field, val) \
  246. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  247. /* macros to assist in sign-extending fields from HTT messages */
  248. #define HTT_SIGN_BIT_MASK(field) \
  249. ((field ## _M + (1 << field ## _S)) >> 1)
  250. #define HTT_SIGN_BIT(_val, field) \
  251. (_val & HTT_SIGN_BIT_MASK(field))
  252. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  253. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  254. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  255. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  256. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  257. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  258. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  259. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  260. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  261. /*
  262. * TEMPORARY:
  263. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  264. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  265. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  266. * updated.
  267. */
  268. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  269. /*
  270. * TEMPORARY:
  271. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  272. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  273. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  274. * updated.
  275. */
  276. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  277. /**
  278. * htt_dbg_stats_type -
  279. * bit positions for each stats type within a stats type bitmask
  280. * The bitmask contains 24 bits.
  281. */
  282. enum htt_dbg_stats_type {
  283. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  284. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  285. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  286. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  287. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  288. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  289. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  290. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  291. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  292. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  293. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  294. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  295. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  296. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  297. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  298. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  299. /* bits 16-23 currently reserved */
  300. /* keep this last */
  301. HTT_DBG_NUM_STATS
  302. };
  303. /*=== HTT option selection TLVs ===
  304. * Certain HTT messages have alternatives or options.
  305. * For such cases, the host and target need to agree on which option to use.
  306. * Option specification TLVs can be appended to the VERSION_REQ and
  307. * VERSION_CONF messages to select options other than the default.
  308. * These TLVs are entirely optional - if they are not provided, there is a
  309. * well-defined default for each option. If they are provided, they can be
  310. * provided in any order. Each TLV can be present or absent independent of
  311. * the presence / absence of other TLVs.
  312. *
  313. * The HTT option selection TLVs use the following format:
  314. * |31 16|15 8|7 0|
  315. * |---------------------------------+----------------+----------------|
  316. * | value (payload) | length | tag |
  317. * |-------------------------------------------------------------------|
  318. * The value portion need not be only 2 bytes; it can be extended by any
  319. * integer number of 4-byte units. The total length of the TLV, including
  320. * the tag and length fields, must be a multiple of 4 bytes. The length
  321. * field specifies the total TLV size in 4-byte units. Thus, the typical
  322. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  323. * field, would store 0x1 in its length field, to show that the TLV occupies
  324. * a single 4-byte unit.
  325. */
  326. /*--- TLV header format - applies to all HTT option TLVs ---*/
  327. enum HTT_OPTION_TLV_TAGS {
  328. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  329. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  330. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  331. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  332. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  333. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  334. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  335. };
  336. #define HTT_TCL_METADATA_VER_SZ 4
  337. PREPACK struct htt_option_tlv_header_t {
  338. A_UINT8 tag;
  339. A_UINT8 length;
  340. } POSTPACK;
  341. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  342. #define HTT_OPTION_TLV_TAG_S 0
  343. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  344. #define HTT_OPTION_TLV_LENGTH_S 8
  345. /*
  346. * value0 - 16 bit value field stored in word0
  347. * The TLV's value field may be longer than 2 bytes, in which case
  348. * the remainder of the value is stored in word1, word2, etc.
  349. */
  350. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  351. #define HTT_OPTION_TLV_VALUE0_S 16
  352. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  353. do { \
  354. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  355. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  356. } while (0)
  357. #define HTT_OPTION_TLV_TAG_GET(word) \
  358. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  359. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  360. do { \
  361. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  362. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  363. } while (0)
  364. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  365. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  366. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  367. do { \
  368. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  369. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  370. } while (0)
  371. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  372. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  373. /*--- format of specific HTT option TLVs ---*/
  374. /*
  375. * HTT option TLV for specifying LL bus address size
  376. * Some chips require bus addresses used by the target to access buffers
  377. * within the host's memory to be 32 bits; others require bus addresses
  378. * used by the target to access buffers within the host's memory to be
  379. * 64 bits.
  380. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  381. * a suffix to the VERSION_CONF message to specify which bus address format
  382. * the target requires.
  383. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  384. * default to providing bus addresses to the target in 32-bit format.
  385. */
  386. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  387. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  388. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  389. };
  390. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  391. struct htt_option_tlv_header_t hdr;
  392. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  393. } POSTPACK;
  394. /*
  395. * HTT option TLV for specifying whether HL systems should indicate
  396. * over-the-air tx completion for individual frames, or should instead
  397. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  398. * requests an OTA tx completion for a particular tx frame.
  399. * This option does not apply to LL systems, where the TX_COMPL_IND
  400. * is mandatory.
  401. * This option is primarily intended for HL systems in which the tx frame
  402. * downloads over the host --> target bus are as slow as or slower than
  403. * the transmissions over the WLAN PHY. For cases where the bus is faster
  404. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  405. * and consequently will send one TX_COMPL_IND message that covers several
  406. * tx frames. For cases where the WLAN PHY is faster than the bus,
  407. * the target will end up transmitting very short A-MPDUs, and consequently
  408. * sending many TX_COMPL_IND messages, which each cover a very small number
  409. * of tx frames.
  410. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  411. * a suffix to the VERSION_REQ message to request whether the host desires to
  412. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  413. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  414. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  415. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  416. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  417. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  418. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  419. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  420. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  421. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  422. * TLV.
  423. */
  424. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  425. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  426. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  427. };
  428. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  429. struct htt_option_tlv_header_t hdr;
  430. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  431. } POSTPACK;
  432. /*
  433. * HTT option TLV for specifying how many tx queue groups the target
  434. * may establish.
  435. * This TLV specifies the maximum value the target may send in the
  436. * txq_group_id field of any TXQ_GROUP information elements sent by
  437. * the target to the host. This allows the host to pre-allocate an
  438. * appropriate number of tx queue group structs.
  439. *
  440. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  441. * a suffix to the VERSION_REQ message to specify whether the host supports
  442. * tx queue groups at all, and if so if there is any limit on the number of
  443. * tx queue groups that the host supports.
  444. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  445. * a suffix to the VERSION_CONF message. If the host has specified in the
  446. * VER_REQ message a limit on the number of tx queue groups the host can
  447. * support, the target shall limit its specification of the maximum tx groups
  448. * to be no larger than this host-specified limit.
  449. *
  450. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  451. * shall preallocate 4 tx queue group structs, and the target shall not
  452. * specify a txq_group_id larger than 3.
  453. */
  454. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  455. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  456. /*
  457. * values 1 through N specify the max number of tx queue groups
  458. * the sender supports
  459. */
  460. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  461. };
  462. /* TEMPORARY backwards-compatibility alias for a typo fix -
  463. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  464. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  465. * to support the old name (with the typo) until all references to the
  466. * old name are replaced with the new name.
  467. */
  468. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  469. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  470. struct htt_option_tlv_header_t hdr;
  471. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  472. } POSTPACK;
  473. /*
  474. * HTT option TLV for specifying whether the target supports an extended
  475. * version of the HTT tx descriptor. If the target provides this TLV
  476. * and specifies in the TLV that the target supports an extended version
  477. * of the HTT tx descriptor, the target must check the "extension" bit in
  478. * the HTT tx descriptor, and if the extension bit is set, to expect a
  479. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  480. * descriptor. Furthermore, the target must provide room for the HTT
  481. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  482. * This option is intended for systems where the host needs to explicitly
  483. * control the transmission parameters such as tx power for individual
  484. * tx frames.
  485. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  486. * as a suffix to the VERSION_CONF message to explicitly specify whether
  487. * the target supports the HTT tx MSDU extension descriptor.
  488. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  489. * by the host as lack of target support for the HTT tx MSDU extension
  490. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  491. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  492. * the HTT tx MSDU extension descriptor.
  493. * The host is not required to provide the HTT tx MSDU extension descriptor
  494. * just because the target supports it; the target must check the
  495. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  496. * extension descriptor is present.
  497. */
  498. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  499. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  500. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  501. };
  502. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  503. struct htt_option_tlv_header_t hdr;
  504. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  505. } POSTPACK;
  506. /*
  507. * For the tcl data command V2 and higher support added a new
  508. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  509. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  510. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  511. * HTT option TLV for specifying which version of the TCL metadata struct
  512. * should be used:
  513. * V1 -> use htt_tx_tcl_metadata struct
  514. * V2 -> use htt_tx_tcl_metadata_v2 struct
  515. * Old FW will only support V1.
  516. * New FW will support V2. New FW will still support V1, at least during
  517. * a transition period.
  518. * Similarly, old host will only support V1, and new host will support V1 + V2.
  519. *
  520. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  521. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  522. * of TCL metadata the host supports. If the host doesn't provide a
  523. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  524. * is implicitly understood that the host only supports V1.
  525. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  526. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  527. * the host shall use. The target shall only select one of the versions
  528. * supported by the host. If the target doesn't provide a
  529. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  530. * is implicitly understood that the V1 TCL metadata shall be used.
  531. */
  532. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  533. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  534. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  535. };
  536. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  537. struct htt_option_tlv_header_t hdr;
  538. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  539. } POSTPACK;
  540. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  541. HTT_OPTION_TLV_VALUE0_SET(word, value)
  542. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  543. HTT_OPTION_TLV_VALUE0_GET(word)
  544. typedef struct {
  545. union {
  546. /* BIT [11 : 0] :- tag
  547. * BIT [23 : 12] :- length
  548. * BIT [31 : 24] :- reserved
  549. */
  550. A_UINT32 tag__length;
  551. /*
  552. * The following struct is not endian-portable.
  553. * It is suitable for use within the target, which is known to be
  554. * little-endian.
  555. * The host should use the above endian-portable macros to access
  556. * the tag and length bitfields in an endian-neutral manner.
  557. */
  558. struct {
  559. A_UINT32 tag : 12, /* BIT [11 : 0] */
  560. length : 12, /* BIT [23 : 12] */
  561. reserved : 8; /* BIT [31 : 24] */
  562. };
  563. };
  564. } htt_tlv_hdr_t;
  565. /** HTT stats TLV tag values */
  566. typedef enum {
  567. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  568. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  569. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  570. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  571. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  572. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  573. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  574. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  575. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  576. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  577. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  578. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  579. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  580. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  581. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  582. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  583. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  584. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  585. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  586. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  587. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  588. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  589. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  590. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  591. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  592. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  593. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  594. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  595. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  596. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  597. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  598. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  599. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  600. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  601. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  602. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  603. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  604. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  605. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  606. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  607. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  608. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  609. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  610. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  611. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  612. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  613. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  614. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  615. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  616. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  617. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  618. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  619. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  620. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  621. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  622. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  623. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  624. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  625. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  626. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  627. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  628. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  629. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  630. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  631. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  632. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  633. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  634. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  635. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  636. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  637. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  638. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  639. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  640. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  641. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  642. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  643. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  644. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  645. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  646. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  647. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  648. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  649. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  650. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  651. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  652. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  653. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  654. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  655. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  656. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  657. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  658. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  659. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  660. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  661. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  662. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  663. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  664. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  665. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  666. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  667. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  668. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  669. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  670. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  671. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  672. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  673. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  674. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  675. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  676. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  677. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  678. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  679. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  680. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  681. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  682. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  683. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  684. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  685. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  686. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  687. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  688. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  689. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  690. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  691. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  692. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  693. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  694. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  695. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  696. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  697. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  698. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  699. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  700. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  701. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  702. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  703. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  704. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  705. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  706. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  707. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  708. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  709. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  710. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  711. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  712. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  713. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  714. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  715. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  716. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  717. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  718. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  719. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  720. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  721. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  722. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  723. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  724. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  725. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  726. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  727. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  728. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  729. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  730. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  731. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  732. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  733. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  734. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  735. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  736. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  737. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  738. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  739. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  740. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  741. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  742. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  743. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  744. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  745. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  746. HTT_STATS_UMAC_SSR_TAG = 179, /* htt_umac_ssr_stats_tlv */
  747. HTT_STATS_MAX_TAG,
  748. } htt_stats_tlv_tag_t;
  749. /* retain deprecated enum name as an alias for the current enum name */
  750. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  751. #define HTT_STATS_TLV_TAG_M 0x00000fff
  752. #define HTT_STATS_TLV_TAG_S 0
  753. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  754. #define HTT_STATS_TLV_LENGTH_S 12
  755. #define HTT_STATS_TLV_TAG_GET(_var) \
  756. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  757. HTT_STATS_TLV_TAG_S)
  758. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  759. do { \
  760. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  761. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  762. } while (0)
  763. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  764. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  765. HTT_STATS_TLV_LENGTH_S)
  766. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  767. do { \
  768. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  769. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  770. } while (0)
  771. /*=== host -> target messages ===============================================*/
  772. enum htt_h2t_msg_type {
  773. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  774. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  775. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  776. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  777. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  778. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  779. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  780. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  781. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  782. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  783. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  784. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  785. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  786. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  787. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  788. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  789. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  790. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  791. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  792. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  793. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  794. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  795. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  796. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  797. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  798. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  799. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  800. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  801. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  802. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  803. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  804. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  805. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  806. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  807. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  808. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  809. /* keep this last */
  810. HTT_H2T_NUM_MSGS
  811. };
  812. /*
  813. * HTT host to target message type -
  814. * stored in bits 7:0 of the first word of the message
  815. */
  816. #define HTT_H2T_MSG_TYPE_M 0xff
  817. #define HTT_H2T_MSG_TYPE_S 0
  818. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  819. do { \
  820. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  821. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  822. } while (0)
  823. #define HTT_H2T_MSG_TYPE_GET(word) \
  824. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  825. /**
  826. * @brief host -> target version number request message definition
  827. *
  828. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  829. *
  830. *
  831. * |31 24|23 16|15 8|7 0|
  832. * |----------------+----------------+----------------+----------------|
  833. * | reserved | msg type |
  834. * |-------------------------------------------------------------------|
  835. * : option request TLV (optional) |
  836. * :...................................................................:
  837. *
  838. * The VER_REQ message may consist of a single 4-byte word, or may be
  839. * extended with TLVs that specify which HTT options the host is requesting
  840. * from the target.
  841. * The following option TLVs may be appended to the VER_REQ message:
  842. * - HL_SUPPRESS_TX_COMPL_IND
  843. * - HL_MAX_TX_QUEUE_GROUPS
  844. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  845. * may be appended to the VER_REQ message (but only one TLV of each type).
  846. *
  847. * Header fields:
  848. * - MSG_TYPE
  849. * Bits 7:0
  850. * Purpose: identifies this as a version number request message
  851. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  852. */
  853. #define HTT_VER_REQ_BYTES 4
  854. /* TBDXXX: figure out a reasonable number */
  855. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  856. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  857. /**
  858. * @brief HTT tx MSDU descriptor
  859. *
  860. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  861. *
  862. * @details
  863. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  864. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  865. * the target firmware needs for the FW's tx processing, particularly
  866. * for creating the HW msdu descriptor.
  867. * The same HTT tx descriptor is used for HL and LL systems, though
  868. * a few fields within the tx descriptor are used only by LL or
  869. * only by HL.
  870. * The HTT tx descriptor is defined in two manners: by a struct with
  871. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  872. * definitions.
  873. * The target should use the struct def, for simplicitly and clarity,
  874. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  875. * neutral. Specifically, the host shall use the get/set macros built
  876. * around the mask + shift defs.
  877. */
  878. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  879. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  880. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  881. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  882. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  883. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  884. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  885. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  886. #define HTT_TX_VDEV_ID_WORD 0
  887. #define HTT_TX_VDEV_ID_MASK 0x3f
  888. #define HTT_TX_VDEV_ID_SHIFT 16
  889. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  890. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  891. #define HTT_TX_MSDU_LEN_DWORD 1
  892. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  893. /*
  894. * HTT_VAR_PADDR macros
  895. * Allow physical / bus addresses to be either a single 32-bit value,
  896. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  897. */
  898. #define HTT_VAR_PADDR32(var_name) \
  899. A_UINT32 var_name
  900. #define HTT_VAR_PADDR64_LE(var_name) \
  901. struct { \
  902. /* little-endian: lo precedes hi */ \
  903. A_UINT32 lo; \
  904. A_UINT32 hi; \
  905. } var_name
  906. /*
  907. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  908. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  909. * addresses are stored in a XXX-bit field.
  910. * This macro is used to define both htt_tx_msdu_desc32_t and
  911. * htt_tx_msdu_desc64_t structs.
  912. */
  913. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  914. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  915. { \
  916. /* DWORD 0: flags and meta-data */ \
  917. A_UINT32 \
  918. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  919. \
  920. /* pkt_subtype - \
  921. * Detailed specification of the tx frame contents, extending the \
  922. * general specification provided by pkt_type. \
  923. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  924. * pkt_type | pkt_subtype \
  925. * ============================================================== \
  926. * 802.3 | bit 0:3 - Reserved \
  927. * | bit 4: 0x0 - Copy-Engine Classification Results \
  928. * | not appended to the HTT message \
  929. * | 0x1 - Copy-Engine Classification Results \
  930. * | appended to the HTT message in the \
  931. * | format: \
  932. * | [HTT tx desc, frame header, \
  933. * | CE classification results] \
  934. * | The CE classification results begin \
  935. * | at the next 4-byte boundary after \
  936. * | the frame header. \
  937. * ------------+------------------------------------------------- \
  938. * Eth2 | bit 0:3 - Reserved \
  939. * | bit 4: 0x0 - Copy-Engine Classification Results \
  940. * | not appended to the HTT message \
  941. * | 0x1 - Copy-Engine Classification Results \
  942. * | appended to the HTT message. \
  943. * | See the above specification of the \
  944. * | CE classification results location. \
  945. * ------------+------------------------------------------------- \
  946. * native WiFi | bit 0:3 - Reserved \
  947. * | bit 4: 0x0 - Copy-Engine Classification Results \
  948. * | not appended to the HTT message \
  949. * | 0x1 - Copy-Engine Classification Results \
  950. * | appended to the HTT message. \
  951. * | See the above specification of the \
  952. * | CE classification results location. \
  953. * ------------+------------------------------------------------- \
  954. * mgmt | 0x0 - 802.11 MAC header absent \
  955. * | 0x1 - 802.11 MAC header present \
  956. * ------------+------------------------------------------------- \
  957. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  958. * | 0x1 - 802.11 MAC header present \
  959. * | bit 1: 0x0 - allow aggregation \
  960. * | 0x1 - don't allow aggregation \
  961. * | bit 2: 0x0 - perform encryption \
  962. * | 0x1 - don't perform encryption \
  963. * | bit 3: 0x0 - perform tx classification / queuing \
  964. * | 0x1 - don't perform tx classification; \
  965. * | insert the frame into the "misc" \
  966. * | tx queue \
  967. * | bit 4: 0x0 - Copy-Engine Classification Results \
  968. * | not appended to the HTT message \
  969. * | 0x1 - Copy-Engine Classification Results \
  970. * | appended to the HTT message. \
  971. * | See the above specification of the \
  972. * | CE classification results location. \
  973. */ \
  974. pkt_subtype: 5, \
  975. \
  976. /* pkt_type - \
  977. * General specification of the tx frame contents. \
  978. * The htt_pkt_type enum should be used to specify and check the \
  979. * value of this field. \
  980. */ \
  981. pkt_type: 3, \
  982. \
  983. /* vdev_id - \
  984. * ID for the vdev that is sending this tx frame. \
  985. * For certain non-standard packet types, e.g. pkt_type == raw \
  986. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  987. * This field is used primarily for determining where to queue \
  988. * broadcast and multicast frames. \
  989. */ \
  990. vdev_id: 6, \
  991. /* ext_tid - \
  992. * The extended traffic ID. \
  993. * If the TID is unknown, the extended TID is set to \
  994. * HTT_TX_EXT_TID_INVALID. \
  995. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  996. * value of the QoS TID. \
  997. * If the tx frame is non-QoS data, then the extended TID is set to \
  998. * HTT_TX_EXT_TID_NON_QOS. \
  999. * If the tx frame is multicast or broadcast, then the extended TID \
  1000. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  1001. */ \
  1002. ext_tid: 5, \
  1003. \
  1004. /* postponed - \
  1005. * This flag indicates whether the tx frame has been downloaded to \
  1006. * the target before but discarded by the target, and now is being \
  1007. * downloaded again; or if this is a new frame that is being \
  1008. * downloaded for the first time. \
  1009. * This flag allows the target to determine the correct order for \
  1010. * transmitting new vs. old frames. \
  1011. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1012. * This flag only applies to HL systems, since in LL systems, \
  1013. * the tx flow control is handled entirely within the target. \
  1014. */ \
  1015. postponed: 1, \
  1016. \
  1017. /* extension - \
  1018. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1019. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1020. * \
  1021. * 0x0 - no extension MSDU descriptor is present \
  1022. * 0x1 - an extension MSDU descriptor immediately follows the \
  1023. * regular MSDU descriptor \
  1024. */ \
  1025. extension: 1, \
  1026. \
  1027. /* cksum_offload - \
  1028. * This flag indicates whether checksum offload is enabled or not \
  1029. * for this frame. Target FW use this flag to turn on HW checksumming \
  1030. * 0x0 - No checksum offload \
  1031. * 0x1 - L3 header checksum only \
  1032. * 0x2 - L4 checksum only \
  1033. * 0x3 - L3 header checksum + L4 checksum \
  1034. */ \
  1035. cksum_offload: 2, \
  1036. \
  1037. /* tx_comp_req - \
  1038. * This flag indicates whether Tx Completion \
  1039. * from fw is required or not. \
  1040. * This flag is only relevant if tx completion is not \
  1041. * universally enabled. \
  1042. * For all LL systems, tx completion is mandatory, \
  1043. * so this flag will be irrelevant. \
  1044. * For HL systems tx completion is optional, but HL systems in which \
  1045. * the bus throughput exceeds the WLAN throughput will \
  1046. * probably want to always use tx completion, and thus \
  1047. * would not check this flag. \
  1048. * This flag is required when tx completions are not used universally, \
  1049. * but are still required for certain tx frames for which \
  1050. * an OTA delivery acknowledgment is needed by the host. \
  1051. * In practice, this would be for HL systems in which the \
  1052. * bus throughput is less than the WLAN throughput. \
  1053. * \
  1054. * 0x0 - Tx Completion Indication from Fw not required \
  1055. * 0x1 - Tx Completion Indication from Fw is required \
  1056. */ \
  1057. tx_compl_req: 1; \
  1058. \
  1059. \
  1060. /* DWORD 1: MSDU length and ID */ \
  1061. A_UINT32 \
  1062. len: 16, /* MSDU length, in bytes */ \
  1063. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1064. * and this id is used to calculate fragmentation \
  1065. * descriptor pointer inside the target based on \
  1066. * the base address, configured inside the target. \
  1067. */ \
  1068. \
  1069. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1070. /* frags_desc_ptr - \
  1071. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1072. * where the tx frame's fragments reside in memory. \
  1073. * This field only applies to LL systems, since in HL systems the \
  1074. * (degenerate single-fragment) fragmentation descriptor is created \
  1075. * within the target. \
  1076. */ \
  1077. _paddr__frags_desc_ptr_; \
  1078. \
  1079. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1080. /* \
  1081. * Peer ID : Target can use this value to know which peer-id packet \
  1082. * destined to. \
  1083. * It's intended to be specified by host in case of NAWDS. \
  1084. */ \
  1085. A_UINT16 peerid; \
  1086. \
  1087. /* \
  1088. * Channel frequency: This identifies the desired channel \
  1089. * frequency (in mhz) for tx frames. This is used by FW to help \
  1090. * determine when it is safe to transmit or drop frames for \
  1091. * off-channel operation. \
  1092. * The default value of zero indicates to FW that the corresponding \
  1093. * VDEV's home channel (if there is one) is the desired channel \
  1094. * frequency. \
  1095. */ \
  1096. A_UINT16 chanfreq; \
  1097. \
  1098. /* Reason reserved is commented is increasing the htt structure size \
  1099. * leads to some weird issues. \
  1100. * A_UINT32 reserved_dword3_bits0_31; \
  1101. */ \
  1102. } POSTPACK
  1103. /* define a htt_tx_msdu_desc32_t type */
  1104. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1105. /* define a htt_tx_msdu_desc64_t type */
  1106. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1107. /*
  1108. * Make htt_tx_msdu_desc_t be an alias for either
  1109. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1110. */
  1111. #if HTT_PADDR64
  1112. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1113. #else
  1114. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1115. #endif
  1116. /* decriptor information for Management frame*/
  1117. /*
  1118. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1119. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1120. */
  1121. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1122. extern A_UINT32 mgmt_hdr_len;
  1123. PREPACK struct htt_mgmt_tx_desc_t {
  1124. A_UINT32 msg_type;
  1125. #if HTT_PADDR64
  1126. A_UINT64 frag_paddr; /* DMAble address of the data */
  1127. #else
  1128. A_UINT32 frag_paddr; /* DMAble address of the data */
  1129. #endif
  1130. A_UINT32 desc_id; /* returned to host during completion
  1131. * to free the meory*/
  1132. A_UINT32 len; /* Fragment length */
  1133. A_UINT32 vdev_id; /* virtual device ID*/
  1134. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1135. } POSTPACK;
  1136. PREPACK struct htt_mgmt_tx_compl_ind {
  1137. A_UINT32 desc_id;
  1138. A_UINT32 status;
  1139. } POSTPACK;
  1140. /*
  1141. * This SDU header size comes from the summation of the following:
  1142. * 1. Max of:
  1143. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1144. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1145. * b. 802.11 header, for raw frames: 36 bytes
  1146. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1147. * QoS header, HT header)
  1148. * c. 802.3 header, for ethernet frames: 14 bytes
  1149. * (destination address, source address, ethertype / length)
  1150. * 2. Max of:
  1151. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1152. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1153. * 3. 802.1Q VLAN header: 4 bytes
  1154. * 4. LLC/SNAP header: 8 bytes
  1155. */
  1156. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1157. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1158. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1159. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1160. A_COMPILE_TIME_ASSERT(
  1161. htt_encap_hdr_size_max_check_nwifi,
  1162. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1163. A_COMPILE_TIME_ASSERT(
  1164. htt_encap_hdr_size_max_check_enet,
  1165. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1166. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1167. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1168. #define HTT_TX_HDR_SIZE_802_1Q 4
  1169. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1170. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1171. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1172. HTT_TX_HDR_SIZE_802_1Q + \
  1173. HTT_TX_HDR_SIZE_LLC_SNAP)
  1174. #define HTT_HL_TX_FRM_HDR_LEN \
  1175. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1176. #define HTT_LL_TX_FRM_HDR_LEN \
  1177. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1178. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1179. /* dword 0 */
  1180. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1181. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1182. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1183. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1184. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1185. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1186. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1187. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1188. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1189. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1190. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1191. #define HTT_TX_DESC_PKT_TYPE_S 13
  1192. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1193. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1194. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1195. #define HTT_TX_DESC_VDEV_ID_S 16
  1196. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1197. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1198. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1199. #define HTT_TX_DESC_EXT_TID_S 22
  1200. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1201. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1202. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1203. #define HTT_TX_DESC_POSTPONED_S 27
  1204. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1205. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1206. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1207. #define HTT_TX_DESC_EXTENSION_S 28
  1208. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1209. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1210. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1211. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1212. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1213. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1214. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1215. #define HTT_TX_DESC_TX_COMP_S 31
  1216. /* dword 1 */
  1217. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1218. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1219. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1220. #define HTT_TX_DESC_FRM_LEN_S 0
  1221. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1222. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1223. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1224. #define HTT_TX_DESC_FRM_ID_S 16
  1225. /* dword 2 */
  1226. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1227. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1228. /* for systems using 64-bit format for bus addresses */
  1229. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1230. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1231. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1232. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1233. /* for systems using 32-bit format for bus addresses */
  1234. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1235. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1236. /* dword 3 */
  1237. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1238. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1239. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1240. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1241. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1242. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1243. #if HTT_PADDR64
  1244. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1245. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1246. #else
  1247. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1248. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1249. #endif
  1250. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1251. #define HTT_TX_DESC_PEER_ID_S 0
  1252. /*
  1253. * TEMPORARY:
  1254. * The original definitions for the PEER_ID fields contained typos
  1255. * (with _DESC_PADDR appended to this PEER_ID field name).
  1256. * Retain deprecated original names for PEER_ID fields until all code that
  1257. * refers to them has been updated.
  1258. */
  1259. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1260. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1261. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1262. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1263. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1264. HTT_TX_DESC_PEER_ID_M
  1265. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1266. HTT_TX_DESC_PEER_ID_S
  1267. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1268. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1269. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1270. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1271. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1272. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1273. #if HTT_PADDR64
  1274. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1275. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1276. #else
  1277. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1278. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1279. #endif
  1280. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1281. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1282. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1283. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1284. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1288. } while (0)
  1289. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1290. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1291. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1295. } while (0)
  1296. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1297. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1298. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1302. } while (0)
  1303. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1304. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1305. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1306. do { \
  1307. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1308. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1309. } while (0)
  1310. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1311. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1312. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1313. do { \
  1314. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1315. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1316. } while (0)
  1317. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1318. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1319. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1323. } while (0)
  1324. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1325. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1326. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1330. } while (0)
  1331. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1332. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1333. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1336. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1337. } while (0)
  1338. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1339. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1340. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1344. } while (0)
  1345. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1346. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1347. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1348. do { \
  1349. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1350. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1351. } while (0)
  1352. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1353. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1354. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1355. do { \
  1356. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1357. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1358. } while (0)
  1359. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1360. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1361. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1362. do { \
  1363. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1364. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1365. } while (0)
  1366. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1367. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1368. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1369. do { \
  1370. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1371. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1372. } while (0)
  1373. /* enums used in the HTT tx MSDU extension descriptor */
  1374. enum {
  1375. htt_tx_guard_interval_regular = 0,
  1376. htt_tx_guard_interval_short = 1,
  1377. };
  1378. enum {
  1379. htt_tx_preamble_type_ofdm = 0,
  1380. htt_tx_preamble_type_cck = 1,
  1381. htt_tx_preamble_type_ht = 2,
  1382. htt_tx_preamble_type_vht = 3,
  1383. };
  1384. enum {
  1385. htt_tx_bandwidth_5MHz = 0,
  1386. htt_tx_bandwidth_10MHz = 1,
  1387. htt_tx_bandwidth_20MHz = 2,
  1388. htt_tx_bandwidth_40MHz = 3,
  1389. htt_tx_bandwidth_80MHz = 4,
  1390. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1391. };
  1392. /**
  1393. * @brief HTT tx MSDU extension descriptor
  1394. * @details
  1395. * If the target supports HTT tx MSDU extension descriptors, the host has
  1396. * the option of appending the following struct following the regular
  1397. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1398. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1399. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1400. * tx specs for each frame.
  1401. */
  1402. PREPACK struct htt_tx_msdu_desc_ext_t {
  1403. /* DWORD 0: flags */
  1404. A_UINT32
  1405. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1406. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1407. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1408. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1409. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1410. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1411. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1412. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1413. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1414. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1415. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1416. /* DWORD 1: tx power, tx rate, tx BW */
  1417. A_UINT32
  1418. /* pwr -
  1419. * Specify what power the tx frame needs to be transmitted at.
  1420. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1421. * The value needs to be appropriately sign-extended when extracting
  1422. * the value from the message and storing it in a variable that is
  1423. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1424. * automatically handles this sign-extension.)
  1425. * If the transmission uses multiple tx chains, this power spec is
  1426. * the total transmit power, assuming incoherent combination of
  1427. * per-chain power to produce the total power.
  1428. */
  1429. pwr: 8,
  1430. /* mcs_mask -
  1431. * Specify the allowable values for MCS index (modulation and coding)
  1432. * to use for transmitting the frame.
  1433. *
  1434. * For HT / VHT preamble types, this mask directly corresponds to
  1435. * the HT or VHT MCS indices that are allowed. For each bit N set
  1436. * within the mask, MCS index N is allowed for transmitting the frame.
  1437. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1438. * rates versus OFDM rates, so the host has the option of specifying
  1439. * that the target must transmit the frame with CCK or OFDM rates
  1440. * (not HT or VHT), but leaving the decision to the target whether
  1441. * to use CCK or OFDM.
  1442. *
  1443. * For CCK and OFDM, the bits within this mask are interpreted as
  1444. * follows:
  1445. * bit 0 -> CCK 1 Mbps rate is allowed
  1446. * bit 1 -> CCK 2 Mbps rate is allowed
  1447. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1448. * bit 3 -> CCK 11 Mbps rate is allowed
  1449. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1450. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1451. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1452. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1453. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1454. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1455. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1456. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1457. *
  1458. * The MCS index specification needs to be compatible with the
  1459. * bandwidth mask specification. For example, a MCS index == 9
  1460. * specification is inconsistent with a preamble type == VHT,
  1461. * Nss == 1, and channel bandwidth == 20 MHz.
  1462. *
  1463. * Furthermore, the host has only a limited ability to specify to
  1464. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1465. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1466. */
  1467. mcs_mask: 12,
  1468. /* nss_mask -
  1469. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1470. * Each bit in this mask corresponds to a Nss value:
  1471. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1472. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1473. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1474. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1475. * The values in the Nss mask must be suitable for the recipient, e.g.
  1476. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1477. * recipient which only supports 2x2 MIMO.
  1478. */
  1479. nss_mask: 4,
  1480. /* guard_interval -
  1481. * Specify a htt_tx_guard_interval enum value to indicate whether
  1482. * the transmission should use a regular guard interval or a
  1483. * short guard interval.
  1484. */
  1485. guard_interval: 1,
  1486. /* preamble_type_mask -
  1487. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1488. * may choose from for transmitting this frame.
  1489. * The bits in this mask correspond to the values in the
  1490. * htt_tx_preamble_type enum. For example, to allow the target
  1491. * to transmit the frame as either CCK or OFDM, this field would
  1492. * be set to
  1493. * (1 << htt_tx_preamble_type_ofdm) |
  1494. * (1 << htt_tx_preamble_type_cck)
  1495. */
  1496. preamble_type_mask: 4,
  1497. reserved1_31_29: 3; /* unused, set to 0x0 */
  1498. /* DWORD 2: tx chain mask, tx retries */
  1499. A_UINT32
  1500. /* chain_mask - specify which chains to transmit from */
  1501. chain_mask: 4,
  1502. /* retry_limit -
  1503. * Specify the maximum number of transmissions, including the
  1504. * initial transmission, to attempt before giving up if no ack
  1505. * is received.
  1506. * If the tx rate is specified, then all retries shall use the
  1507. * same rate as the initial transmission.
  1508. * If no tx rate is specified, the target can choose whether to
  1509. * retain the original rate during the retransmissions, or to
  1510. * fall back to a more robust rate.
  1511. */
  1512. retry_limit: 4,
  1513. /* bandwidth_mask -
  1514. * Specify what channel widths may be used for the transmission.
  1515. * A value of zero indicates "don't care" - the target may choose
  1516. * the transmission bandwidth.
  1517. * The bits within this mask correspond to the htt_tx_bandwidth
  1518. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1519. * The bandwidth_mask must be consistent with the preamble_type_mask
  1520. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1521. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1522. */
  1523. bandwidth_mask: 6,
  1524. reserved2_31_14: 18; /* unused, set to 0x0 */
  1525. /* DWORD 3: tx expiry time (TSF) LSBs */
  1526. A_UINT32 expire_tsf_lo;
  1527. /* DWORD 4: tx expiry time (TSF) MSBs */
  1528. A_UINT32 expire_tsf_hi;
  1529. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1530. } POSTPACK;
  1531. /* DWORD 0 */
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1548. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1549. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1551. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1552. /* DWORD 1 */
  1553. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1554. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1555. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1556. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1557. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1558. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1559. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1560. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1561. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1562. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1563. /* DWORD 2 */
  1564. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1565. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1566. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1567. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1568. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1569. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1570. /* DWORD 0 */
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1572. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1573. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1574. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1575. do { \
  1576. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1577. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1578. } while (0)
  1579. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1580. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1581. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1582. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1583. do { \
  1584. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1585. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1586. } while (0)
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1588. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1589. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1590. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1591. do { \
  1592. HTT_CHECK_SET_VAL( \
  1593. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1594. ((_var) |= ((_val) \
  1595. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1596. } while (0)
  1597. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1598. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1599. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1600. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1601. do { \
  1602. HTT_CHECK_SET_VAL( \
  1603. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1604. ((_var) |= ((_val) \
  1605. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1606. } while (0)
  1607. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1608. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1609. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1610. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1611. do { \
  1612. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1613. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1614. } while (0)
  1615. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1616. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1617. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1618. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1619. do { \
  1620. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1621. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1622. } while (0)
  1623. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1624. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1625. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1626. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1627. do { \
  1628. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1629. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1630. } while (0)
  1631. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1633. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1634. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1637. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1638. } while (0)
  1639. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1640. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1641. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1642. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1643. do { \
  1644. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1645. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1646. } while (0)
  1647. /* DWORD 1 */
  1648. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1650. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1651. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1652. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1653. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1654. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1655. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1656. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1657. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1659. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1660. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1667. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1668. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1671. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1672. } while (0)
  1673. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1674. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1675. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1676. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1679. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1680. } while (0)
  1681. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1682. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1683. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1684. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1685. do { \
  1686. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1687. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1688. } while (0)
  1689. /* DWORD 2 */
  1690. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1691. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1692. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1693. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1694. do { \
  1695. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1696. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1697. } while (0)
  1698. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1699. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1700. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1701. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1702. do { \
  1703. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1704. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1705. } while (0)
  1706. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1707. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1708. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1709. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1710. do { \
  1711. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1712. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1713. } while (0)
  1714. typedef enum {
  1715. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1716. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1717. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1718. } htt_11ax_ltf_subtype_t;
  1719. typedef enum {
  1720. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1721. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1722. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1723. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1724. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1725. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1726. } htt_tx_ext2_preamble_type_t;
  1727. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1729. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1730. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1731. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1732. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1733. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1735. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1736. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1737. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1738. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1739. /**
  1740. * @brief HTT tx MSDU extension descriptor v2
  1741. * @details
  1742. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1743. * is received as tcl_exit_base->host_meta_info in firmware.
  1744. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1745. * are already part of tcl_exit_base.
  1746. */
  1747. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1748. /* DWORD 0: flags */
  1749. A_UINT32
  1750. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1751. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1752. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1753. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1754. valid_retries : 1, /* if set, tx retries spec is valid */
  1755. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1756. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1757. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1758. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1759. valid_key_flags : 1, /* if set, key flags is valid */
  1760. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1761. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1762. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1763. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1764. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1765. 1 = ENCRYPT,
  1766. 2 ~ 3 - Reserved */
  1767. /* retry_limit -
  1768. * Specify the maximum number of transmissions, including the
  1769. * initial transmission, to attempt before giving up if no ack
  1770. * is received.
  1771. * If the tx rate is specified, then all retries shall use the
  1772. * same rate as the initial transmission.
  1773. * If no tx rate is specified, the target can choose whether to
  1774. * retain the original rate during the retransmissions, or to
  1775. * fall back to a more robust rate.
  1776. */
  1777. retry_limit : 4,
  1778. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1779. * Valid only for 11ax preamble types HE_SU
  1780. * and HE_EXT_SU
  1781. */
  1782. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1783. * Valid only for 11ax preamble types HE_SU
  1784. * and HE_EXT_SU
  1785. */
  1786. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1787. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1788. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1789. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1790. */
  1791. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1792. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1793. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1794. * Use cases:
  1795. * Any time firmware uses TQM-BYPASS for Data
  1796. * TID, firmware expect host to set this bit.
  1797. */
  1798. /* DWORD 1: tx power, tx rate */
  1799. A_UINT32
  1800. power : 8, /* unit of the power field is 0.5 dbm
  1801. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1802. * signed value ranging from -64dbm to 63.5 dbm
  1803. */
  1804. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1805. * Setting more than one MCS isn't currently
  1806. * supported by the target (but is supported
  1807. * in the interface in case in the future
  1808. * the target supports specifications of
  1809. * a limited set of MCS values.
  1810. */
  1811. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1812. * Setting more than one Nss isn't currently
  1813. * supported by the target (but is supported
  1814. * in the interface in case in the future
  1815. * the target supports specifications of
  1816. * a limited set of Nss values.
  1817. */
  1818. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1819. update_peer_cache : 1; /* When set these custom values will be
  1820. * used for all packets, until the next
  1821. * update via this ext header.
  1822. * This is to make sure not all packets
  1823. * need to include this header.
  1824. */
  1825. /* DWORD 2: tx chain mask, tx retries */
  1826. A_UINT32
  1827. /* chain_mask - specify which chains to transmit from */
  1828. chain_mask : 8,
  1829. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1830. * TODO: Update Enum values for key_flags
  1831. */
  1832. /*
  1833. * Channel frequency: This identifies the desired channel
  1834. * frequency (in MHz) for tx frames. This is used by FW to help
  1835. * determine when it is safe to transmit or drop frames for
  1836. * off-channel operation.
  1837. * The default value of zero indicates to FW that the corresponding
  1838. * VDEV's home channel (if there is one) is the desired channel
  1839. * frequency.
  1840. */
  1841. chanfreq : 16;
  1842. /* DWORD 3: tx expiry time (TSF) LSBs */
  1843. A_UINT32 expire_tsf_lo;
  1844. /* DWORD 4: tx expiry time (TSF) MSBs */
  1845. A_UINT32 expire_tsf_hi;
  1846. /* DWORD 5: flags to control routing / processing of the MSDU */
  1847. A_UINT32
  1848. /* learning_frame
  1849. * When this flag is set, this frame will be dropped by FW
  1850. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1851. */
  1852. learning_frame : 1,
  1853. /* send_as_standalone
  1854. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1855. * i.e. with no A-MSDU or A-MPDU aggregation.
  1856. * The scope is extended to other use-cases.
  1857. */
  1858. send_as_standalone : 1,
  1859. /* is_host_opaque_valid
  1860. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1861. * with valid information.
  1862. */
  1863. is_host_opaque_valid : 1,
  1864. traffic_end_indication: 1,
  1865. rsvd0 : 28;
  1866. /* DWORD 6 : Host opaque cookie for special frames */
  1867. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1868. rsvd1 : 16;
  1869. /*
  1870. * This structure can be expanded further up to 40 bytes
  1871. * by adding further DWORDs as needed.
  1872. */
  1873. } POSTPACK;
  1874. /* DWORD 0 */
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1901. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1902. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1903. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1904. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1905. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1906. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1907. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1908. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1909. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1910. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1911. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1912. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1913. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1914. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1915. /* DWORD 1 */
  1916. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1917. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1918. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1919. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1920. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1921. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1922. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1923. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1924. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1925. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1926. /* DWORD 2 */
  1927. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1928. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1929. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1930. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1931. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1932. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1933. /* DWORD 5 */
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1937. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1940. /* DWORD 6 */
  1941. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1942. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1943. /* DWORD 0 */
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1945. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1946. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1947. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1948. do { \
  1949. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1950. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1951. } while (0)
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1953. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1954. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1955. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1956. do { \
  1957. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1958. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1959. } while (0)
  1960. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1961. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1962. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1963. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1964. do { \
  1965. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1966. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1967. } while (0)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1969. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1970. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1971. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1972. do { \
  1973. HTT_CHECK_SET_VAL( \
  1974. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1975. ((_var) |= ((_val) \
  1976. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1977. } while (0)
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1979. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1980. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1982. do { \
  1983. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1984. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1985. } while (0)
  1986. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1987. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1988. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1989. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1990. do { \
  1991. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1992. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1993. } while (0)
  1994. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1995. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1996. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1997. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1998. do { \
  1999. HTT_CHECK_SET_VAL( \
  2000. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  2001. ((_var) |= ((_val) \
  2002. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2019. } while (0)
  2020. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2021. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2022. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2023. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2027. } while (0)
  2028. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2029. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2030. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2031. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2035. } while (0)
  2036. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2037. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2038. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2039. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2043. } while (0)
  2044. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2045. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2046. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2047. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2051. } while (0)
  2052. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2053. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2054. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2055. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2058. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2059. } while (0)
  2060. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2061. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2062. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2063. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2064. do { \
  2065. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2066. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2067. } while (0)
  2068. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2069. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2070. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2071. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2074. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2075. } while (0)
  2076. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2077. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2078. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2079. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2082. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2083. } while (0)
  2084. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2085. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2086. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2087. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2091. } while (0)
  2092. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2093. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2094. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2095. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2099. } while (0)
  2100. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2101. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2102. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2103. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2104. do { \
  2105. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2106. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2107. } while (0)
  2108. /* DWORD 1 */
  2109. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2110. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2111. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2112. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2113. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2114. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2115. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2116. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2117. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2118. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2119. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2120. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2121. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2122. do { \
  2123. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2124. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2125. } while (0)
  2126. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2127. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2128. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2129. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2130. do { \
  2131. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2132. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2133. } while (0)
  2134. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2135. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2136. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2137. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2138. do { \
  2139. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2140. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2141. } while (0)
  2142. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2143. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2144. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2145. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2146. do { \
  2147. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2148. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2149. } while (0)
  2150. /* DWORD 2 */
  2151. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2152. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2153. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2154. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2157. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2158. } while (0)
  2159. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2160. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2161. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2162. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2166. } while (0)
  2167. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2168. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2169. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2170. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2174. } while (0)
  2175. /* DWORD 5 */
  2176. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2177. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2178. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2179. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2180. do { \
  2181. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2182. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2183. } while (0)
  2184. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2185. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2186. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2187. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2188. do { \
  2189. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2190. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2191. } while (0)
  2192. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2193. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2194. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2195. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2196. do { \
  2197. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2198. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2199. } while (0)
  2200. /* DWORD 6 */
  2201. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2202. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2203. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2204. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2205. do { \
  2206. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2207. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2208. } while (0)
  2209. typedef enum {
  2210. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2211. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2212. } htt_tcl_metadata_type;
  2213. /**
  2214. * @brief HTT TCL command number format
  2215. * @details
  2216. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2217. * available to firmware as tcl_exit_base->tcl_status_number.
  2218. * For regular / multicast packets host will send vdev and mac id and for
  2219. * NAWDS packets, host will send peer id.
  2220. * A_UINT32 is used to avoid endianness conversion problems.
  2221. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2222. */
  2223. typedef struct {
  2224. A_UINT32
  2225. type: 1, /* vdev_id based or peer_id based */
  2226. rsvd: 31;
  2227. } htt_tx_tcl_vdev_or_peer_t;
  2228. typedef struct {
  2229. A_UINT32
  2230. type: 1, /* vdev_id based or peer_id based */
  2231. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2232. vdev_id: 8,
  2233. pdev_id: 2,
  2234. host_inspected:1,
  2235. rsvd: 19;
  2236. } htt_tx_tcl_vdev_metadata;
  2237. typedef struct {
  2238. A_UINT32
  2239. type: 1, /* vdev_id based or peer_id based */
  2240. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2241. peer_id: 14,
  2242. rsvd: 16;
  2243. } htt_tx_tcl_peer_metadata;
  2244. PREPACK struct htt_tx_tcl_metadata {
  2245. union {
  2246. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2247. htt_tx_tcl_vdev_metadata vdev_meta;
  2248. htt_tx_tcl_peer_metadata peer_meta;
  2249. };
  2250. } POSTPACK;
  2251. /* DWORD 0 */
  2252. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2253. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2254. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2255. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2256. /* VDEV metadata */
  2257. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2258. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2259. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2260. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2261. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2262. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2263. /* PEER metadata */
  2264. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2265. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2266. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2267. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2268. HTT_TX_TCL_METADATA_TYPE_S)
  2269. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2270. do { \
  2271. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2272. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2273. } while (0)
  2274. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2275. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2276. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2277. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2281. } while (0)
  2282. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2283. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2284. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2285. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2286. do { \
  2287. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2288. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2289. } while (0)
  2290. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2291. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2292. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2293. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2294. do { \
  2295. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2296. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2297. } while (0)
  2298. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2299. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2300. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2301. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2302. do { \
  2303. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2304. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2305. } while (0)
  2306. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2307. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2308. HTT_TX_TCL_METADATA_PEER_ID_S)
  2309. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2310. do { \
  2311. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2312. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2313. } while (0)
  2314. /*------------------------------------------------------------------
  2315. * V2 Version of TCL Data Command
  2316. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2317. * MLO global_seq all flavours of TCL Data Cmd.
  2318. *-----------------------------------------------------------------*/
  2319. typedef enum {
  2320. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2321. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2322. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2323. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2324. } htt_tcl_metadata_type_v2;
  2325. /**
  2326. * @brief HTT TCL command number format
  2327. * @details
  2328. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2329. * available to firmware as tcl_exit_base->tcl_status_number.
  2330. * A_UINT32 is used to avoid endianness conversion problems.
  2331. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2332. */
  2333. typedef struct {
  2334. A_UINT32
  2335. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2336. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2337. vdev_id: 8,
  2338. pdev_id: 2,
  2339. host_inspected:1,
  2340. rsvd: 2,
  2341. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2342. } htt_tx_tcl_vdev_metadata_v2;
  2343. typedef struct {
  2344. A_UINT32
  2345. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2346. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2347. peer_id: 13,
  2348. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2349. } htt_tx_tcl_peer_metadata_v2;
  2350. typedef struct {
  2351. A_UINT32
  2352. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2353. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2354. svc_class_id: 8,
  2355. rsvd: 5,
  2356. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2357. } htt_tx_tcl_svc_class_id_metadata;
  2358. typedef struct {
  2359. A_UINT32
  2360. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2361. host_inspected: 1,
  2362. global_seq_no: 12,
  2363. rsvd: 1,
  2364. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2365. } htt_tx_tcl_global_seq_metadata;
  2366. PREPACK struct htt_tx_tcl_metadata_v2 {
  2367. union {
  2368. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2369. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2370. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2371. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2372. };
  2373. } POSTPACK;
  2374. /* DWORD 0 */
  2375. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2376. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2377. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2378. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2379. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2380. /* VDEV V2 metadata */
  2381. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2382. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2383. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2384. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2385. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2386. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2387. /* PEER V2 metadata */
  2388. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2389. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2390. /* SVC_CLASS_ID metadata */
  2391. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2392. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2393. /* Global Seq no metadata */
  2394. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2395. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2396. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2397. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2398. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2399. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2400. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2401. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2402. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2403. do { \
  2404. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2405. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2406. } while (0)
  2407. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2408. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2409. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2410. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2411. do { \
  2412. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2413. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2414. } while (0)
  2415. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2416. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2417. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2418. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2419. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2420. do { \
  2421. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2422. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2423. } while (0)
  2424. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2425. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2426. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2427. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2428. do { \
  2429. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2430. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2431. } while (0)
  2432. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2433. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2434. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2435. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2439. } while (0)
  2440. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2441. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2442. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2443. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2444. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2445. do { \
  2446. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2447. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2448. } while (0)
  2449. /*----- Get and Set V2 type field in Service Class fields ----*/
  2450. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2451. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2452. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2453. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2454. do { \
  2455. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2456. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2457. } while (0)
  2458. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2459. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2460. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2461. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2462. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2463. do { \
  2464. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2465. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2466. } while (0)
  2467. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2468. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2469. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2470. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2471. do { \
  2472. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2473. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2474. } while (0)
  2475. /*------------------------------------------------------------------
  2476. * End V2 Version of TCL Data Command
  2477. *-----------------------------------------------------------------*/
  2478. typedef enum {
  2479. HTT_TX_FW2WBM_TX_STATUS_OK,
  2480. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2481. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2482. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2483. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2484. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2485. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2486. HTT_TX_FW2WBM_TX_STATUS_MAX
  2487. } htt_tx_fw2wbm_tx_status_t;
  2488. typedef enum {
  2489. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2490. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2491. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2492. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2493. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2494. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2495. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2496. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2497. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2498. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2499. } htt_tx_fw2wbm_reinject_reason_t;
  2500. /**
  2501. * @brief HTT TX WBM Completion from firmware to host
  2502. * @details
  2503. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2504. * DWORD 3 and 4 for software based completions (Exception frames and
  2505. * TQM bypass frames)
  2506. * For software based completions, wbm_release_ring->release_source_module will
  2507. * be set to release_source_fw
  2508. */
  2509. PREPACK struct htt_tx_wbm_completion {
  2510. A_UINT32
  2511. sch_cmd_id: 24,
  2512. exception_frame: 1, /* If set, this packet was queued via exception path */
  2513. rsvd0_31_25: 7;
  2514. A_UINT32
  2515. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2516. * reception of an ACK or BA, this field indicates
  2517. * the RSSI of the received ACK or BA frame.
  2518. * When the frame is removed as result of a direct
  2519. * remove command from the SW, this field is set
  2520. * to 0x0 (which is never a valid value when real
  2521. * RSSI is available).
  2522. * Units: dB w.r.t noise floor
  2523. */
  2524. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2525. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2526. rsvd1_31_16: 16;
  2527. } POSTPACK;
  2528. /* DWORD 0 */
  2529. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2530. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2531. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2532. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2533. /* DWORD 1 */
  2534. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2535. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2536. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2537. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2538. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2539. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2540. /* DWORD 0 */
  2541. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2542. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2543. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2544. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2545. do { \
  2546. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2547. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2548. } while (0)
  2549. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2550. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2551. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2552. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2553. do { \
  2554. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2555. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2556. } while (0)
  2557. /* DWORD 1 */
  2558. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2559. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2560. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2561. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2562. do { \
  2563. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2564. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2565. } while (0)
  2566. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2567. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2568. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2569. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2570. do { \
  2571. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2572. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2573. } while (0)
  2574. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2575. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2576. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2577. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2578. do { \
  2579. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2580. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2581. } while (0)
  2582. /**
  2583. * @brief HTT TX WBM Completion from firmware to host
  2584. * @details
  2585. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2586. * (WBM) offload HW.
  2587. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2588. * For software based completions, release_source_module will
  2589. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2590. * struct wbm_release_ring and then switch to this after looking at
  2591. * release_source_module.
  2592. */
  2593. PREPACK struct htt_tx_wbm_completion_v2 {
  2594. A_UINT32
  2595. used_by_hw0; /* Refer to struct wbm_release_ring */
  2596. A_UINT32
  2597. used_by_hw1; /* Refer to struct wbm_release_ring */
  2598. A_UINT32
  2599. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2600. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2601. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2602. exception_frame: 1,
  2603. rsvd0: 12, /* For future use */
  2604. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2605. rsvd1: 1; /* For future use */
  2606. A_UINT32
  2607. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2608. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2609. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2610. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2611. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2612. */
  2613. A_UINT32
  2614. data1: 32;
  2615. A_UINT32
  2616. data2: 32;
  2617. A_UINT32
  2618. used_by_hw3; /* Refer to struct wbm_release_ring */
  2619. } POSTPACK;
  2620. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2621. /* DWORD 3 */
  2622. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2623. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2624. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2625. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2626. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2627. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2628. /* DWORD 3 */
  2629. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2630. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2631. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2632. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2633. do { \
  2634. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2635. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2636. } while (0)
  2637. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2638. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2639. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2640. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2641. do { \
  2642. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2643. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2644. } while (0)
  2645. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2646. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2647. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2648. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2649. do { \
  2650. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2651. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2652. } while (0)
  2653. /**
  2654. * @brief HTT TX WBM Completion from firmware to host (V3)
  2655. * @details
  2656. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2657. * (WBM) offload HW.
  2658. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2659. * For software based completions, release_source_module will
  2660. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2661. * struct wbm_release_ring and then switch to this after looking at
  2662. * release_source_module.
  2663. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2664. * by new generations of targets.
  2665. */
  2666. PREPACK struct htt_tx_wbm_completion_v3 {
  2667. A_UINT32
  2668. used_by_hw0; /* Refer to struct wbm_release_ring */
  2669. A_UINT32
  2670. used_by_hw1; /* Refer to struct wbm_release_ring */
  2671. A_UINT32
  2672. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2673. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2674. used_by_hw3: 15;
  2675. A_UINT32
  2676. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2677. exception_frame: 1,
  2678. rsvd0: 27; /* For future use */
  2679. A_UINT32
  2680. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2681. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2682. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2683. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2684. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2685. */
  2686. A_UINT32
  2687. data1: 32;
  2688. A_UINT32
  2689. data2: 32;
  2690. A_UINT32
  2691. rsvd1: 20,
  2692. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2693. } POSTPACK;
  2694. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2695. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2696. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2697. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2698. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2699. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2700. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2701. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2702. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2703. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2704. do { \
  2705. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2706. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2707. } while (0)
  2708. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2709. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2710. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2711. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2712. do { \
  2713. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2714. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2715. } while (0)
  2716. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2717. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2718. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2719. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2720. do { \
  2721. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2722. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2723. } while (0)
  2724. typedef enum {
  2725. TX_FRAME_TYPE_UNDEFINED = 0,
  2726. TX_FRAME_TYPE_EAPOL = 1,
  2727. } htt_tx_wbm_status_frame_type;
  2728. /**
  2729. * @brief HTT TX WBM transmit status from firmware to host
  2730. * @details
  2731. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2732. * (WBM) offload HW.
  2733. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2734. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2735. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2736. */
  2737. PREPACK struct htt_tx_wbm_transmit_status {
  2738. A_UINT32
  2739. sch_cmd_id: 24,
  2740. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2741. * reception of an ACK or BA, this field indicates
  2742. * the RSSI of the received ACK or BA frame.
  2743. * When the frame is removed as result of a direct
  2744. * remove command from the SW, this field is set
  2745. * to 0x0 (which is never a valid value when real
  2746. * RSSI is available).
  2747. * Units: dB w.r.t noise floor
  2748. */
  2749. A_UINT32
  2750. sw_peer_id: 16,
  2751. tid_num: 5,
  2752. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2753. * and tid_num fields contain valid data.
  2754. * If this "valid" flag is not set, the
  2755. * sw_peer_id and tid_num fields must be ignored.
  2756. */
  2757. mcast: 1,
  2758. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2759. * contains valid data.
  2760. */
  2761. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2762. reserved: 4;
  2763. A_UINT32
  2764. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2765. * packets in the wbm completion path
  2766. */
  2767. } POSTPACK;
  2768. /* DWORD 4 */
  2769. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2770. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2771. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2772. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2773. /* DWORD 5 */
  2774. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2775. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2776. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2777. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2778. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2779. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2780. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2781. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2782. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2783. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2784. /* DWORD 4 */
  2785. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2786. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2787. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2788. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2789. do { \
  2790. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2791. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2792. } while (0)
  2793. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2794. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2795. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2796. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2799. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2800. } while (0)
  2801. /* DWORD 5 */
  2802. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2803. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2804. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2805. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2806. do { \
  2807. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2808. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2809. } while (0)
  2810. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2811. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2812. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2813. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2814. do { \
  2815. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2816. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2817. } while (0)
  2818. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2819. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2820. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2821. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2822. do { \
  2823. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2824. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2825. } while (0)
  2826. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2827. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2828. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2829. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2830. do { \
  2831. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2832. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2833. } while (0)
  2834. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2835. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2836. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2837. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2838. do { \
  2839. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2840. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2841. } while (0)
  2842. /**
  2843. * @brief HTT TX WBM reinject status from firmware to host
  2844. * @details
  2845. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2846. * (WBM) offload HW.
  2847. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2848. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2849. */
  2850. PREPACK struct htt_tx_wbm_reinject_status {
  2851. A_UINT32
  2852. reserved0: 32;
  2853. A_UINT32
  2854. reserved1: 32;
  2855. A_UINT32
  2856. reserved2: 32;
  2857. } POSTPACK;
  2858. /**
  2859. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2860. * @details
  2861. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2862. * (WBM) offload HW.
  2863. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2864. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2865. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2866. * STA side.
  2867. */
  2868. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2869. A_UINT32
  2870. mec_sa_addr_31_0;
  2871. A_UINT32
  2872. mec_sa_addr_47_32: 16,
  2873. sa_ast_index: 16;
  2874. A_UINT32
  2875. vdev_id: 8,
  2876. reserved0: 24;
  2877. } POSTPACK;
  2878. /* DWORD 4 - mec_sa_addr_31_0 */
  2879. /* DWORD 5 */
  2880. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2881. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2882. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2883. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2884. /* DWORD 6 */
  2885. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2886. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2887. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2888. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2889. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2890. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2891. do { \
  2892. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2893. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2894. } while (0)
  2895. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2896. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2897. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2898. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2899. do { \
  2900. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2901. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2902. } while (0)
  2903. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2904. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2905. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2906. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2907. do { \
  2908. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2909. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2910. } while (0)
  2911. typedef enum {
  2912. TX_FLOW_PRIORITY_BE,
  2913. TX_FLOW_PRIORITY_HIGH,
  2914. TX_FLOW_PRIORITY_LOW,
  2915. } htt_tx_flow_priority_t;
  2916. typedef enum {
  2917. TX_FLOW_LATENCY_SENSITIVE,
  2918. TX_FLOW_LATENCY_INSENSITIVE,
  2919. } htt_tx_flow_latency_t;
  2920. typedef enum {
  2921. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2922. TX_FLOW_INTERACTIVE_TRAFFIC,
  2923. TX_FLOW_PERIODIC_TRAFFIC,
  2924. TX_FLOW_BURSTY_TRAFFIC,
  2925. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2926. } htt_tx_flow_traffic_pattern_t;
  2927. /**
  2928. * @brief HTT TX Flow search metadata format
  2929. * @details
  2930. * Host will set this metadata in flow table's flow search entry along with
  2931. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2932. * firmware and TQM ring if the flow search entry wins.
  2933. * This metadata is available to firmware in that first MSDU's
  2934. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2935. * to one of the available flows for specific tid and returns the tqm flow
  2936. * pointer as part of htt_tx_map_flow_info message.
  2937. */
  2938. PREPACK struct htt_tx_flow_metadata {
  2939. A_UINT32
  2940. rsvd0_1_0: 2,
  2941. tid: 4,
  2942. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2943. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2944. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2945. * Else choose final tid based on latency, priority.
  2946. */
  2947. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2948. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2949. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2950. } POSTPACK;
  2951. /* DWORD 0 */
  2952. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2953. #define HTT_TX_FLOW_METADATA_TID_S 2
  2954. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2955. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2956. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2957. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2958. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2959. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2960. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2961. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2962. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2963. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2964. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2965. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2966. /* DWORD 0 */
  2967. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2968. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2969. HTT_TX_FLOW_METADATA_TID_S)
  2970. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2971. do { \
  2972. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2973. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2974. } while (0)
  2975. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2976. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2977. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2978. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2979. do { \
  2980. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2981. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2982. } while (0)
  2983. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2984. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2985. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2986. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2987. do { \
  2988. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2989. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2990. } while (0)
  2991. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2992. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2993. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2994. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2995. do { \
  2996. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2997. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2998. } while (0)
  2999. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  3000. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  3001. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  3002. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  3003. do { \
  3004. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3005. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3006. } while (0)
  3007. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3008. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3009. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3010. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3011. do { \
  3012. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3013. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3014. } while (0)
  3015. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3016. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3017. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3018. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3019. do { \
  3020. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3021. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3022. } while (0)
  3023. /**
  3024. * @brief host -> target ADD WDS Entry
  3025. *
  3026. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3027. *
  3028. * @brief host -> target DELETE WDS Entry
  3029. *
  3030. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3031. *
  3032. * @details
  3033. * HTT wds entry from source port learning
  3034. * Host will learn wds entries from rx and send this message to firmware
  3035. * to enable firmware to configure/delete AST entries for wds clients.
  3036. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3037. * and when SA's entry is deleted, firmware removes this AST entry
  3038. *
  3039. * The message would appear as follows:
  3040. *
  3041. * |31 30|29 |17 16|15 8|7 0|
  3042. * |----------------+----------------+----------------+----------------|
  3043. * | rsvd0 |PDVID| vdev_id | msg_type |
  3044. * |-------------------------------------------------------------------|
  3045. * | sa_addr_31_0 |
  3046. * |-------------------------------------------------------------------|
  3047. * | | ta_peer_id | sa_addr_47_32 |
  3048. * |-------------------------------------------------------------------|
  3049. * Where PDVID = pdev_id
  3050. *
  3051. * The message is interpreted as follows:
  3052. *
  3053. * dword0 - b'0:7 - msg_type: This will be set to
  3054. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3055. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3056. *
  3057. * dword0 - b'8:15 - vdev_id
  3058. *
  3059. * dword0 - b'16:17 - pdev_id
  3060. *
  3061. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3062. *
  3063. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3064. *
  3065. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3066. *
  3067. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3068. */
  3069. PREPACK struct htt_wds_entry {
  3070. A_UINT32
  3071. msg_type: 8,
  3072. vdev_id: 8,
  3073. pdev_id: 2,
  3074. rsvd0: 14;
  3075. A_UINT32 sa_addr_31_0;
  3076. A_UINT32
  3077. sa_addr_47_32: 16,
  3078. ta_peer_id: 14,
  3079. rsvd2: 2;
  3080. } POSTPACK;
  3081. /* DWORD 0 */
  3082. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3083. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3084. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3085. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3086. /* DWORD 2 */
  3087. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3088. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3089. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3090. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3091. /* DWORD 0 */
  3092. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3093. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3094. HTT_WDS_ENTRY_VDEV_ID_S)
  3095. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3096. do { \
  3097. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3098. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3099. } while (0)
  3100. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3101. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3102. HTT_WDS_ENTRY_PDEV_ID_S)
  3103. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3104. do { \
  3105. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3106. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3107. } while (0)
  3108. /* DWORD 2 */
  3109. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3110. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3111. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3112. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3113. do { \
  3114. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3115. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3116. } while (0)
  3117. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3118. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3119. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3120. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3121. do { \
  3122. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3123. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3124. } while (0)
  3125. /**
  3126. * @brief MAC DMA rx ring setup specification
  3127. *
  3128. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3129. *
  3130. * @details
  3131. * To allow for dynamic rx ring reconfiguration and to avoid race
  3132. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3133. * it uses. Instead, it sends this message to the target, indicating how
  3134. * the rx ring used by the host should be set up and maintained.
  3135. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3136. * specifications.
  3137. *
  3138. * |31 16|15 8|7 0|
  3139. * |---------------------------------------------------------------|
  3140. * header: | reserved | num rings | msg type |
  3141. * |---------------------------------------------------------------|
  3142. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3143. #if HTT_PADDR64
  3144. * | FW_IDX shadow register physical address (bits 63:32) |
  3145. #endif
  3146. * |---------------------------------------------------------------|
  3147. * | rx ring base physical address (bits 31:0) |
  3148. #if HTT_PADDR64
  3149. * | rx ring base physical address (bits 63:32) |
  3150. #endif
  3151. * |---------------------------------------------------------------|
  3152. * | rx ring buffer size | rx ring length |
  3153. * |---------------------------------------------------------------|
  3154. * | FW_IDX initial value | enabled flags |
  3155. * |---------------------------------------------------------------|
  3156. * | MSDU payload offset | 802.11 header offset |
  3157. * |---------------------------------------------------------------|
  3158. * | PPDU end offset | PPDU start offset |
  3159. * |---------------------------------------------------------------|
  3160. * | MPDU end offset | MPDU start offset |
  3161. * |---------------------------------------------------------------|
  3162. * | MSDU end offset | MSDU start offset |
  3163. * |---------------------------------------------------------------|
  3164. * | frag info offset | rx attention offset |
  3165. * |---------------------------------------------------------------|
  3166. * payload 2, if present, has the same format as payload 1
  3167. * Header fields:
  3168. * - MSG_TYPE
  3169. * Bits 7:0
  3170. * Purpose: identifies this as an rx ring configuration message
  3171. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3172. * - NUM_RINGS
  3173. * Bits 15:8
  3174. * Purpose: indicates whether the host is setting up one rx ring or two
  3175. * Value: 1 or 2
  3176. * Payload:
  3177. * for systems using 64-bit format for bus addresses:
  3178. * - IDX_SHADOW_REG_PADDR_LO
  3179. * Bits 31:0
  3180. * Value: lower 4 bytes of physical address of the host's
  3181. * FW_IDX shadow register
  3182. * - IDX_SHADOW_REG_PADDR_HI
  3183. * Bits 31:0
  3184. * Value: upper 4 bytes of physical address of the host's
  3185. * FW_IDX shadow register
  3186. * - RING_BASE_PADDR_LO
  3187. * Bits 31:0
  3188. * Value: lower 4 bytes of physical address of the host's rx ring
  3189. * - RING_BASE_PADDR_HI
  3190. * Bits 31:0
  3191. * Value: uppper 4 bytes of physical address of the host's rx ring
  3192. * for systems using 32-bit format for bus addresses:
  3193. * - IDX_SHADOW_REG_PADDR
  3194. * Bits 31:0
  3195. * Value: physical address of the host's FW_IDX shadow register
  3196. * - RING_BASE_PADDR
  3197. * Bits 31:0
  3198. * Value: physical address of the host's rx ring
  3199. * - RING_LEN
  3200. * Bits 15:0
  3201. * Value: number of elements in the rx ring
  3202. * - RING_BUF_SZ
  3203. * Bits 31:16
  3204. * Value: size of the buffers referenced by the rx ring, in byte units
  3205. * - ENABLED_FLAGS
  3206. * Bits 15:0
  3207. * Value: 1-bit flags to show whether different rx fields are enabled
  3208. * bit 0: 802.11 header enabled (1) or disabled (0)
  3209. * bit 1: MSDU payload enabled (1) or disabled (0)
  3210. * bit 2: PPDU start enabled (1) or disabled (0)
  3211. * bit 3: PPDU end enabled (1) or disabled (0)
  3212. * bit 4: MPDU start enabled (1) or disabled (0)
  3213. * bit 5: MPDU end enabled (1) or disabled (0)
  3214. * bit 6: MSDU start enabled (1) or disabled (0)
  3215. * bit 7: MSDU end enabled (1) or disabled (0)
  3216. * bit 8: rx attention enabled (1) or disabled (0)
  3217. * bit 9: frag info enabled (1) or disabled (0)
  3218. * bit 10: unicast rx enabled (1) or disabled (0)
  3219. * bit 11: multicast rx enabled (1) or disabled (0)
  3220. * bit 12: ctrl rx enabled (1) or disabled (0)
  3221. * bit 13: mgmt rx enabled (1) or disabled (0)
  3222. * bit 14: null rx enabled (1) or disabled (0)
  3223. * bit 15: phy data rx enabled (1) or disabled (0)
  3224. * - IDX_INIT_VAL
  3225. * Bits 31:16
  3226. * Purpose: Specify the initial value for the FW_IDX.
  3227. * Value: the number of buffers initially present in the host's rx ring
  3228. * - OFFSET_802_11_HDR
  3229. * Bits 15:0
  3230. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3231. * - OFFSET_MSDU_PAYLOAD
  3232. * Bits 31:16
  3233. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3234. * - OFFSET_PPDU_START
  3235. * Bits 15:0
  3236. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3237. * - OFFSET_PPDU_END
  3238. * Bits 31:16
  3239. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3240. * - OFFSET_MPDU_START
  3241. * Bits 15:0
  3242. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3243. * - OFFSET_MPDU_END
  3244. * Bits 31:16
  3245. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3246. * - OFFSET_MSDU_START
  3247. * Bits 15:0
  3248. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3249. * - OFFSET_MSDU_END
  3250. * Bits 31:16
  3251. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3252. * - OFFSET_RX_ATTN
  3253. * Bits 15:0
  3254. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3255. * - OFFSET_FRAG_INFO
  3256. * Bits 31:16
  3257. * Value: offset in QUAD-bytes of frag info table
  3258. */
  3259. /* header fields */
  3260. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3261. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3262. /* payload fields */
  3263. /* for systems using a 64-bit format for bus addresses */
  3264. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3265. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3266. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3267. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3268. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3269. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3270. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3271. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3272. /* for systems using a 32-bit format for bus addresses */
  3273. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3274. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3275. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3276. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3277. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3278. #define HTT_RX_RING_CFG_LEN_S 0
  3279. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3280. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3281. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3282. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3283. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3284. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3285. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3286. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3287. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3288. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3289. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3290. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3291. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3292. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3293. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3294. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3295. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3296. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3297. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3298. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3299. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3300. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3301. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3302. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3303. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3304. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3305. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3306. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3307. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3308. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3309. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3310. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3311. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3312. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3313. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3314. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3315. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3316. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3317. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3318. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3319. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3320. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3321. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3322. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3323. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3324. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3325. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3326. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3327. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3328. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3329. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3330. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3331. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3332. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3333. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3334. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3335. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3336. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3337. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3338. #if HTT_PADDR64
  3339. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3340. #else
  3341. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3342. #endif
  3343. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3344. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3345. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3346. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3347. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3348. do { \
  3349. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3350. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3351. } while (0)
  3352. /* degenerate case for 32-bit fields */
  3353. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3354. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3355. ((_var) = (_val))
  3356. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3357. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3358. ((_var) = (_val))
  3359. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3360. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3361. ((_var) = (_val))
  3362. /* degenerate case for 32-bit fields */
  3363. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3364. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3365. ((_var) = (_val))
  3366. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3367. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3368. ((_var) = (_val))
  3369. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3370. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3371. ((_var) = (_val))
  3372. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3373. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3374. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3375. do { \
  3376. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3377. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3378. } while (0)
  3379. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3380. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3381. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3382. do { \
  3383. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3384. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3385. } while (0)
  3386. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3387. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3388. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3389. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3390. do { \
  3391. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3392. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3393. } while (0)
  3394. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3395. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3396. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3397. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3398. do { \
  3399. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3400. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3401. } while (0)
  3402. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3403. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3404. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3405. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3406. do { \
  3407. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3408. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3409. } while (0)
  3410. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3411. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3412. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3413. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3414. do { \
  3415. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3416. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3417. } while (0)
  3418. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3419. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3420. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3421. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3422. do { \
  3423. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3424. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3425. } while (0)
  3426. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3427. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3428. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3429. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3430. do { \
  3431. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3432. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3433. } while (0)
  3434. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3435. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3436. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3437. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3438. do { \
  3439. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3440. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3441. } while (0)
  3442. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3443. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3444. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3445. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3446. do { \
  3447. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3448. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3449. } while (0)
  3450. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3451. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3452. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3453. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3454. do { \
  3455. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3456. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3457. } while (0)
  3458. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3459. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3460. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3461. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3462. do { \
  3463. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3464. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3465. } while (0)
  3466. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3467. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3468. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3469. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3470. do { \
  3471. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3472. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3473. } while (0)
  3474. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3475. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3476. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3477. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3478. do { \
  3479. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3480. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3481. } while (0)
  3482. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3483. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3484. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3485. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3486. do { \
  3487. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3488. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3489. } while (0)
  3490. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3491. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3492. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3493. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3494. do { \
  3495. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3496. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3497. } while (0)
  3498. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3499. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3500. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3501. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3504. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3505. } while (0)
  3506. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3507. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3508. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3509. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3510. do { \
  3511. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3512. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3513. } while (0)
  3514. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3515. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3516. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3517. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3520. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3521. } while (0)
  3522. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3523. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3524. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3525. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3528. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3529. } while (0)
  3530. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3531. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3532. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3533. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3536. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3537. } while (0)
  3538. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3539. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3540. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3541. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3544. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3545. } while (0)
  3546. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3547. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3548. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3549. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3552. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3553. } while (0)
  3554. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3555. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3556. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3557. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3560. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3561. } while (0)
  3562. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3563. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3564. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3565. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3566. do { \
  3567. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3568. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3569. } while (0)
  3570. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3571. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3572. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3573. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3574. do { \
  3575. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3576. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3577. } while (0)
  3578. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3579. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3580. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3581. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3582. do { \
  3583. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3584. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3585. } while (0)
  3586. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3587. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3588. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3589. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3590. do { \
  3591. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3592. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3593. } while (0)
  3594. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3595. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3596. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3597. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3598. do { \
  3599. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3600. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3601. } while (0)
  3602. /**
  3603. * @brief host -> target FW statistics retrieve
  3604. *
  3605. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3606. *
  3607. * @details
  3608. * The following field definitions describe the format of the HTT host
  3609. * to target FW stats retrieve message. The message specifies the type of
  3610. * stats host wants to retrieve.
  3611. *
  3612. * |31 24|23 16|15 8|7 0|
  3613. * |-----------------------------------------------------------|
  3614. * | stats types request bitmask | msg type |
  3615. * |-----------------------------------------------------------|
  3616. * | stats types reset bitmask | reserved |
  3617. * |-----------------------------------------------------------|
  3618. * | stats type | config value |
  3619. * |-----------------------------------------------------------|
  3620. * | cookie LSBs |
  3621. * |-----------------------------------------------------------|
  3622. * | cookie MSBs |
  3623. * |-----------------------------------------------------------|
  3624. * Header fields:
  3625. * - MSG_TYPE
  3626. * Bits 7:0
  3627. * Purpose: identifies this is a stats upload request message
  3628. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3629. * - UPLOAD_TYPES
  3630. * Bits 31:8
  3631. * Purpose: identifies which types of FW statistics to upload
  3632. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3633. * - RESET_TYPES
  3634. * Bits 31:8
  3635. * Purpose: identifies which types of FW statistics to reset
  3636. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3637. * - CFG_VAL
  3638. * Bits 23:0
  3639. * Purpose: give an opaque configuration value to the specified stats type
  3640. * Value: stats-type specific configuration value
  3641. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3642. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3643. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3644. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3645. * - CFG_STAT_TYPE
  3646. * Bits 31:24
  3647. * Purpose: specify which stats type (if any) the config value applies to
  3648. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3649. * a valid configuration specification
  3650. * - COOKIE_LSBS
  3651. * Bits 31:0
  3652. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3653. * message with its preceding host->target stats request message.
  3654. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3655. * - COOKIE_MSBS
  3656. * Bits 31:0
  3657. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3658. * message with its preceding host->target stats request message.
  3659. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3660. */
  3661. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3662. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3663. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3664. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3665. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3666. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3667. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3668. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3669. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3670. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3671. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3672. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3673. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3674. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3675. do { \
  3676. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3677. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3678. } while (0)
  3679. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3680. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3681. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3682. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3683. do { \
  3684. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3685. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3686. } while (0)
  3687. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3688. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3689. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3690. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3691. do { \
  3692. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3693. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3694. } while (0)
  3695. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3696. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3697. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3698. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3699. do { \
  3700. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3701. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3702. } while (0)
  3703. /**
  3704. * @brief host -> target HTT out-of-band sync request
  3705. *
  3706. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3707. *
  3708. * @details
  3709. * The HTT SYNC tells the target to suspend processing of subsequent
  3710. * HTT host-to-target messages until some other target agent locally
  3711. * informs the target HTT FW that the current sync counter is equal to
  3712. * or greater than (in a modulo sense) the sync counter specified in
  3713. * the SYNC message.
  3714. * This allows other host-target components to synchronize their operation
  3715. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3716. * security key has been downloaded to and activated by the target.
  3717. * In the absence of any explicit synchronization counter value
  3718. * specification, the target HTT FW will use zero as the default current
  3719. * sync value.
  3720. *
  3721. * |31 24|23 16|15 8|7 0|
  3722. * |-----------------------------------------------------------|
  3723. * | reserved | sync count | msg type |
  3724. * |-----------------------------------------------------------|
  3725. * Header fields:
  3726. * - MSG_TYPE
  3727. * Bits 7:0
  3728. * Purpose: identifies this as a sync message
  3729. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3730. * - SYNC_COUNT
  3731. * Bits 15:8
  3732. * Purpose: specifies what sync value the HTT FW will wait for from
  3733. * an out-of-band specification to resume its operation
  3734. * Value: in-band sync counter value to compare against the out-of-band
  3735. * counter spec.
  3736. * The HTT target FW will suspend its host->target message processing
  3737. * as long as
  3738. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3739. */
  3740. #define HTT_H2T_SYNC_MSG_SZ 4
  3741. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3742. #define HTT_H2T_SYNC_COUNT_S 8
  3743. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3744. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3745. HTT_H2T_SYNC_COUNT_S)
  3746. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3747. do { \
  3748. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3749. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3750. } while (0)
  3751. /**
  3752. * @brief host -> target HTT aggregation configuration
  3753. *
  3754. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3755. */
  3756. #define HTT_AGGR_CFG_MSG_SZ 4
  3757. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3758. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3759. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3760. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3761. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3762. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3763. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3764. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3765. do { \
  3766. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3767. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3768. } while (0)
  3769. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3770. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3771. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3772. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3773. do { \
  3774. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3775. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3776. } while (0)
  3777. /**
  3778. * @brief host -> target HTT configure max amsdu info per vdev
  3779. *
  3780. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3781. *
  3782. * @details
  3783. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3784. *
  3785. * |31 21|20 16|15 8|7 0|
  3786. * |-----------------------------------------------------------|
  3787. * | reserved | vdev id | max amsdu | msg type |
  3788. * |-----------------------------------------------------------|
  3789. * Header fields:
  3790. * - MSG_TYPE
  3791. * Bits 7:0
  3792. * Purpose: identifies this as a aggr cfg ex message
  3793. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3794. * - MAX_NUM_AMSDU_SUBFRM
  3795. * Bits 15:8
  3796. * Purpose: max MSDUs per A-MSDU
  3797. * - VDEV_ID
  3798. * Bits 20:16
  3799. * Purpose: ID of the vdev to which this limit is applied
  3800. */
  3801. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3802. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3803. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3804. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3805. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3806. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3807. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3808. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3809. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3810. do { \
  3811. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3812. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3813. } while (0)
  3814. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3815. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3816. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3817. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3818. do { \
  3819. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3820. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3821. } while (0)
  3822. /**
  3823. * @brief HTT WDI_IPA Config Message
  3824. *
  3825. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3826. *
  3827. * @details
  3828. * The HTT WDI_IPA config message is created/sent by host at driver
  3829. * init time. It contains information about data structures used on
  3830. * WDI_IPA TX and RX path.
  3831. * TX CE ring is used for pushing packet metadata from IPA uC
  3832. * to WLAN FW
  3833. * TX Completion ring is used for generating TX completions from
  3834. * WLAN FW to IPA uC
  3835. * RX Indication ring is used for indicating RX packets from FW
  3836. * to IPA uC
  3837. * RX Ring2 is used as either completion ring or as second
  3838. * indication ring. when Ring2 is used as completion ring, IPA uC
  3839. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3840. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3841. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3842. * indicated in RX Indication ring. Please see WDI_IPA specification
  3843. * for more details.
  3844. * |31 24|23 16|15 8|7 0|
  3845. * |----------------+----------------+----------------+----------------|
  3846. * | tx pkt pool size | Rsvd | msg_type |
  3847. * |-------------------------------------------------------------------|
  3848. * | tx comp ring base (bits 31:0) |
  3849. #if HTT_PADDR64
  3850. * | tx comp ring base (bits 63:32) |
  3851. #endif
  3852. * |-------------------------------------------------------------------|
  3853. * | tx comp ring size |
  3854. * |-------------------------------------------------------------------|
  3855. * | tx comp WR_IDX physical address (bits 31:0) |
  3856. #if HTT_PADDR64
  3857. * | tx comp WR_IDX physical address (bits 63:32) |
  3858. #endif
  3859. * |-------------------------------------------------------------------|
  3860. * | tx CE WR_IDX physical address (bits 31:0) |
  3861. #if HTT_PADDR64
  3862. * | tx CE WR_IDX physical address (bits 63:32) |
  3863. #endif
  3864. * |-------------------------------------------------------------------|
  3865. * | rx indication ring base (bits 31:0) |
  3866. #if HTT_PADDR64
  3867. * | rx indication ring base (bits 63:32) |
  3868. #endif
  3869. * |-------------------------------------------------------------------|
  3870. * | rx indication ring size |
  3871. * |-------------------------------------------------------------------|
  3872. * | rx ind RD_IDX physical address (bits 31:0) |
  3873. #if HTT_PADDR64
  3874. * | rx ind RD_IDX physical address (bits 63:32) |
  3875. #endif
  3876. * |-------------------------------------------------------------------|
  3877. * | rx ind WR_IDX physical address (bits 31:0) |
  3878. #if HTT_PADDR64
  3879. * | rx ind WR_IDX physical address (bits 63:32) |
  3880. #endif
  3881. * |-------------------------------------------------------------------|
  3882. * |-------------------------------------------------------------------|
  3883. * | rx ring2 base (bits 31:0) |
  3884. #if HTT_PADDR64
  3885. * | rx ring2 base (bits 63:32) |
  3886. #endif
  3887. * |-------------------------------------------------------------------|
  3888. * | rx ring2 size |
  3889. * |-------------------------------------------------------------------|
  3890. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3891. #if HTT_PADDR64
  3892. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3893. #endif
  3894. * |-------------------------------------------------------------------|
  3895. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3896. #if HTT_PADDR64
  3897. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3898. #endif
  3899. * |-------------------------------------------------------------------|
  3900. *
  3901. * Header fields:
  3902. * Header fields:
  3903. * - MSG_TYPE
  3904. * Bits 7:0
  3905. * Purpose: Identifies this as WDI_IPA config message
  3906. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3907. * - TX_PKT_POOL_SIZE
  3908. * Bits 15:0
  3909. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3910. * WDI_IPA TX path
  3911. * For systems using 32-bit format for bus addresses:
  3912. * - TX_COMP_RING_BASE_ADDR
  3913. * Bits 31:0
  3914. * Purpose: TX Completion Ring base address in DDR
  3915. * - TX_COMP_RING_SIZE
  3916. * Bits 31:0
  3917. * Purpose: TX Completion Ring size (must be power of 2)
  3918. * - TX_COMP_WR_IDX_ADDR
  3919. * Bits 31:0
  3920. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3921. * updates the Write Index for WDI_IPA TX completion ring
  3922. * - TX_CE_WR_IDX_ADDR
  3923. * Bits 31:0
  3924. * Purpose: DDR address where IPA uC
  3925. * updates the WR Index for TX CE ring
  3926. * (needed for fusion platforms)
  3927. * - RX_IND_RING_BASE_ADDR
  3928. * Bits 31:0
  3929. * Purpose: RX Indication Ring base address in DDR
  3930. * - RX_IND_RING_SIZE
  3931. * Bits 31:0
  3932. * Purpose: RX Indication Ring size
  3933. * - RX_IND_RD_IDX_ADDR
  3934. * Bits 31:0
  3935. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3936. * RX indication ring
  3937. * - RX_IND_WR_IDX_ADDR
  3938. * Bits 31:0
  3939. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3940. * updates the Write Index for WDI_IPA RX indication ring
  3941. * - RX_RING2_BASE_ADDR
  3942. * Bits 31:0
  3943. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3944. * - RX_RING2_SIZE
  3945. * Bits 31:0
  3946. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3947. * - RX_RING2_RD_IDX_ADDR
  3948. * Bits 31:0
  3949. * Purpose: If Second RX ring is Indication ring, DDR address where
  3950. * IPA uC updates the Read Index for Ring2.
  3951. * If Second RX ring is completion ring, this is NOT used
  3952. * - RX_RING2_WR_IDX_ADDR
  3953. * Bits 31:0
  3954. * Purpose: If Second RX ring is Indication ring, DDR address where
  3955. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3956. * If second RX ring is completion ring, DDR address where
  3957. * IPA uC updates the Write Index for Ring 2.
  3958. * For systems using 64-bit format for bus addresses:
  3959. * - TX_COMP_RING_BASE_ADDR_LO
  3960. * Bits 31:0
  3961. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3962. * - TX_COMP_RING_BASE_ADDR_HI
  3963. * Bits 31:0
  3964. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3965. * - TX_COMP_RING_SIZE
  3966. * Bits 31:0
  3967. * Purpose: TX Completion Ring size (must be power of 2)
  3968. * - TX_COMP_WR_IDX_ADDR_LO
  3969. * Bits 31:0
  3970. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3971. * Lower 4 bytes of DDR address where WIFI FW
  3972. * updates the Write Index for WDI_IPA TX completion ring
  3973. * - TX_COMP_WR_IDX_ADDR_HI
  3974. * Bits 31:0
  3975. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3976. * Higher 4 bytes of DDR address where WIFI FW
  3977. * updates the Write Index for WDI_IPA TX completion ring
  3978. * - TX_CE_WR_IDX_ADDR_LO
  3979. * Bits 31:0
  3980. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3981. * updates the WR Index for TX CE ring
  3982. * (needed for fusion platforms)
  3983. * - TX_CE_WR_IDX_ADDR_HI
  3984. * Bits 31:0
  3985. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3986. * updates the WR Index for TX CE ring
  3987. * (needed for fusion platforms)
  3988. * - RX_IND_RING_BASE_ADDR_LO
  3989. * Bits 31:0
  3990. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3991. * - RX_IND_RING_BASE_ADDR_HI
  3992. * Bits 31:0
  3993. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3994. * - RX_IND_RING_SIZE
  3995. * Bits 31:0
  3996. * Purpose: RX Indication Ring size
  3997. * - RX_IND_RD_IDX_ADDR_LO
  3998. * Bits 31:0
  3999. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  4000. * for WDI_IPA RX indication ring
  4001. * - RX_IND_RD_IDX_ADDR_HI
  4002. * Bits 31:0
  4003. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4004. * for WDI_IPA RX indication ring
  4005. * - RX_IND_WR_IDX_ADDR_LO
  4006. * Bits 31:0
  4007. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4008. * Lower 4 bytes of DDR address where WIFI FW
  4009. * updates the Write Index for WDI_IPA RX indication ring
  4010. * - RX_IND_WR_IDX_ADDR_HI
  4011. * Bits 31:0
  4012. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4013. * Higher 4 bytes of DDR address where WIFI FW
  4014. * updates the Write Index for WDI_IPA RX indication ring
  4015. * - RX_RING2_BASE_ADDR_LO
  4016. * Bits 31:0
  4017. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4018. * - RX_RING2_BASE_ADDR_HI
  4019. * Bits 31:0
  4020. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4021. * - RX_RING2_SIZE
  4022. * Bits 31:0
  4023. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4024. * - RX_RING2_RD_IDX_ADDR_LO
  4025. * Bits 31:0
  4026. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4027. * DDR address where IPA uC updates the Read Index for Ring2.
  4028. * If Second RX ring is completion ring, this is NOT used
  4029. * - RX_RING2_RD_IDX_ADDR_HI
  4030. * Bits 31:0
  4031. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4032. * DDR address where IPA uC updates the Read Index for Ring2.
  4033. * If Second RX ring is completion ring, this is NOT used
  4034. * - RX_RING2_WR_IDX_ADDR_LO
  4035. * Bits 31:0
  4036. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4037. * DDR address where WIFI FW updates the Write Index
  4038. * for WDI_IPA RX ring2
  4039. * If second RX ring is completion ring, lower 4 bytes of
  4040. * DDR address where IPA uC updates the Write Index for Ring 2.
  4041. * - RX_RING2_WR_IDX_ADDR_HI
  4042. * Bits 31:0
  4043. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4044. * DDR address where WIFI FW updates the Write Index
  4045. * for WDI_IPA RX ring2
  4046. * If second RX ring is completion ring, higher 4 bytes of
  4047. * DDR address where IPA uC updates the Write Index for Ring 2.
  4048. */
  4049. #if HTT_PADDR64
  4050. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4051. #else
  4052. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4053. #endif
  4054. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4055. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4060. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4062. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4064. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4066. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4068. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4070. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4072. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4074. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4088. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4089. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4090. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4091. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4092. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4093. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4094. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4095. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4106. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4107. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4108. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4109. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4110. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4111. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4112. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4113. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4114. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4115. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4116. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4117. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4118. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4121. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4122. } while (0)
  4123. /* for systems using 32-bit format for bus addr */
  4124. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4125. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4126. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4129. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4130. } while (0)
  4131. /* for systems using 64-bit format for bus addr */
  4132. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4133. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4134. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4135. do { \
  4136. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4137. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4138. } while (0)
  4139. /* for systems using 64-bit format for bus addr */
  4140. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4141. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4142. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4143. do { \
  4144. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4145. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4146. } while (0)
  4147. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4148. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4149. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4150. do { \
  4151. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4152. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4153. } while (0)
  4154. /* for systems using 32-bit format for bus addr */
  4155. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4156. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4157. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4158. do { \
  4159. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4160. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4161. } while (0)
  4162. /* for systems using 64-bit format for bus addr */
  4163. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4164. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4165. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4168. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4169. } while (0)
  4170. /* for systems using 64-bit format for bus addr */
  4171. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4172. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4173. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4176. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4177. } while (0)
  4178. /* for systems using 32-bit format for bus addr */
  4179. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4180. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4181. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4182. do { \
  4183. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4184. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4185. } while (0)
  4186. /* for systems using 64-bit format for bus addr */
  4187. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4188. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4189. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4192. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4193. } while (0)
  4194. /* for systems using 64-bit format for bus addr */
  4195. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4196. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4197. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4200. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4201. } while (0)
  4202. /* for systems using 32-bit format for bus addr */
  4203. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4204. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4205. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4208. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4209. } while (0)
  4210. /* for systems using 64-bit format for bus addr */
  4211. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4212. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4213. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4214. do { \
  4215. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4216. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4217. } while (0)
  4218. /* for systems using 64-bit format for bus addr */
  4219. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4220. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4221. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4224. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4225. } while (0)
  4226. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4227. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4228. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4231. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4232. } while (0)
  4233. /* for systems using 32-bit format for bus addr */
  4234. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4235. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4236. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4239. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4240. } while (0)
  4241. /* for systems using 64-bit format for bus addr */
  4242. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4243. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4244. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4245. do { \
  4246. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4247. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4248. } while (0)
  4249. /* for systems using 64-bit format for bus addr */
  4250. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4251. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4252. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4253. do { \
  4254. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4255. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4256. } while (0)
  4257. /* for systems using 32-bit format for bus addr */
  4258. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4259. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4260. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4263. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4264. } while (0)
  4265. /* for systems using 64-bit format for bus addr */
  4266. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4267. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4268. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4271. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4272. } while (0)
  4273. /* for systems using 64-bit format for bus addr */
  4274. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4275. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4276. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4279. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4280. } while (0)
  4281. /* for systems using 32-bit format for bus addr */
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4283. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4285. do { \
  4286. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4287. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4288. } while (0)
  4289. /* for systems using 64-bit format for bus addr */
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4291. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4293. do { \
  4294. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4295. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4296. } while (0)
  4297. /* for systems using 64-bit format for bus addr */
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4299. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4300. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4301. do { \
  4302. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4303. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4304. } while (0)
  4305. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4306. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4307. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4308. do { \
  4309. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4310. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4311. } while (0)
  4312. /* for systems using 32-bit format for bus addr */
  4313. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4314. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4315. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4318. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4319. } while (0)
  4320. /* for systems using 64-bit format for bus addr */
  4321. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4322. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4323. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4324. do { \
  4325. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4326. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4327. } while (0)
  4328. /* for systems using 64-bit format for bus addr */
  4329. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4330. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4331. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4332. do { \
  4333. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4334. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4335. } while (0)
  4336. /* for systems using 32-bit format for bus addr */
  4337. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4338. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4339. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4340. do { \
  4341. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4342. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4343. } while (0)
  4344. /* for systems using 64-bit format for bus addr */
  4345. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4346. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4347. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4348. do { \
  4349. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4350. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4351. } while (0)
  4352. /* for systems using 64-bit format for bus addr */
  4353. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4354. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4355. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4356. do { \
  4357. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4358. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4359. } while (0)
  4360. /*
  4361. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4362. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4363. * addresses are stored in a XXX-bit field.
  4364. * This macro is used to define both htt_wdi_ipa_config32_t and
  4365. * htt_wdi_ipa_config64_t structs.
  4366. */
  4367. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4368. _paddr__tx_comp_ring_base_addr_, \
  4369. _paddr__tx_comp_wr_idx_addr_, \
  4370. _paddr__tx_ce_wr_idx_addr_, \
  4371. _paddr__rx_ind_ring_base_addr_, \
  4372. _paddr__rx_ind_rd_idx_addr_, \
  4373. _paddr__rx_ind_wr_idx_addr_, \
  4374. _paddr__rx_ring2_base_addr_,\
  4375. _paddr__rx_ring2_rd_idx_addr_,\
  4376. _paddr__rx_ring2_wr_idx_addr_) \
  4377. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4378. { \
  4379. /* DWORD 0: flags and meta-data */ \
  4380. A_UINT32 \
  4381. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4382. reserved: 8, \
  4383. tx_pkt_pool_size: 16;\
  4384. /* DWORD 1 */\
  4385. _paddr__tx_comp_ring_base_addr_;\
  4386. /* DWORD 2 (or 3)*/\
  4387. A_UINT32 tx_comp_ring_size;\
  4388. /* DWORD 3 (or 4)*/\
  4389. _paddr__tx_comp_wr_idx_addr_;\
  4390. /* DWORD 4 (or 6)*/\
  4391. _paddr__tx_ce_wr_idx_addr_;\
  4392. /* DWORD 5 (or 8)*/\
  4393. _paddr__rx_ind_ring_base_addr_;\
  4394. /* DWORD 6 (or 10)*/\
  4395. A_UINT32 rx_ind_ring_size;\
  4396. /* DWORD 7 (or 11)*/\
  4397. _paddr__rx_ind_rd_idx_addr_;\
  4398. /* DWORD 8 (or 13)*/\
  4399. _paddr__rx_ind_wr_idx_addr_;\
  4400. /* DWORD 9 (or 15)*/\
  4401. _paddr__rx_ring2_base_addr_;\
  4402. /* DWORD 10 (or 17) */\
  4403. A_UINT32 rx_ring2_size;\
  4404. /* DWORD 11 (or 18) */\
  4405. _paddr__rx_ring2_rd_idx_addr_;\
  4406. /* DWORD 12 (or 20) */\
  4407. _paddr__rx_ring2_wr_idx_addr_;\
  4408. } POSTPACK
  4409. /* define a htt_wdi_ipa_config32_t type */
  4410. 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));
  4411. /* define a htt_wdi_ipa_config64_t type */
  4412. 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));
  4413. #if HTT_PADDR64
  4414. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4415. #else
  4416. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4417. #endif
  4418. enum htt_wdi_ipa_op_code {
  4419. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4420. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4421. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4422. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4423. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4424. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4425. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4426. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4427. /* keep this last */
  4428. HTT_WDI_IPA_OPCODE_MAX
  4429. };
  4430. /**
  4431. * @brief HTT WDI_IPA Operation Request Message
  4432. *
  4433. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4434. *
  4435. * @details
  4436. * HTT WDI_IPA Operation Request message is sent by host
  4437. * to either suspend or resume WDI_IPA TX or RX path.
  4438. * |31 24|23 16|15 8|7 0|
  4439. * |----------------+----------------+----------------+----------------|
  4440. * | op_code | Rsvd | msg_type |
  4441. * |-------------------------------------------------------------------|
  4442. *
  4443. * Header fields:
  4444. * - MSG_TYPE
  4445. * Bits 7:0
  4446. * Purpose: Identifies this as WDI_IPA Operation Request message
  4447. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4448. * - OP_CODE
  4449. * Bits 31:16
  4450. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4451. * value: = enum htt_wdi_ipa_op_code
  4452. */
  4453. PREPACK struct htt_wdi_ipa_op_request_t
  4454. {
  4455. /* DWORD 0: flags and meta-data */
  4456. A_UINT32
  4457. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4458. reserved: 8,
  4459. op_code: 16;
  4460. } POSTPACK;
  4461. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4462. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4463. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4464. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4465. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4466. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4467. do { \
  4468. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4469. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4470. } while (0)
  4471. /*
  4472. * @brief host -> target HTT_MSI_SETUP message
  4473. *
  4474. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4475. *
  4476. * @details
  4477. * After target is booted up, host can send MSI setup message so that
  4478. * target sets up HW registers based on setup message.
  4479. *
  4480. * The message would appear as follows:
  4481. * |31 24|23 16|15|14 8|7 0|
  4482. * |---------------+-----------------+-----------------+-----------------|
  4483. * | reserved | msi_type | pdev_id | msg_type |
  4484. * |---------------------------------------------------------------------|
  4485. * | msi_addr_lo |
  4486. * |---------------------------------------------------------------------|
  4487. * | msi_addr_hi |
  4488. * |---------------------------------------------------------------------|
  4489. * | msi_data |
  4490. * |---------------------------------------------------------------------|
  4491. *
  4492. * The message is interpreted as follows:
  4493. * dword0 - b'0:7 - msg_type: This will be set to
  4494. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4495. * b'8:15 - pdev_id:
  4496. * 0 (for rings at SOC/UMAC level),
  4497. * 1/2/3 mac id (for rings at LMAC level)
  4498. * b'16:23 - msi_type: identify which msi registers need to be setup
  4499. * more details can be got from enum htt_msi_setup_type
  4500. * b'24:31 - reserved
  4501. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4502. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4503. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4504. */
  4505. PREPACK struct htt_msi_setup_t {
  4506. A_UINT32 msg_type: 8,
  4507. pdev_id: 8,
  4508. msi_type: 8,
  4509. reserved: 8;
  4510. A_UINT32 msi_addr_lo;
  4511. A_UINT32 msi_addr_hi;
  4512. A_UINT32 msi_data;
  4513. } POSTPACK;
  4514. enum htt_msi_setup_type {
  4515. HTT_PPDU_END_MSI_SETUP_TYPE,
  4516. /* Insert new types here*/
  4517. };
  4518. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4519. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4520. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4521. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4522. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4523. HTT_MSI_SETUP_PDEV_ID_S)
  4524. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4525. do { \
  4526. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4527. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4528. } while (0)
  4529. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4530. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4531. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4532. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4533. HTT_MSI_SETUP_MSI_TYPE_S)
  4534. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4535. do { \
  4536. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4537. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4538. } while (0)
  4539. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4540. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4541. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4542. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4543. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4544. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4547. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4548. } while (0)
  4549. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4550. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4551. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4552. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4553. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4554. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4555. do { \
  4556. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4557. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4558. } while (0)
  4559. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4560. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4561. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4562. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4563. HTT_MSI_SETUP_MSI_DATA_S)
  4564. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4565. do { \
  4566. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4567. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4568. } while (0)
  4569. /*
  4570. * @brief host -> target HTT_SRING_SETUP message
  4571. *
  4572. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4573. *
  4574. * @details
  4575. * After target is booted up, Host can send SRING setup message for
  4576. * each host facing LMAC SRING. Target setups up HW registers based
  4577. * on setup message and confirms back to Host if response_required is set.
  4578. * Host should wait for confirmation message before sending new SRING
  4579. * setup message
  4580. *
  4581. * The message would appear as follows:
  4582. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4583. * |--------------- +-----------------+-----------------+-----------------|
  4584. * | ring_type | ring_id | pdev_id | msg_type |
  4585. * |----------------------------------------------------------------------|
  4586. * | ring_base_addr_lo |
  4587. * |----------------------------------------------------------------------|
  4588. * | ring_base_addr_hi |
  4589. * |----------------------------------------------------------------------|
  4590. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4591. * |----------------------------------------------------------------------|
  4592. * | ring_head_offset32_remote_addr_lo |
  4593. * |----------------------------------------------------------------------|
  4594. * | ring_head_offset32_remote_addr_hi |
  4595. * |----------------------------------------------------------------------|
  4596. * | ring_tail_offset32_remote_addr_lo |
  4597. * |----------------------------------------------------------------------|
  4598. * | ring_tail_offset32_remote_addr_hi |
  4599. * |----------------------------------------------------------------------|
  4600. * | ring_msi_addr_lo |
  4601. * |----------------------------------------------------------------------|
  4602. * | ring_msi_addr_hi |
  4603. * |----------------------------------------------------------------------|
  4604. * | ring_msi_data |
  4605. * |----------------------------------------------------------------------|
  4606. * | intr_timer_th |IM| intr_batch_counter_th |
  4607. * |----------------------------------------------------------------------|
  4608. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4609. * |----------------------------------------------------------------------|
  4610. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4611. * |----------------------------------------------------------------------|
  4612. * Where
  4613. * IM = sw_intr_mode
  4614. * RR = response_required
  4615. * PTCF = prefetch_timer_cfg
  4616. * IP = IPA drop flag
  4617. *
  4618. * The message is interpreted as follows:
  4619. * dword0 - b'0:7 - msg_type: This will be set to
  4620. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4621. * b'8:15 - pdev_id:
  4622. * 0 (for rings at SOC/UMAC level),
  4623. * 1/2/3 mac id (for rings at LMAC level)
  4624. * b'16:23 - ring_id: identify which ring is to setup,
  4625. * more details can be got from enum htt_srng_ring_id
  4626. * b'24:31 - ring_type: identify type of host rings,
  4627. * more details can be got from enum htt_srng_ring_type
  4628. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4629. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4630. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4631. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4632. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4633. * SW_TO_HW_RING.
  4634. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4635. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4636. * Lower 32 bits of memory address of the remote variable
  4637. * storing the 4-byte word offset that identifies the head
  4638. * element within the ring.
  4639. * (The head offset variable has type A_UINT32.)
  4640. * Valid for HW_TO_SW and SW_TO_SW rings.
  4641. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4642. * Upper 32 bits of memory address of the remote variable
  4643. * storing the 4-byte word offset that identifies the head
  4644. * element within the ring.
  4645. * (The head offset variable has type A_UINT32.)
  4646. * Valid for HW_TO_SW and SW_TO_SW rings.
  4647. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4648. * Lower 32 bits of memory address of the remote variable
  4649. * storing the 4-byte word offset that identifies the tail
  4650. * element within the ring.
  4651. * (The tail offset variable has type A_UINT32.)
  4652. * Valid for HW_TO_SW and SW_TO_SW rings.
  4653. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4654. * Upper 32 bits of memory address of the remote variable
  4655. * storing the 4-byte word offset that identifies the tail
  4656. * element within the ring.
  4657. * (The tail offset variable has type A_UINT32.)
  4658. * Valid for HW_TO_SW and SW_TO_SW rings.
  4659. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4660. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4661. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4662. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4663. * dword10 - b'0:31 - ring_msi_data: MSI data
  4664. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4665. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4666. * dword11 - b'0:14 - intr_batch_counter_th:
  4667. * batch counter threshold is in units of 4-byte words.
  4668. * HW internally maintains and increments batch count.
  4669. * (see SRING spec for detail description).
  4670. * When batch count reaches threshold value, an interrupt
  4671. * is generated by HW.
  4672. * b'15 - sw_intr_mode:
  4673. * This configuration shall be static.
  4674. * Only programmed at power up.
  4675. * 0: generate pulse style sw interrupts
  4676. * 1: generate level style sw interrupts
  4677. * b'16:31 - intr_timer_th:
  4678. * The timer init value when timer is idle or is
  4679. * initialized to start downcounting.
  4680. * In 8us units (to cover a range of 0 to 524 ms)
  4681. * dword12 - b'0:15 - intr_low_threshold:
  4682. * Used only by Consumer ring to generate ring_sw_int_p.
  4683. * Ring entries low threshold water mark, that is used
  4684. * in combination with the interrupt timer as well as
  4685. * the the clearing of the level interrupt.
  4686. * b'16:18 - prefetch_timer_cfg:
  4687. * Used only by Consumer ring to set timer mode to
  4688. * support Application prefetch handling.
  4689. * The external tail offset/pointer will be updated
  4690. * at following intervals:
  4691. * 3'b000: (Prefetch feature disabled; used only for debug)
  4692. * 3'b001: 1 usec
  4693. * 3'b010: 4 usec
  4694. * 3'b011: 8 usec (default)
  4695. * 3'b100: 16 usec
  4696. * Others: Reserved
  4697. * b'19 - response_required:
  4698. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4699. * b'20 - ipa_drop_flag:
  4700. Indicates that host will config ipa drop threshold percentage
  4701. * b'21:31 - reserved: reserved for future use
  4702. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4703. * b'8:15 - ipa drop high threshold percentage:
  4704. * b'16:31 - Reserved
  4705. */
  4706. PREPACK struct htt_sring_setup_t {
  4707. A_UINT32 msg_type: 8,
  4708. pdev_id: 8,
  4709. ring_id: 8,
  4710. ring_type: 8;
  4711. A_UINT32 ring_base_addr_lo;
  4712. A_UINT32 ring_base_addr_hi;
  4713. A_UINT32 ring_size: 16,
  4714. ring_entry_size: 8,
  4715. ring_misc_cfg_flag: 8;
  4716. A_UINT32 ring_head_offset32_remote_addr_lo;
  4717. A_UINT32 ring_head_offset32_remote_addr_hi;
  4718. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4719. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4720. A_UINT32 ring_msi_addr_lo;
  4721. A_UINT32 ring_msi_addr_hi;
  4722. A_UINT32 ring_msi_data;
  4723. A_UINT32 intr_batch_counter_th: 15,
  4724. sw_intr_mode: 1,
  4725. intr_timer_th: 16;
  4726. A_UINT32 intr_low_threshold: 16,
  4727. prefetch_timer_cfg: 3,
  4728. response_required: 1,
  4729. ipa_drop_flag: 1,
  4730. reserved1: 11;
  4731. A_UINT32 ipa_drop_low_threshold: 8,
  4732. ipa_drop_high_threshold: 8,
  4733. reserved: 16;
  4734. } POSTPACK;
  4735. enum htt_srng_ring_type {
  4736. HTT_HW_TO_SW_RING = 0,
  4737. HTT_SW_TO_HW_RING,
  4738. HTT_SW_TO_SW_RING,
  4739. /* Insert new ring types above this line */
  4740. };
  4741. enum htt_srng_ring_id {
  4742. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4743. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4744. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4745. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4746. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4747. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4748. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4749. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4750. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4751. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4752. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4753. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4754. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4755. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4756. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4757. /* Add Other SRING which can't be directly configured by host software above this line */
  4758. };
  4759. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4760. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4761. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4762. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4763. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4764. HTT_SRING_SETUP_PDEV_ID_S)
  4765. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4766. do { \
  4767. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4768. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4769. } while (0)
  4770. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4771. #define HTT_SRING_SETUP_RING_ID_S 16
  4772. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4773. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4774. HTT_SRING_SETUP_RING_ID_S)
  4775. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4776. do { \
  4777. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4778. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4779. } while (0)
  4780. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4781. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4782. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4783. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4784. HTT_SRING_SETUP_RING_TYPE_S)
  4785. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4786. do { \
  4787. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4788. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4789. } while (0)
  4790. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4791. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4792. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4793. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4794. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4795. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4796. do { \
  4797. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4798. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4799. } while (0)
  4800. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4801. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4802. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4803. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4804. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4805. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4806. do { \
  4807. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4808. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4809. } while (0)
  4810. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4811. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4812. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4813. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4814. HTT_SRING_SETUP_RING_SIZE_S)
  4815. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4816. do { \
  4817. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4818. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4819. } while (0)
  4820. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4821. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4822. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4823. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4824. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4825. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4826. do { \
  4827. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4828. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4829. } while (0)
  4830. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4831. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4832. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4833. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4834. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4835. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4836. do { \
  4837. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4838. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4839. } while (0)
  4840. /* This control bit is applicable to only Producer, which updates Ring ID field
  4841. * of each descriptor before pushing into the ring.
  4842. * 0: updates ring_id(default)
  4843. * 1: ring_id updating disabled */
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4845. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4847. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4848. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4850. do { \
  4851. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4852. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4853. } while (0)
  4854. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4855. * of each descriptor before pushing into the ring.
  4856. * 0: updates Loopcnt(default)
  4857. * 1: Loopcnt updating disabled */
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4861. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4862. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4864. do { \
  4865. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4866. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4867. } while (0)
  4868. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4869. * into security_id port of GXI/AXI. */
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4873. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4874. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4876. do { \
  4877. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4878. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4879. } while (0)
  4880. /* During MSI write operation, SRNG drives value of this register bit into
  4881. * swap bit of GXI/AXI. */
  4882. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4884. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4885. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4886. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4887. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4888. do { \
  4889. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4890. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4891. } while (0)
  4892. /* During Pointer write operation, SRNG drives value of this register bit into
  4893. * swap bit of GXI/AXI. */
  4894. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4896. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4897. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4898. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4899. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4900. do { \
  4901. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4902. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4903. } while (0)
  4904. /* During any data or TLV write operation, SRNG drives value of this register
  4905. * bit into swap bit of GXI/AXI. */
  4906. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4907. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4908. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4909. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4910. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4911. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4912. do { \
  4913. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4914. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4915. } while (0)
  4916. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4917. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4918. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4919. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4920. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4921. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4922. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4923. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4924. do { \
  4925. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4926. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4927. } while (0)
  4928. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4929. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4930. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4931. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4932. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4933. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4934. do { \
  4935. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4936. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4937. } while (0)
  4938. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4939. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4940. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4941. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4942. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4943. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4944. do { \
  4945. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4946. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4947. } while (0)
  4948. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4949. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4950. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4951. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4952. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4953. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4954. do { \
  4955. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4956. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4957. } while (0)
  4958. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4959. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4960. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4961. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4962. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4963. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4964. do { \
  4965. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4966. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4967. } while (0)
  4968. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4969. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4970. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4971. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4972. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4973. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4974. do { \
  4975. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4976. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4977. } while (0)
  4978. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4979. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4980. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4981. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4982. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4983. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4984. do { \
  4985. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4986. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4987. } while (0)
  4988. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4989. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4990. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4991. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4992. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4993. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4994. do { \
  4995. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4996. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4997. } while (0)
  4998. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4999. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  5000. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  5001. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  5002. HTT_SRING_SETUP_SW_INTR_MODE_S)
  5003. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5004. do { \
  5005. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5006. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5007. } while (0)
  5008. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5009. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5010. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5011. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5012. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5013. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5014. do { \
  5015. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5016. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5017. } while (0)
  5018. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5019. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5020. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5021. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5022. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5023. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5024. do { \
  5025. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5026. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5027. } while (0)
  5028. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5029. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5030. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5031. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5032. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5033. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5034. do { \
  5035. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5036. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5037. } while (0)
  5038. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5039. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5040. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5041. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5042. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5043. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5044. do { \
  5045. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5046. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5047. } while (0)
  5048. /**
  5049. * @brief host -> target RX ring selection config message
  5050. *
  5051. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5052. *
  5053. * @details
  5054. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5055. * configure RXDMA rings.
  5056. * The configuration is per ring based and includes both packet subtypes
  5057. * and PPDU/MPDU TLVs.
  5058. *
  5059. * The message would appear as follows:
  5060. *
  5061. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5062. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5063. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5064. * |-----------------------+-----+-----+--------------------------------|
  5065. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5066. * |--------------------------------------------------------------------|
  5067. * | packet_type_enable_flags_0 |
  5068. * |--------------------------------------------------------------------|
  5069. * | packet_type_enable_flags_1 |
  5070. * |--------------------------------------------------------------------|
  5071. * | packet_type_enable_flags_2 |
  5072. * |--------------------------------------------------------------------|
  5073. * | packet_type_enable_flags_3 |
  5074. * |--------------------------------------------------------------------|
  5075. * | tlv_filter_in_flags |
  5076. * |-----------------------------------+--------------------------------|
  5077. * | rx_header_offset | rx_packet_offset |
  5078. * |-----------------------------------+--------------------------------|
  5079. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5080. * |-----------------------------------+--------------------------------|
  5081. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5082. * |-----------------------------------+--------------------------------|
  5083. * | rsvd3 | rx_attention_offset |
  5084. * |--------------------------------------------------------------------|
  5085. * | rsvd4 | mo| fp| rx_drop_threshold |
  5086. * | |ndp|ndp| |
  5087. * |--------------------------------------------------------------------|
  5088. * Where:
  5089. * PS = pkt_swap
  5090. * SS = status_swap
  5091. * OV = rx_offsets_valid
  5092. * DT = drop_thresh_valid
  5093. * CLM = config_length_mgmt
  5094. * CLC = config_length_ctrl
  5095. * CLD = config_length_data
  5096. * RXHDL = rx_hdr_len
  5097. * RX = rxpcu_filter_enable_flag
  5098. * The message is interpreted as follows:
  5099. * dword0 - b'0:7 - msg_type: This will be set to
  5100. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5101. * b'8:15 - pdev_id:
  5102. * 0 (for rings at SOC/UMAC level),
  5103. * 1/2/3 mac id (for rings at LMAC level)
  5104. * b'16:23 - ring_id : Identify the ring to configure.
  5105. * More details can be got from enum htt_srng_ring_id
  5106. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5107. * BUF_RING_CFG_0 defs within HW .h files,
  5108. * e.g. wmac_top_reg_seq_hwioreg.h
  5109. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5110. * BUF_RING_CFG_0 defs within HW .h files,
  5111. * e.g. wmac_top_reg_seq_hwioreg.h
  5112. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5113. * configuration fields are valid
  5114. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5115. * rx_drop_threshold field is valid
  5116. * b'28 - rx_mon_global_en: Enable/Disable global register
  5117. 8 configuration in Rx monitor module.
  5118. * b'29:31 - rsvd1: reserved for future use
  5119. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5120. * in byte units.
  5121. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5122. * b'16:18 - config_length_mgmt (MGMT):
  5123. * Represents the length of mpdu bytes for mgmt pkt.
  5124. * valid values:
  5125. * 001 - 64bytes
  5126. * 010 - 128bytes
  5127. * 100 - 256bytes
  5128. * 111 - Full mpdu bytes
  5129. * b'19:21 - config_length_ctrl (CTRL):
  5130. * Represents the length of mpdu bytes for ctrl pkt.
  5131. * valid values:
  5132. * 001 - 64bytes
  5133. * 010 - 128bytes
  5134. * 100 - 256bytes
  5135. * 111 - Full mpdu bytes
  5136. * b'22:24 - config_length_data (DATA):
  5137. * Represents the length of mpdu bytes for data pkt.
  5138. * valid values:
  5139. * 001 - 64bytes
  5140. * 010 - 128bytes
  5141. * 100 - 256bytes
  5142. * 111 - Full mpdu bytes
  5143. * b'25:26 - rx_hdr_len:
  5144. * Specifies the number of bytes of recvd packet to copy
  5145. * into the rx_hdr tlv.
  5146. * supported values for now by host:
  5147. * 01 - 64bytes
  5148. * 10 - 128bytes
  5149. * 11 - 256bytes
  5150. * default - 128 bytes
  5151. * b'27 - rxpcu_filter_enable_flag
  5152. * For Scan Radio Host CPU utilization is very high.
  5153. * In order to reduce CPU utilization we need to filter out
  5154. * certain configured MAC frames.
  5155. * To filter out configured MAC address frames, RxPCU should
  5156. * be zero which means allow all frames for MD at RxOLE
  5157. * host wil fiter out frames.
  5158. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5159. * b'28:31 - rsvd2: Reserved for future use
  5160. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5161. * Enable MGMT packet from 0b0000 to 0b1001
  5162. * bits from low to high: FP, MD, MO - 3 bits
  5163. * FP: Filter_Pass
  5164. * MD: Monitor_Direct
  5165. * MO: Monitor_Other
  5166. * 10 mgmt subtypes * 3 bits -> 30 bits
  5167. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5168. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5169. * Enable MGMT packet from 0b1010 to 0b1111
  5170. * bits from low to high: FP, MD, MO - 3 bits
  5171. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5172. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5173. * Enable CTRL packet from 0b0000 to 0b1001
  5174. * bits from low to high: FP, MD, MO - 3 bits
  5175. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5176. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5177. * Enable CTRL packet from 0b1010 to 0b1111,
  5178. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5179. * bits from low to high: FP, MD, MO - 3 bits
  5180. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5181. * dword6 - b'0:31 - tlv_filter_in_flags:
  5182. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5183. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5184. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5185. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5186. * A value of 0 will be considered as ignore this config.
  5187. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5188. * e.g. wmac_top_reg_seq_hwioreg.h
  5189. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5190. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5191. * A value of 0 will be considered as ignore this config.
  5192. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5193. * e.g. wmac_top_reg_seq_hwioreg.h
  5194. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5195. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5196. * A value of 0 will be considered as ignore this config.
  5197. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5198. * e.g. wmac_top_reg_seq_hwioreg.h
  5199. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5200. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5201. * A value of 0 will be considered as ignore this config.
  5202. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5203. * e.g. wmac_top_reg_seq_hwioreg.h
  5204. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5205. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5206. * A value of 0 will be considered as ignore this config.
  5207. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5208. * e.g. wmac_top_reg_seq_hwioreg.h
  5209. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5210. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5211. * A value of 0 will be considered as ignore this config.
  5212. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5213. * e.g. wmac_top_reg_seq_hwioreg.h
  5214. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5215. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5216. * A value of 0 will be considered as ignore this config.
  5217. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5218. * e.g. wmac_top_reg_seq_hwioreg.h
  5219. * - b'16:31 - rsvd3 for future use
  5220. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5221. * to source rings. Consumer drops packets if the available
  5222. * words in the ring falls below the configured threshold
  5223. * value.
  5224. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5225. * by host. 1 -> subscribed
  5226. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5227. * by host. 1 -> subscribed
  5228. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5229. * subscribed by host. 1 -> subscribed
  5230. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5231. * selection for the FP PHY ERR status tlv.
  5232. * 0 - wbm2rxdma_buf_source_ring
  5233. * 1 - fw2rxdma_buf_source_ring
  5234. * 2 - sw2rxdma_buf_source_ring
  5235. * 3 - no_buffer_ring
  5236. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5237. * selection for the FP PHY ERR status tlv.
  5238. * 0 - rxdma_release_ring
  5239. * 1 - rxdma2fw_ring
  5240. * 2 - rxdma2sw_ring
  5241. * 3 - rxdma2reo_ring
  5242. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5243. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5244. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5245. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5246. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5247. * 0: MSDU level logging
  5248. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5249. * 0: MSDU level logging
  5250. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5251. * 0: MSDU level logging
  5252. * - b'23 - word_mask_compaction: enable/disable word mask for
  5253. * mpdu/msdu start/end tlvs
  5254. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5255. * manager override
  5256. * - b'25:28 - rbm_override_val: return buffer manager override value
  5257. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5258. * which have to be posted to host from phy.
  5259. * Corresponding to errors defined in
  5260. * phyrx_abort_request_reason enums 0 to 31.
  5261. * Refer to RXPCU register definition header files for the
  5262. * phyrx_abort_request_reason enum definition.
  5263. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5264. * errors which have to be posted to host from phy.
  5265. * Corresponding to errors defined in
  5266. * phyrx_abort_request_reason enums 32 to 63.
  5267. * Refer to RXPCU register definition header files for the
  5268. * phyrx_abort_request_reason enum definition.
  5269. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5270. * applicable if word mask enabled
  5271. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5272. * applicable if word mask enabled
  5273. * - b'19:31 - rsvd7
  5274. * dword15- b'0:16 - rx_msdu_end_word_mask
  5275. * - b'17:31 - rsvd5
  5276. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5277. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5278. * buffer
  5279. * 1: RX_PKT TLV logging at specified offset for the
  5280. * subsequent buffer
  5281. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5282. */
  5283. PREPACK struct htt_rx_ring_selection_cfg_t {
  5284. A_UINT32 msg_type: 8,
  5285. pdev_id: 8,
  5286. ring_id: 8,
  5287. status_swap: 1,
  5288. pkt_swap: 1,
  5289. rx_offsets_valid: 1,
  5290. drop_thresh_valid: 1,
  5291. rx_mon_global_en: 1,
  5292. rsvd1: 3;
  5293. A_UINT32 ring_buffer_size: 16,
  5294. config_length_mgmt:3,
  5295. config_length_ctrl:3,
  5296. config_length_data:3,
  5297. rx_hdr_len: 2,
  5298. rxpcu_filter_enable_flag:1,
  5299. rsvd2: 4;
  5300. A_UINT32 packet_type_enable_flags_0;
  5301. A_UINT32 packet_type_enable_flags_1;
  5302. A_UINT32 packet_type_enable_flags_2;
  5303. A_UINT32 packet_type_enable_flags_3;
  5304. A_UINT32 tlv_filter_in_flags;
  5305. A_UINT32 rx_packet_offset: 16,
  5306. rx_header_offset: 16;
  5307. A_UINT32 rx_mpdu_end_offset: 16,
  5308. rx_mpdu_start_offset: 16;
  5309. A_UINT32 rx_msdu_end_offset: 16,
  5310. rx_msdu_start_offset: 16;
  5311. A_UINT32 rx_attn_offset: 16,
  5312. rsvd3: 16;
  5313. A_UINT32 rx_drop_threshold: 10,
  5314. fp_ndp: 1,
  5315. mo_ndp: 1,
  5316. fp_phy_err: 1,
  5317. fp_phy_err_buf_src: 2,
  5318. fp_phy_err_buf_dest: 2,
  5319. pkt_type_enable_msdu_or_mpdu_logging:3,
  5320. dma_mpdu_mgmt: 1,
  5321. dma_mpdu_ctrl: 1,
  5322. dma_mpdu_data: 1,
  5323. word_mask_compaction_enable:1,
  5324. rbm_override_enable: 1,
  5325. rbm_override_val: 4,
  5326. rsvd4: 3;
  5327. A_UINT32 phy_err_mask;
  5328. A_UINT32 phy_err_mask_cont;
  5329. A_UINT32 rx_mpdu_start_word_mask:16,
  5330. rx_mpdu_end_word_mask: 3,
  5331. rsvd7: 13;
  5332. A_UINT32 rx_msdu_end_word_mask: 17,
  5333. rsvd5: 15;
  5334. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5335. rx_pkt_tlv_offset: 15,
  5336. rsvd6: 16;
  5337. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5338. rx_mpdu_end_word_mask_v2: 8,
  5339. rsvd8: 4;
  5340. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5341. rsvd9: 12;
  5342. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5343. rsvd10: 12;
  5344. A_UINT32 packet_type_enable_fpmo_flags0;
  5345. A_UINT32 packet_type_enable_fpmo_flags1;
  5346. } POSTPACK;
  5347. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5348. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5349. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5350. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5351. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5352. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5353. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5354. do { \
  5355. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5356. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5357. } while (0)
  5358. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5359. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5360. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5361. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5362. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5363. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5364. do { \
  5365. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5366. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5367. } while (0)
  5368. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5369. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5370. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5371. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5372. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5373. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5374. do { \
  5375. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5376. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5377. } while (0)
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5381. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5382. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5383. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5384. do { \
  5385. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5386. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5387. } while (0)
  5388. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5389. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5390. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5391. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5392. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5393. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5394. do { \
  5395. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5396. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5397. } while (0)
  5398. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5399. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5400. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5401. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5402. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5403. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5404. do { \
  5405. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5406. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5407. } while (0)
  5408. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5409. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5410. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5411. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5412. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5413. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5414. do { \
  5415. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5416. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5417. } while (0)
  5418. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5419. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5420. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5421. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5422. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5423. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5424. do { \
  5425. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5426. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5427. } while (0)
  5428. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5429. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5430. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5431. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5432. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5433. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5434. do { \
  5435. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5436. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5437. } while (0)
  5438. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5439. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5440. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5441. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5442. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5443. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5446. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5447. } while (0)
  5448. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5449. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5450. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5451. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5452. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5453. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5454. do { \
  5455. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5456. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5457. } while (0)
  5458. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5459. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5460. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5461. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5462. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5463. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5466. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5467. } while(0)
  5468. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5469. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5470. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5471. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5472. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5473. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5474. do { \
  5475. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5476. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5477. } while(0)
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5481. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5482. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5484. do { \
  5485. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5486. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5487. } while (0)
  5488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5491. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5492. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5496. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5497. } while (0)
  5498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5501. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5502. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5506. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5507. } while (0)
  5508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5511. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5512. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5516. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5517. } while (0)
  5518. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5519. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5520. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5521. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5522. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5523. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5524. do { \
  5525. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5526. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5527. } while (0)
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5530. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5531. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5532. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5536. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5537. } while (0)
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5540. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5541. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5542. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5543. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5546. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5547. } while (0)
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5550. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5551. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5552. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5553. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5556. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5557. } while (0)
  5558. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5559. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5560. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5561. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5562. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5563. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5566. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5567. } while (0)
  5568. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5569. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5570. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5571. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5572. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5573. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5576. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5577. } while (0)
  5578. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5579. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5580. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5581. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5582. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5583. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5586. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5587. } while (0)
  5588. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5589. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5590. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5591. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5592. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5593. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5594. do { \
  5595. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5596. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5597. } while (0)
  5598. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5599. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5600. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5601. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5602. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5603. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5604. do { \
  5605. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5606. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5607. } while (0)
  5608. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5609. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5610. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5611. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5612. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5613. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5616. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5617. } while (0)
  5618. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5619. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5620. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5621. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5622. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5623. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5626. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5627. } while (0)
  5628. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5629. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5630. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5631. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5632. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5633. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5634. do { \
  5635. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5636. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5637. } while (0)
  5638. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5639. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5640. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5641. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5642. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5643. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5644. do { \
  5645. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5646. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5647. } while (0)
  5648. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5649. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5650. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5651. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5652. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5653. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5654. do { \
  5655. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5656. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5657. } while (0)
  5658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5661. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5662. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5664. do { \
  5665. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5666. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5667. } while (0)
  5668. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5669. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5670. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5671. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5672. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5673. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5674. do { \
  5675. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5676. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5677. } while (0)
  5678. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5679. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5680. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5681. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5682. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5683. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5684. do { \
  5685. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5686. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5687. } while (0)
  5688. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5689. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5690. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5691. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5692. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5693. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5694. do { \
  5695. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5696. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5697. } while (0)
  5698. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5699. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5700. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5701. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5702. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5703. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5704. do { \
  5705. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5706. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5707. } while (0)
  5708. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5709. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5710. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5711. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5712. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5713. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5714. do { \
  5715. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5716. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5717. } while (0)
  5718. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5719. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5720. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5721. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5722. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5723. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5724. do { \
  5725. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5726. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5727. } while (0)
  5728. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5729. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5730. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5731. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5732. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5733. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5734. do { \
  5735. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5736. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5737. } while (0)
  5738. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5739. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5740. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5741. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5742. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5743. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5744. do { \
  5745. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5746. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5747. } while (0)
  5748. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5749. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5750. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5751. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5752. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5753. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5754. do { \
  5755. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5756. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5757. } while (0)
  5758. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5759. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5760. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5761. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5762. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5763. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5764. do { \
  5765. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5766. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5767. } while (0)
  5768. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5769. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5770. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5771. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5772. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5773. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5774. do { \
  5775. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5776. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5777. } while (0)
  5778. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5779. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5780. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5781. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5782. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5783. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5784. do { \
  5785. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5786. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5787. } while (0)
  5788. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5789. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5790. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5791. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5792. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5793. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5794. do { \
  5795. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5796. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5797. } while (0)
  5798. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5799. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5800. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5801. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5802. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5803. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5804. do { \
  5805. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5806. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5807. } while (0)
  5808. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5809. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5810. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5811. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5812. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5813. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5814. do { \
  5815. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5816. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5817. } while (0)
  5818. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5819. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5820. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5821. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5822. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5823. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5824. do { \
  5825. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5826. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5827. } while (0)
  5828. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5829. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5830. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5831. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5832. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5833. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5834. do { \
  5835. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5836. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5837. } while (0)
  5838. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5839. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5840. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5841. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5842. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5843. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5844. do { \
  5845. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5846. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5847. } while (0)
  5848. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5849. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5850. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5851. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5852. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5853. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5854. do { \
  5855. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5856. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5857. } while (0)
  5858. /*
  5859. * Subtype based MGMT frames enable bits.
  5860. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5861. */
  5862. /* association request */
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5869. /* association response */
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5876. /* Reassociation request */
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5883. /* Reassociation response */
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5890. /* Probe request */
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5897. /* Probe response */
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5904. /* Timing Advertisement */
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5911. /* Reserved */
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5918. /* Beacon */
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5925. /* ATIM */
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5932. /* Disassociation */
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5939. /* Authentication */
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5946. /* Deauthentication */
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5953. /* Action */
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5960. /* Action No Ack */
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5967. /* Reserved */
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5974. /*
  5975. * Subtype based CTRL frames enable bits.
  5976. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5977. */
  5978. /* Reserved */
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5985. /* Reserved */
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5992. /* Reserved */
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5999. /* Reserved */
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6006. /* Reserved */
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6013. /* Reserved */
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6020. /* Reserved */
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6027. /* Control Wrapper */
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6034. /* Block Ack Request */
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6041. /* Block Ack*/
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6048. /* PS-POLL */
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6055. /* RTS */
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6062. /* CTS */
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6069. /* ACK */
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6076. /* CF-END */
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6083. /* CF-END + CF-ACK */
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6090. /* Multicast data */
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6097. /* Unicast data */
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6104. /* NULL data */
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6111. /* FPMO mode flags */
  6112. /* MGMT */
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6145. /* CTRL */
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6178. /* DATA */
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6190. do { \
  6191. HTT_CHECK_SET_VAL(httsym, value); \
  6192. (word) |= (value) << httsym##_S; \
  6193. } while (0)
  6194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6195. (((word) & httsym##_M) >> httsym##_S)
  6196. #define htt_rx_ring_pkt_enable_subtype_set( \
  6197. word, flag, mode, type, subtype, val) \
  6198. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6199. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6200. #define htt_rx_ring_pkt_enable_subtype_get( \
  6201. word, flag, mode, type, subtype) \
  6202. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6203. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6204. /* Definition to filter in TLVs */
  6205. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6223. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6231. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6232. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6233. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6234. do { \
  6235. HTT_CHECK_SET_VAL(httsym, enable); \
  6236. (word) |= (enable) << httsym##_S; \
  6237. } while (0)
  6238. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6239. (((word) & httsym##_M) >> httsym##_S)
  6240. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6241. HTT_RX_RING_TLV_ENABLE_SET( \
  6242. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6243. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6244. HTT_RX_RING_TLV_ENABLE_GET( \
  6245. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6246. /**
  6247. * @brief host -> target TX monitor config message
  6248. *
  6249. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6250. *
  6251. * @details
  6252. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6253. * configure RXDMA rings.
  6254. * The configuration is per ring based and includes both packet types
  6255. * and PPDU/MPDU TLVs.
  6256. *
  6257. * The message would appear as follows:
  6258. *
  6259. * |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|
  6260. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6261. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6262. * |-----------+--------+--------+-----+------------------------------------|
  6263. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6264. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6265. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6266. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6267. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6268. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6269. * |------------------------------------------------------------------------|
  6270. * | tlv_filter_mask_in0 |
  6271. * |------------------------------------------------------------------------|
  6272. * | tlv_filter_mask_in1 |
  6273. * |------------------------------------------------------------------------|
  6274. * | tlv_filter_mask_in2 |
  6275. * |------------------------------------------------------------------------|
  6276. * | tlv_filter_mask_in3 |
  6277. * |-----------------+-----------------+---------------------+--------------|
  6278. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6279. * |------------------------------------------------------------------------|
  6280. * | pcu_ppdu_setup_word_mask |
  6281. * |--------------------+--+--+--+-----+---------------------+--------------|
  6282. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6283. * |------------------------------------------------------------------------|
  6284. *
  6285. * Where:
  6286. * PS = pkt_swap
  6287. * SS = status_swap
  6288. * The message is interpreted as follows:
  6289. * dword0 - b'0:7 - msg_type: This will be set to
  6290. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6291. * b'8:15 - pdev_id:
  6292. * 0 (for rings at SOC level),
  6293. * 1/2/3 mac id (for rings at LMAC level)
  6294. * b'16:23 - ring_id : Identify the ring to configure.
  6295. * More details can be got from enum htt_srng_ring_id
  6296. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6297. * BUF_RING_CFG_0 defs within HW .h files,
  6298. * e.g. wmac_top_reg_seq_hwioreg.h
  6299. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6300. * BUF_RING_CFG_0 defs within HW .h files,
  6301. * e.g. wmac_top_reg_seq_hwioreg.h
  6302. * b'26 - tx_mon_global_en: Enable/Disable global register
  6303. * configuration in Tx monitor module.
  6304. * b'27:31 - rsvd1: reserved for future use
  6305. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6306. * in byte units.
  6307. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6308. * b'16:18 - config_length_mgmt(MGMT) for MGMT: 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'19:21 - config_length_ctrl(CTRL) for CTRL: 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'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6317. * 64, 128, 256.
  6318. * If all 3 bits are set config length is > 256.
  6319. * If val is '0', then ignore this field.
  6320. * - b'25:31 - rsvd2: Reserved for future use
  6321. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6322. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6323. * If packet_type_enable_flags is '1' for MGMT type,
  6324. * monitor will ignore this bit and allow this TLV.
  6325. * If packet_type_enable_flags is '0' for MGMT type,
  6326. * monitor will use this bit to enable/disable logging
  6327. * of this TLV.
  6328. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6329. * If packet_type_enable_flags is '1' for CTRL type,
  6330. * monitor will ignore this bit and allow this TLV.
  6331. * If packet_type_enable_flags is '0' for CTRL type,
  6332. * monitor will use this bit to enable/disable logging
  6333. * of this TLV.
  6334. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6335. * If packet_type_enable_flags is '1' for DATA type,
  6336. * monitor will ignore this bit and allow this TLV.
  6337. * If packet_type_enable_flags is '0' for DATA type,
  6338. * monitor will use this bit to enable/disable logging
  6339. * of this TLV.
  6340. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6341. * If packet_type_enable_flags is '1' for MGMT type,
  6342. * monitor will ignore this bit and allow this TLV.
  6343. * If packet_type_enable_flags is '0' for MGMT type,
  6344. * monitor will use this bit to enable/disable logging
  6345. * of this TLV.
  6346. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6347. * If packet_type_enable_flags is '1' for CTRL type,
  6348. * monitor will ignore this bit and allow this TLV.
  6349. * If packet_type_enable_flags is '0' for CTRL type,
  6350. * monitor will use this bit to enable/disable logging
  6351. * of this TLV.
  6352. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6353. * If packet_type_enable_flags is '1' for DATA type,
  6354. * monitor will ignore this bit and allow this TLV.
  6355. * If packet_type_enable_flags is '0' for DATA type,
  6356. * monitor will use this bit to enable/disable logging
  6357. * of this TLV.
  6358. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6359. * If packet_type_enable_flags is '1' for MGMT type,
  6360. * monitor will ignore this bit and allow this TLV.
  6361. * If packet_type_enable_flags is '0' for MGMT type,
  6362. * monitor will use this bit to enable/disable logging
  6363. * of this TLV.
  6364. * If filter_in_TX_MPDU_START = 1 it is recommended
  6365. * to set this bit.
  6366. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6367. * If packet_type_enable_flags is '1' for CTRL type,
  6368. * monitor will ignore this bit and allow this TLV.
  6369. * If packet_type_enable_flags is '0' for CTRL type,
  6370. * monitor will use this bit to enable/disable logging
  6371. * of this TLV.
  6372. * If filter_in_TX_MPDU_START = 1 it is recommended
  6373. * to set this bit.
  6374. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6375. * If packet_type_enable_flags is '1' for DATA type,
  6376. * monitor will ignore this bit and allow this TLV.
  6377. * If packet_type_enable_flags is '0' for DATA type,
  6378. * monitor will use this bit to enable/disable logging
  6379. * of this TLV.
  6380. * If filter_in_TX_MPDU_START = 1 it is recommended
  6381. * to set this bit.
  6382. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6383. * If packet_type_enable_flags is '1' for MGMT type,
  6384. * monitor will ignore this bit and allow this TLV.
  6385. * If packet_type_enable_flags is '0' for MGMT type,
  6386. * monitor will use this bit to enable/disable logging
  6387. * of this TLV.
  6388. * If filter_in_TX_MSDU_START = 1 it is recommended
  6389. * to set this bit.
  6390. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6391. * If packet_type_enable_flags is '1' for CTRL type,
  6392. * monitor will ignore this bit and allow this TLV.
  6393. * If packet_type_enable_flags is '0' for CTRL type,
  6394. * monitor will use this bit to enable/disable logging
  6395. * of this TLV.
  6396. * If filter_in_TX_MSDU_START = 1 it is recommended
  6397. * to set this bit.
  6398. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6399. * If packet_type_enable_flags is '1' for DATA type,
  6400. * monitor will ignore this bit and allow this TLV.
  6401. * If packet_type_enable_flags is '0' for DATA type,
  6402. * monitor will use this bit to enable/disable logging
  6403. * of this TLV.
  6404. * If filter_in_TX_MSDU_START = 1 it is recommended
  6405. * to set this bit.
  6406. * b'15:31 - rsvd3: Reserved for future use
  6407. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6408. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6409. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6410. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6411. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6412. * - b'8:15 - tx_peer_entry_word_mask:
  6413. * - b'16:23 - tx_queue_ext_word_mask:
  6414. * - b'24:31 - tx_msdu_start_word_mask:
  6415. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6416. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6417. * - b'8:15 - rxpcu_user_setup_word_mask:
  6418. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6419. * MGMT, CTRL, DATA
  6420. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6421. * 0 -> MSDU level logging is enabled
  6422. * (valid only if bit is set in
  6423. * pkt_type_enable_msdu_or_mpdu_logging)
  6424. * 1 -> MPDU level logging is enabled
  6425. * (valid only if bit is set in
  6426. * pkt_type_enable_msdu_or_mpdu_logging)
  6427. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6428. * 0 -> MSDU level logging is enabled
  6429. * (valid only if bit is set in
  6430. * pkt_type_enable_msdu_or_mpdu_logging)
  6431. * 1 -> MPDU level logging is enabled
  6432. * (valid only if bit is set in
  6433. * pkt_type_enable_msdu_or_mpdu_logging)
  6434. * - b'21 - dma_mpdu_data(D) : For DATA
  6435. * 0 -> MSDU level logging is enabled
  6436. * (valid only if bit is set in
  6437. * pkt_type_enable_msdu_or_mpdu_logging)
  6438. * 1 -> MPDU level logging is enabled
  6439. * (valid only if bit is set in
  6440. * pkt_type_enable_msdu_or_mpdu_logging)
  6441. * - b'22:31 - rsvd4 for future use
  6442. */
  6443. PREPACK struct htt_tx_monitor_cfg_t {
  6444. A_UINT32 msg_type: 8,
  6445. pdev_id: 8,
  6446. ring_id: 8,
  6447. status_swap: 1,
  6448. pkt_swap: 1,
  6449. tx_mon_global_en: 1,
  6450. rsvd1: 5;
  6451. A_UINT32 ring_buffer_size: 16,
  6452. config_length_mgmt: 3,
  6453. config_length_ctrl: 3,
  6454. config_length_data: 3,
  6455. rsvd2: 7;
  6456. A_UINT32 pkt_type_enable_flags: 3,
  6457. filter_in_tx_mpdu_start_mgmt: 1,
  6458. filter_in_tx_mpdu_start_ctrl: 1,
  6459. filter_in_tx_mpdu_start_data: 1,
  6460. filter_in_tx_msdu_start_mgmt: 1,
  6461. filter_in_tx_msdu_start_ctrl: 1,
  6462. filter_in_tx_msdu_start_data: 1,
  6463. filter_in_tx_mpdu_end_mgmt: 1,
  6464. filter_in_tx_mpdu_end_ctrl: 1,
  6465. filter_in_tx_mpdu_end_data: 1,
  6466. filter_in_tx_msdu_end_mgmt: 1,
  6467. filter_in_tx_msdu_end_ctrl: 1,
  6468. filter_in_tx_msdu_end_data: 1,
  6469. word_mask_compaction_enable: 1,
  6470. rsvd3: 16;
  6471. A_UINT32 tlv_filter_mask_in0;
  6472. A_UINT32 tlv_filter_mask_in1;
  6473. A_UINT32 tlv_filter_mask_in2;
  6474. A_UINT32 tlv_filter_mask_in3;
  6475. A_UINT32 tx_fes_setup_word_mask: 8,
  6476. tx_peer_entry_word_mask: 8,
  6477. tx_queue_ext_word_mask: 8,
  6478. tx_msdu_start_word_mask: 8;
  6479. A_UINT32 pcu_ppdu_setup_word_mask;
  6480. A_UINT32 tx_mpdu_start_word_mask: 8,
  6481. rxpcu_user_setup_word_mask: 8,
  6482. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6483. dma_mpdu_mgmt: 1,
  6484. dma_mpdu_ctrl: 1,
  6485. dma_mpdu_data: 1,
  6486. rsvd4: 10;
  6487. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6488. tx_peer_entry_v2_word_mask: 12,
  6489. rsvd5: 10;
  6490. A_UINT32 fes_status_end_word_mask: 16,
  6491. response_end_status_word_mask: 16;
  6492. A_UINT32 fes_status_prot_word_mask: 11,
  6493. rsvd6: 21;
  6494. } POSTPACK;
  6495. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6496. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6497. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6498. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6499. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6500. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6501. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6504. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6505. } while (0)
  6506. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6507. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6508. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6509. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6510. HTT_TX_MONITOR_CFG_RING_ID_S)
  6511. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6512. do { \
  6513. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6514. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6515. } while (0)
  6516. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6517. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6518. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6519. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6520. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6521. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6522. do { \
  6523. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6524. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6525. } while (0)
  6526. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6527. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6528. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6529. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6530. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6531. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6532. do { \
  6533. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6534. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6535. } while (0)
  6536. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6537. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6538. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6539. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6540. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6541. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6542. do { \
  6543. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6544. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6545. } while (0)
  6546. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6547. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6548. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6549. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6550. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6551. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6554. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6555. } while (0)
  6556. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6557. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6558. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6559. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6560. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6561. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6562. do { \
  6563. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6564. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6565. } while (0)
  6566. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6567. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6568. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6569. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6570. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6571. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6572. do { \
  6573. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6574. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6575. } while (0)
  6576. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6577. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6578. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6579. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6580. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6581. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6582. do { \
  6583. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6584. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6585. } while (0)
  6586. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6587. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6588. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6589. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6590. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6591. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6592. do { \
  6593. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6594. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6595. } while (0)
  6596. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6597. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6598. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6599. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6600. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6601. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6602. do { \
  6603. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6604. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6605. } while (0)
  6606. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6607. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6608. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6609. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6610. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6611. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6614. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6615. } while (0)
  6616. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6617. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6618. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6619. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6620. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6621. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6622. do { \
  6623. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6624. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6625. } while (0)
  6626. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6627. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6628. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6629. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6630. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6631. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6632. do { \
  6633. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6634. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6635. } while (0)
  6636. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6637. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6638. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6639. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6640. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6641. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6642. do { \
  6643. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6644. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6645. } while (0)
  6646. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6647. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6648. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6649. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6650. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6651. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6652. do { \
  6653. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6654. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6655. } while (0)
  6656. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6657. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6658. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6659. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6660. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6661. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6662. do { \
  6663. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6664. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6665. } while (0)
  6666. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6667. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6668. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6669. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6670. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6671. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6672. do { \
  6673. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6674. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6675. } while (0)
  6676. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6677. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6678. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6679. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6680. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6681. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6682. do { \
  6683. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6684. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6685. } while (0)
  6686. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6687. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6688. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6689. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6690. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6691. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6692. do { \
  6693. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6694. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6695. } while (0)
  6696. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6697. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6698. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6699. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6700. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6701. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6702. do { \
  6703. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6704. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6705. } while (0)
  6706. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6707. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6708. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6709. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6710. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6711. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6712. do { \
  6713. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6714. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6715. } while (0)
  6716. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00008000
  6717. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S 15
  6718. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  6719. (((_var) & HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  6720. HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  6721. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  6722. do { \
  6723. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  6724. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  6725. } while (0)
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6729. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6730. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6732. do { \
  6733. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6734. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6735. } while (0)
  6736. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6737. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6738. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6739. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6740. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6741. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6742. do { \
  6743. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6744. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6745. } while (0)
  6746. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6747. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6748. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6749. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6750. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6751. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6752. do { \
  6753. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6754. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6755. } while (0)
  6756. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6757. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6758. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6759. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6760. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6761. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6762. do { \
  6763. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6764. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6765. } while (0)
  6766. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6767. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6768. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6769. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6770. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6771. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6772. do { \
  6773. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6774. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6775. } while (0)
  6776. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6777. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6778. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6779. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6780. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6781. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6782. do { \
  6783. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6784. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6785. } while (0)
  6786. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6787. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6788. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6789. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6790. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6791. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6792. do { \
  6793. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6794. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6795. } while (0)
  6796. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6797. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6798. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6799. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6800. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6801. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6802. do { \
  6803. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6804. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6805. } while (0)
  6806. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6807. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6808. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6809. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6810. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6811. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6812. do { \
  6813. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6814. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6815. } while (0)
  6816. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6817. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6818. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6819. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6820. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6821. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6822. do { \
  6823. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6824. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6825. } while (0)
  6826. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6827. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6828. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6829. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6830. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6831. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6832. do { \
  6833. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6834. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6835. } while (0)
  6836. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6837. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6838. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6839. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6840. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6841. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6842. do { \
  6843. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6844. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6845. } while (0)
  6846. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6847. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6848. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6849. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6850. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6851. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6852. do { \
  6853. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6854. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6855. } while (0)
  6856. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6857. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6858. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6859. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6860. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6861. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6862. do { \
  6863. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6864. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6865. } while (0)
  6866. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6867. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6868. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6869. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6870. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6871. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6872. do { \
  6873. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6874. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6875. } while (0)
  6876. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6877. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6878. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6879. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6880. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6881. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6882. do { \
  6883. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6884. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6885. } while (0)
  6886. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6887. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6888. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6889. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6890. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6891. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6892. do { \
  6893. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6894. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6895. } while (0)
  6896. /*
  6897. * pkt_type_enable_flags
  6898. */
  6899. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6900. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6901. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6902. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6903. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6904. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6905. /*
  6906. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6907. */
  6908. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6909. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6910. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6911. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6912. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6913. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6914. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6915. do { \
  6916. HTT_CHECK_SET_VAL(httsym, value); \
  6917. (word) |= (value) << httsym##_S; \
  6918. } while (0)
  6919. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6920. (((word) & httsym##_M) >> httsym##_S)
  6921. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6922. * type -> MGMT, CTRL, DATA*/
  6923. #define htt_tx_ring_pkt_type_set( \
  6924. word, mode, type, val) \
  6925. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6926. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6927. #define htt_tx_ring_pkt_type_get( \
  6928. word, mode, type) \
  6929. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6930. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6931. /* Definition to filter in TLVs */
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6996. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6997. do { \
  6998. HTT_CHECK_SET_VAL(httsym, enable); \
  6999. (word) |= (enable) << httsym##_S; \
  7000. } while (0)
  7001. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  7002. (((word) & httsym##_M) >> httsym##_S)
  7003. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  7004. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  7005. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  7006. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  7007. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  7008. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7073. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7074. do { \
  7075. HTT_CHECK_SET_VAL(httsym, enable); \
  7076. (word) |= (enable) << httsym##_S; \
  7077. } while (0)
  7078. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7079. (((word) & httsym##_M) >> httsym##_S)
  7080. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7081. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7082. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7083. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7084. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7085. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7150. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7151. do { \
  7152. HTT_CHECK_SET_VAL(httsym, enable); \
  7153. (word) |= (enable) << httsym##_S; \
  7154. } while (0)
  7155. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7156. (((word) & httsym##_M) >> httsym##_S)
  7157. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7158. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7159. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7160. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7161. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7162. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7206. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7207. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7208. do { \
  7209. HTT_CHECK_SET_VAL(httsym, enable); \
  7210. (word) |= (enable) << httsym##_S; \
  7211. } while (0)
  7212. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7213. (((word) & httsym##_M) >> httsym##_S)
  7214. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7215. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7216. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7217. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7218. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7219. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7220. /**
  7221. * @brief host --> target Receive Flow Steering configuration message definition
  7222. *
  7223. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7224. *
  7225. * host --> target Receive Flow Steering configuration message definition.
  7226. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7227. * The reason for this is we want RFS to be configured and ready before MAC
  7228. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7229. *
  7230. * |31 24|23 16|15 9|8|7 0|
  7231. * |----------------+----------------+----------------+----------------|
  7232. * | reserved |E| msg type |
  7233. * |-------------------------------------------------------------------|
  7234. * Where E = RFS enable flag
  7235. *
  7236. * The RFS_CONFIG message consists of a single 4-byte word.
  7237. *
  7238. * Header fields:
  7239. * - MSG_TYPE
  7240. * Bits 7:0
  7241. * Purpose: identifies this as a RFS config msg
  7242. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7243. * - RFS_CONFIG
  7244. * Bit 8
  7245. * Purpose: Tells target whether to enable (1) or disable (0)
  7246. * flow steering feature when sending rx indication messages to host
  7247. */
  7248. #define HTT_H2T_RFS_CONFIG_M 0x100
  7249. #define HTT_H2T_RFS_CONFIG_S 8
  7250. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7251. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7252. HTT_H2T_RFS_CONFIG_S)
  7253. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7254. do { \
  7255. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7256. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7257. } while (0)
  7258. #define HTT_RFS_CFG_REQ_BYTES 4
  7259. /**
  7260. * @brief host -> target FW extended statistics request
  7261. *
  7262. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7263. *
  7264. * @details
  7265. * The following field definitions describe the format of the HTT host
  7266. * to target FW extended stats retrieve message.
  7267. * The message specifies the type of stats the host wants to retrieve.
  7268. *
  7269. * |31 24|23 16|15 8|7 0|
  7270. * |-----------------------------------------------------------|
  7271. * | reserved | stats type | pdev_mask | msg type |
  7272. * |-----------------------------------------------------------|
  7273. * | config param [0] |
  7274. * |-----------------------------------------------------------|
  7275. * | config param [1] |
  7276. * |-----------------------------------------------------------|
  7277. * | config param [2] |
  7278. * |-----------------------------------------------------------|
  7279. * | config param [3] |
  7280. * |-----------------------------------------------------------|
  7281. * | reserved |
  7282. * |-----------------------------------------------------------|
  7283. * | cookie LSBs |
  7284. * |-----------------------------------------------------------|
  7285. * | cookie MSBs |
  7286. * |-----------------------------------------------------------|
  7287. * Header fields:
  7288. * - MSG_TYPE
  7289. * Bits 7:0
  7290. * Purpose: identifies this is a extended stats upload request message
  7291. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7292. * - PDEV_MASK
  7293. * Bits 8:15
  7294. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7295. * Value: This is a overloaded field, refer to usage and interpretation of
  7296. * PDEV in interface document.
  7297. * Bit 8 : Reserved for SOC stats
  7298. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7299. * Indicates MACID_MASK in DBS
  7300. * - STATS_TYPE
  7301. * Bits 23:16
  7302. * Purpose: identifies which FW statistics to upload
  7303. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7304. * - Reserved
  7305. * Bits 31:24
  7306. * - CONFIG_PARAM [0]
  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. * - CONFIG_PARAM [1]
  7312. * Bits 31:0
  7313. * Purpose: give an opaque configuration value to the specified stats type
  7314. * Value: stats-type specific configuration value
  7315. * Refer to htt_stats.h for interpretation for each stats sub_type
  7316. * - CONFIG_PARAM [2]
  7317. * Bits 31:0
  7318. * Purpose: give an opaque configuration value to the specified stats type
  7319. * Value: stats-type specific configuration value
  7320. * Refer to htt_stats.h for interpretation for each stats sub_type
  7321. * - CONFIG_PARAM [3]
  7322. * Bits 31:0
  7323. * Purpose: give an opaque configuration value to the specified stats type
  7324. * Value: stats-type specific configuration value
  7325. * Refer to htt_stats.h for interpretation for each stats sub_type
  7326. * - Reserved [31:0] for future use.
  7327. * - COOKIE_LSBS
  7328. * Bits 31:0
  7329. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7330. * message with its preceding host->target stats request message.
  7331. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7332. * - COOKIE_MSBS
  7333. * Bits 31:0
  7334. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7335. * message with its preceding host->target stats request message.
  7336. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7337. */
  7338. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7339. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7340. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7341. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7342. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7343. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7344. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7345. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7346. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7347. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7348. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7349. do { \
  7350. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7351. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7352. } while (0)
  7353. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7354. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7355. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7356. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7357. do { \
  7358. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7359. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7360. } while (0)
  7361. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7362. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7363. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7364. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7365. do { \
  7366. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7367. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7368. } while (0)
  7369. /**
  7370. * @brief host -> target FW streaming statistics request
  7371. *
  7372. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7373. *
  7374. * @details
  7375. * The following field definitions describe the format of the HTT host
  7376. * to target message that requests the target to start or stop producing
  7377. * ongoing stats of the specified type.
  7378. *
  7379. * |31|30 |23 16|15 8|7 0|
  7380. * |-----------------------------------------------------------|
  7381. * |EN| reserved | stats type | reserved | msg type |
  7382. * |-----------------------------------------------------------|
  7383. * | config param [0] |
  7384. * |-----------------------------------------------------------|
  7385. * | config param [1] |
  7386. * |-----------------------------------------------------------|
  7387. * | config param [2] |
  7388. * |-----------------------------------------------------------|
  7389. * | config param [3] |
  7390. * |-----------------------------------------------------------|
  7391. * Where:
  7392. * - EN is an enable/disable flag
  7393. * Header fields:
  7394. * - MSG_TYPE
  7395. * Bits 7:0
  7396. * Purpose: identifies this is a streaming stats upload request message
  7397. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7398. * - STATS_TYPE
  7399. * Bits 23:16
  7400. * Purpose: identifies which FW statistics to upload
  7401. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7402. * Only the htt_dbg_ext_stats_type values identified as streaming
  7403. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7404. * - ENABLE
  7405. * Bit 31
  7406. * Purpose: enable/disable the target's ongoing stats of the specified type
  7407. * Value:
  7408. * 0 - disable ongoing production of the specified stats type
  7409. * 1 - enable ongoing production of the specified stats type
  7410. * - CONFIG_PARAM [0]
  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. * - CONFIG_PARAM [1]
  7416. * Bits 31:0
  7417. * Purpose: give an opaque configuration value to the specified stats type
  7418. * Value: stats-type specific configuration value
  7419. * Refer to htt_stats.h for interpretation for each stats sub_type
  7420. * - CONFIG_PARAM [2]
  7421. * Bits 31:0
  7422. * Purpose: give an opaque configuration value to the specified stats type
  7423. * Value: stats-type specific configuration value
  7424. * Refer to htt_stats.h for interpretation for each stats sub_type
  7425. * - CONFIG_PARAM [3]
  7426. * Bits 31:0
  7427. * Purpose: give an opaque configuration value to the specified stats type
  7428. * Value: stats-type specific configuration value
  7429. * Refer to htt_stats.h for interpretation for each stats sub_type
  7430. */
  7431. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7432. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7433. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7434. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7435. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7436. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7437. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7438. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7439. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7442. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7443. } while (0)
  7444. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7445. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7446. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7447. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7448. do { \
  7449. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7450. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7451. } while (0)
  7452. /**
  7453. * @brief host -> target FW PPDU_STATS request message
  7454. *
  7455. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7456. *
  7457. * @details
  7458. * The following field definitions describe the format of the HTT host
  7459. * to target FW for PPDU_STATS_CFG msg.
  7460. * The message allows the host to configure the PPDU_STATS_IND messages
  7461. * produced by the target.
  7462. *
  7463. * |31 24|23 16|15 8|7 0|
  7464. * |-----------------------------------------------------------|
  7465. * | REQ bit mask | pdev_mask | msg type |
  7466. * |-----------------------------------------------------------|
  7467. * Header fields:
  7468. * - MSG_TYPE
  7469. * Bits 7:0
  7470. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7471. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7472. * - PDEV_MASK
  7473. * Bits 8:15
  7474. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7475. * Value: This is a overloaded field, refer to usage and interpretation of
  7476. * PDEV in interface document.
  7477. * Bit 8 : Reserved for SOC stats
  7478. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7479. * Indicates MACID_MASK in DBS
  7480. * - REQ_TLV_BIT_MASK
  7481. * Bits 16:31
  7482. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7483. * needs to be included in the target's PPDU_STATS_IND messages.
  7484. * Value: refer htt_ppdu_stats_tlv_tag_t
  7485. *
  7486. */
  7487. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7488. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7489. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7490. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7491. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7492. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7493. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7494. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7495. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7496. do { \
  7497. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7498. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7499. } while (0)
  7500. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7501. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7502. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7503. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7504. do { \
  7505. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7506. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7507. } while (0)
  7508. /**
  7509. * @brief Host-->target HTT RX FSE setup message
  7510. *
  7511. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7512. *
  7513. * @details
  7514. * Through this message, the host will provide details of the flow tables
  7515. * in host DDR along with hash keys.
  7516. * This message can be sent per SOC or per PDEV, which is differentiated
  7517. * by pdev id values.
  7518. * The host will allocate flow search table and sends table size,
  7519. * physical DMA address of flow table, and hash keys to firmware to
  7520. * program into the RXOLE FSE HW block.
  7521. *
  7522. * The following field definitions describe the format of the RX FSE setup
  7523. * message sent from the host to target
  7524. *
  7525. * Header fields:
  7526. * dword0 - b'7:0 - msg_type: This will be set to
  7527. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7528. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7529. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7530. * pdev's LMAC ring.
  7531. * b'31:16 - reserved : Reserved for future use
  7532. * dword1 - b'19:0 - number of records: This field indicates the number of
  7533. * entries in the flow table. For example: 8k number of
  7534. * records is equivalent to
  7535. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7536. * b'27:20 - max search: This field specifies the skid length to FSE
  7537. * parser HW module whenever match is not found at the
  7538. * exact index pointed by hash.
  7539. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7540. * Refer htt_ip_da_sa_prefix below for more details.
  7541. * b'31:30 - reserved: Reserved for future use
  7542. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7543. * table allocated by host in DDR
  7544. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7545. * table allocated by host in DDR
  7546. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7547. * entry hashing
  7548. *
  7549. *
  7550. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7551. * |---------------------------------------------------------------|
  7552. * | reserved | pdev_id | MSG_TYPE |
  7553. * |---------------------------------------------------------------|
  7554. * |resvd|IPDSA| max_search | Number of records |
  7555. * |---------------------------------------------------------------|
  7556. * | base address lo |
  7557. * |---------------------------------------------------------------|
  7558. * | base address high |
  7559. * |---------------------------------------------------------------|
  7560. * | toeplitz key 31_0 |
  7561. * |---------------------------------------------------------------|
  7562. * | toeplitz key 63_32 |
  7563. * |---------------------------------------------------------------|
  7564. * | toeplitz key 95_64 |
  7565. * |---------------------------------------------------------------|
  7566. * | toeplitz key 127_96 |
  7567. * |---------------------------------------------------------------|
  7568. * | toeplitz key 159_128 |
  7569. * |---------------------------------------------------------------|
  7570. * | toeplitz key 191_160 |
  7571. * |---------------------------------------------------------------|
  7572. * | toeplitz key 223_192 |
  7573. * |---------------------------------------------------------------|
  7574. * | toeplitz key 255_224 |
  7575. * |---------------------------------------------------------------|
  7576. * | toeplitz key 287_256 |
  7577. * |---------------------------------------------------------------|
  7578. * | reserved | toeplitz key 314_288(26:0 bits) |
  7579. * |---------------------------------------------------------------|
  7580. * where:
  7581. * IPDSA = ip_da_sa
  7582. */
  7583. /**
  7584. * @brief: htt_ip_da_sa_prefix
  7585. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7586. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7587. * documentation per RFC3849
  7588. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7589. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7590. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7591. */
  7592. enum htt_ip_da_sa_prefix {
  7593. HTT_RX_IPV6_20010db8,
  7594. HTT_RX_IPV4_MAPPED_IPV6,
  7595. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7596. HTT_RX_IPV6_64FF9B,
  7597. };
  7598. /**
  7599. * @brief Host-->target HTT RX FISA configure and enable
  7600. *
  7601. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7602. *
  7603. * @details
  7604. * The host will send this command down to configure and enable the FISA
  7605. * operational params.
  7606. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7607. * register.
  7608. * Should configure both the MACs.
  7609. *
  7610. * dword0 - b'7:0 - msg_type:
  7611. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7612. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7613. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7614. * pdev's LMAC ring.
  7615. * b'31:16 - reserved : Reserved for future use
  7616. *
  7617. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7618. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7619. * packets. 1 flow search will be skipped
  7620. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7621. * tcp,udp packets
  7622. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7623. * calculation
  7624. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7625. * calculation
  7626. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7627. * calculation
  7628. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7629. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7630. * length
  7631. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7632. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7633. * length
  7634. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7635. * num jump
  7636. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7637. * num jump
  7638. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7639. * data type switch has happened for MPDU Sequence num jump
  7640. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7641. * for MPDU Sequence num jump
  7642. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7643. * for decrypt errors
  7644. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7645. * while aggregating a msdu
  7646. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7647. * The aggregation is done until (number of MSDUs aggregated
  7648. * < LIMIT + 1)
  7649. * b'31:18 - Reserved
  7650. *
  7651. * fisa_control_value - 32bit value FW can write to register
  7652. *
  7653. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7654. * Threshold value for FISA timeout (units are microseconds).
  7655. * When the global timestamp exceeds this threshold, FISA
  7656. * aggregation will be restarted.
  7657. * A value of 0 means timeout is disabled.
  7658. * Compare the threshold register with timestamp field in
  7659. * flow entry to generate timeout for the flow.
  7660. *
  7661. * |31 18 |17 16|15 8|7 0|
  7662. * |-------------------------------------------------------------|
  7663. * | reserved | pdev_mask | msg type |
  7664. * |-------------------------------------------------------------|
  7665. * | reserved | FISA_CTRL |
  7666. * |-------------------------------------------------------------|
  7667. * | FISA_TIMEOUT_THRESH |
  7668. * |-------------------------------------------------------------|
  7669. */
  7670. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7671. A_UINT32 msg_type:8,
  7672. pdev_id:8,
  7673. reserved0:16;
  7674. /**
  7675. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7676. * [17:0]
  7677. */
  7678. union {
  7679. /*
  7680. * fisa_control_bits structure is deprecated.
  7681. * Please use fisa_control_bits_v2 going forward.
  7682. */
  7683. struct {
  7684. A_UINT32 fisa_enable: 1,
  7685. ipsec_skip_search: 1,
  7686. nontcp_skip_search: 1,
  7687. add_ipv4_fixed_hdr_len: 1,
  7688. add_ipv6_fixed_hdr_len: 1,
  7689. add_tcp_fixed_hdr_len: 1,
  7690. add_udp_hdr_len: 1,
  7691. chksum_cum_ip_len_en: 1,
  7692. disable_tid_check: 1,
  7693. disable_ta_check: 1,
  7694. disable_qos_check: 1,
  7695. disable_raw_check: 1,
  7696. disable_decrypt_err_check: 1,
  7697. disable_msdu_drop_check: 1,
  7698. fisa_aggr_limit: 4,
  7699. reserved: 14;
  7700. } fisa_control_bits;
  7701. struct {
  7702. A_UINT32 fisa_enable: 1,
  7703. fisa_aggr_limit: 4,
  7704. reserved: 27;
  7705. } fisa_control_bits_v2;
  7706. A_UINT32 fisa_control_value;
  7707. } u_fisa_control;
  7708. /**
  7709. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7710. * timeout threshold for aggregation. Unit in usec.
  7711. * [31:0]
  7712. */
  7713. A_UINT32 fisa_timeout_threshold;
  7714. } POSTPACK;
  7715. /* DWord 0: pdev-ID */
  7716. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7717. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7718. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7719. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7720. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7721. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7722. do { \
  7723. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7724. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7725. } while (0)
  7726. /* Dword 1: fisa_control_value fisa config */
  7727. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7728. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7729. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7730. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7731. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7732. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7733. do { \
  7734. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7735. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7736. } while (0)
  7737. /* Dword 1: fisa_control_value ipsec_skip_search */
  7738. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7739. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7740. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7741. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7742. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7743. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7744. do { \
  7745. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7746. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7747. } while (0)
  7748. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7749. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7750. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7751. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7752. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7753. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7754. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7755. do { \
  7756. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7757. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7758. } while (0)
  7759. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7760. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7761. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7762. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7763. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7764. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7765. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7766. do { \
  7767. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7768. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7769. } while (0)
  7770. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7771. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7772. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7773. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7774. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7775. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7776. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7777. do { \
  7778. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7779. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7780. } while (0)
  7781. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7782. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7783. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7784. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7785. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7786. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7787. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7788. do { \
  7789. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7790. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7791. } while (0)
  7792. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7793. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7794. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7795. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7796. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7797. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7798. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7799. do { \
  7800. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7801. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7802. } while (0)
  7803. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7804. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7805. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7806. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7807. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7808. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7809. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7810. do { \
  7811. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7812. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7813. } while (0)
  7814. /* Dword 1: fisa_control_value disable_tid_check */
  7815. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7816. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7817. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7818. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7819. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7820. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7821. do { \
  7822. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7823. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7824. } while (0)
  7825. /* Dword 1: fisa_control_value disable_ta_check */
  7826. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7827. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7828. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7829. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7830. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7831. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7832. do { \
  7833. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7834. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7835. } while (0)
  7836. /* Dword 1: fisa_control_value disable_qos_check */
  7837. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7838. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7839. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7840. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7841. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7842. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7843. do { \
  7844. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7845. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7846. } while (0)
  7847. /* Dword 1: fisa_control_value disable_raw_check */
  7848. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7849. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7850. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7851. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7852. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7853. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7854. do { \
  7855. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7856. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7857. } while (0)
  7858. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7859. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7860. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7861. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7862. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7863. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7864. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7865. do { \
  7866. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7867. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7868. } while (0)
  7869. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7870. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7871. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7872. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7873. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7874. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7875. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7876. do { \
  7877. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7878. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7879. } while (0)
  7880. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7881. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7882. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7883. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7884. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7885. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7886. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7887. do { \
  7888. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7889. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7890. } while (0)
  7891. /* Dword 1: fisa_control_value fisa config */
  7892. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7893. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7894. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7895. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7896. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7897. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7898. do { \
  7899. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7900. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7901. } while (0)
  7902. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7903. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7904. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7905. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7906. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7907. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7908. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7909. do { \
  7910. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7911. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7912. } while (0)
  7913. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7914. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7915. pdev_id:8,
  7916. reserved0:16;
  7917. A_UINT32 num_records:20,
  7918. max_search:8,
  7919. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7920. reserved1:2;
  7921. A_UINT32 base_addr_lo;
  7922. A_UINT32 base_addr_hi;
  7923. A_UINT32 toeplitz31_0;
  7924. A_UINT32 toeplitz63_32;
  7925. A_UINT32 toeplitz95_64;
  7926. A_UINT32 toeplitz127_96;
  7927. A_UINT32 toeplitz159_128;
  7928. A_UINT32 toeplitz191_160;
  7929. A_UINT32 toeplitz223_192;
  7930. A_UINT32 toeplitz255_224;
  7931. A_UINT32 toeplitz287_256;
  7932. A_UINT32 toeplitz314_288:27,
  7933. reserved2:5;
  7934. } POSTPACK;
  7935. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7936. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7937. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7938. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7939. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7940. /* DWORD 0: Pdev ID */
  7941. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7942. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7943. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7944. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7945. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7946. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7947. do { \
  7948. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7949. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7950. } while (0)
  7951. /* DWORD 1:num of records */
  7952. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7953. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7954. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7955. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7956. HTT_RX_FSE_SETUP_NUM_REC_S)
  7957. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7958. do { \
  7959. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7960. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7961. } while (0)
  7962. /* DWORD 1:max_search */
  7963. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7964. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7965. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7966. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7967. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7968. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7969. do { \
  7970. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7971. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7972. } while (0)
  7973. /* DWORD 1:ip_da_sa prefix */
  7974. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7975. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7976. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7977. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7978. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7979. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7980. do { \
  7981. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7982. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7983. } while (0)
  7984. /* DWORD 2: Base Address LO */
  7985. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7986. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7987. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7988. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7989. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7990. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7991. do { \
  7992. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7993. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7994. } while (0)
  7995. /* DWORD 3: Base Address High */
  7996. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7997. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7998. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7999. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  8000. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  8001. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  8002. do { \
  8003. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  8004. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  8005. } while (0)
  8006. /* DWORD 4-12: Hash Value */
  8007. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  8008. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  8009. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  8010. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  8011. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  8012. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  8013. do { \
  8014. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8015. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8016. } while (0)
  8017. /* DWORD 13: Hash Value 314:288 bits */
  8018. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8019. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8020. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8021. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8022. do { \
  8023. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8024. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8025. } while (0)
  8026. /**
  8027. * @brief Host-->target HTT RX FSE operation message
  8028. *
  8029. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8030. *
  8031. * @details
  8032. * The host will send this Flow Search Engine (FSE) operation message for
  8033. * every flow add/delete operation.
  8034. * The FSE operation includes FSE full cache invalidation or individual entry
  8035. * invalidation.
  8036. * This message can be sent per SOC or per PDEV which is differentiated
  8037. * by pdev id values.
  8038. *
  8039. * |31 16|15 8|7 1|0|
  8040. * |-------------------------------------------------------------|
  8041. * | reserved | pdev_id | MSG_TYPE |
  8042. * |-------------------------------------------------------------|
  8043. * | reserved | operation |I|
  8044. * |-------------------------------------------------------------|
  8045. * | ip_src_addr_31_0 |
  8046. * |-------------------------------------------------------------|
  8047. * | ip_src_addr_63_32 |
  8048. * |-------------------------------------------------------------|
  8049. * | ip_src_addr_95_64 |
  8050. * |-------------------------------------------------------------|
  8051. * | ip_src_addr_127_96 |
  8052. * |-------------------------------------------------------------|
  8053. * | ip_dst_addr_31_0 |
  8054. * |-------------------------------------------------------------|
  8055. * | ip_dst_addr_63_32 |
  8056. * |-------------------------------------------------------------|
  8057. * | ip_dst_addr_95_64 |
  8058. * |-------------------------------------------------------------|
  8059. * | ip_dst_addr_127_96 |
  8060. * |-------------------------------------------------------------|
  8061. * | l4_dst_port | l4_src_port |
  8062. * | (32-bit SPI incase of IPsec) |
  8063. * |-------------------------------------------------------------|
  8064. * | reserved | l4_proto |
  8065. * |-------------------------------------------------------------|
  8066. *
  8067. * where I is 1-bit ipsec_valid.
  8068. *
  8069. * The following field definitions describe the format of the RX FSE operation
  8070. * message sent from the host to target for every add/delete flow entry to flow
  8071. * table.
  8072. *
  8073. * Header fields:
  8074. * dword0 - b'7:0 - msg_type: This will be set to
  8075. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8076. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8077. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8078. * specified pdev's LMAC ring.
  8079. * b'31:16 - reserved : Reserved for future use
  8080. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8081. * (Internet Protocol Security).
  8082. * IPsec describes the framework for providing security at
  8083. * IP layer. IPsec is defined for both versions of IP:
  8084. * IPV4 and IPV6.
  8085. * Please refer to htt_rx_flow_proto enumeration below for
  8086. * more info.
  8087. * ipsec_valid = 1 for IPSEC packets
  8088. * ipsec_valid = 0 for IP Packets
  8089. * b'7:1 - operation: This indicates types of FSE operation.
  8090. * Refer to htt_rx_fse_operation enumeration:
  8091. * 0 - No Cache Invalidation required
  8092. * 1 - Cache invalidate only one entry given by IP
  8093. * src/dest address at DWORD[2:9]
  8094. * 2 - Complete FSE Cache Invalidation
  8095. * 3 - FSE Disable
  8096. * 4 - FSE Enable
  8097. * b'31:8 - reserved: Reserved for future use
  8098. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8099. * for per flow addition/deletion
  8100. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8101. * and the subsequent 3 A_UINT32 will be padding bytes.
  8102. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8103. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8104. * from 0 to 65535 but only 0 to 1023 are designated as
  8105. * well-known ports. Refer to [RFC1700] for more details.
  8106. * This field is valid only if
  8107. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8108. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8109. * range from 0 to 65535 but only 0 to 1023 are designated
  8110. * as well-known ports. Refer to [RFC1700] for more details.
  8111. * This field is valid only if
  8112. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8113. * - SPI (31:0): Security Parameters Index is an
  8114. * identification tag added to the header while using IPsec
  8115. * for tunneling the IP traffici.
  8116. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8117. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8118. * Assigned Internet Protocol Numbers.
  8119. * l4_proto numbers for standard protocol like UDP/TCP
  8120. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8121. * l4_proto = 17 for UDP etc.
  8122. * b'31:8 - reserved: Reserved for future use.
  8123. *
  8124. */
  8125. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8126. A_UINT32 msg_type:8,
  8127. pdev_id:8,
  8128. reserved0:16;
  8129. A_UINT32 ipsec_valid:1,
  8130. operation:7,
  8131. reserved1:24;
  8132. A_UINT32 ip_src_addr_31_0;
  8133. A_UINT32 ip_src_addr_63_32;
  8134. A_UINT32 ip_src_addr_95_64;
  8135. A_UINT32 ip_src_addr_127_96;
  8136. A_UINT32 ip_dest_addr_31_0;
  8137. A_UINT32 ip_dest_addr_63_32;
  8138. A_UINT32 ip_dest_addr_95_64;
  8139. A_UINT32 ip_dest_addr_127_96;
  8140. union {
  8141. A_UINT32 spi;
  8142. struct {
  8143. A_UINT32 l4_src_port:16,
  8144. l4_dest_port:16;
  8145. } ip;
  8146. } u;
  8147. A_UINT32 l4_proto:8,
  8148. reserved:24;
  8149. } POSTPACK;
  8150. /**
  8151. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8152. *
  8153. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8154. *
  8155. * @details
  8156. * The host will send this Full monitor mode register configuration message.
  8157. * This message can be sent per SOC or per PDEV which is differentiated
  8158. * by pdev id values.
  8159. *
  8160. * |31 16|15 11|10 8|7 3|2|1|0|
  8161. * |-------------------------------------------------------------|
  8162. * | reserved | pdev_id | MSG_TYPE |
  8163. * |-------------------------------------------------------------|
  8164. * | reserved |Release Ring |N|Z|E|
  8165. * |-------------------------------------------------------------|
  8166. *
  8167. * where E is 1-bit full monitor mode enable/disable.
  8168. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8169. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8170. *
  8171. * The following field definitions describe the format of the full monitor
  8172. * mode configuration message sent from the host to target for each pdev.
  8173. *
  8174. * Header fields:
  8175. * dword0 - b'7:0 - msg_type: This will be set to
  8176. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8177. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8178. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8179. * specified pdev's LMAC ring.
  8180. * b'31:16 - reserved : Reserved for future use.
  8181. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8182. * monitor mode rxdma register is to be enabled or disabled.
  8183. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8184. * additional descriptors at ppdu end for zero mpdus
  8185. * enabled or disabled.
  8186. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8187. * additional descriptors at ppdu end for non zero mpdus
  8188. * enabled or disabled.
  8189. * b'10:3 - release_ring: This indicates the destination ring
  8190. * selection for the descriptor at the end of PPDU
  8191. * 0 - REO ring select
  8192. * 1 - FW ring select
  8193. * 2 - SW ring select
  8194. * 3 - Release ring select
  8195. * Refer to htt_rx_full_mon_release_ring.
  8196. * b'31:11 - reserved for future use
  8197. */
  8198. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8199. A_UINT32 msg_type:8,
  8200. pdev_id:8,
  8201. reserved0:16;
  8202. A_UINT32 full_monitor_mode_enable:1,
  8203. addnl_descs_zero_mpdus_end:1,
  8204. addnl_descs_non_zero_mpdus_end:1,
  8205. release_ring:8,
  8206. reserved1:21;
  8207. } POSTPACK;
  8208. /**
  8209. * Enumeration for full monitor mode destination ring select
  8210. * 0 - REO destination ring select
  8211. * 1 - FW destination ring select
  8212. * 2 - SW destination ring select
  8213. * 3 - Release destination ring select
  8214. */
  8215. enum htt_rx_full_mon_release_ring {
  8216. HTT_RX_MON_RING_REO,
  8217. HTT_RX_MON_RING_FW,
  8218. HTT_RX_MON_RING_SW,
  8219. HTT_RX_MON_RING_RELEASE,
  8220. };
  8221. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8222. /* DWORD 0: Pdev ID */
  8223. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8224. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8225. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8226. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8227. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8228. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8229. do { \
  8230. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8231. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8232. } while (0)
  8233. /* DWORD 1:ENABLE */
  8234. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8235. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8236. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8237. do { \
  8238. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8239. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8240. } while (0)
  8241. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8242. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8243. /* DWORD 1:ZERO_MPDU */
  8244. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8245. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8246. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8247. do { \
  8248. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8249. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8250. } while (0)
  8251. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8252. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8253. /* DWORD 1:NON_ZERO_MPDU */
  8254. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8255. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8256. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8257. do { \
  8258. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8259. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8260. } while (0)
  8261. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8262. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8263. /* DWORD 1:RELEASE_RINGS */
  8264. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8265. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8266. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8267. do { \
  8268. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8269. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8270. } while (0)
  8271. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8272. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8273. /**
  8274. * Enumeration for IP Protocol or IPSEC Protocol
  8275. * IPsec describes the framework for providing security at IP layer.
  8276. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8277. */
  8278. enum htt_rx_flow_proto {
  8279. HTT_RX_FLOW_IP_PROTO,
  8280. HTT_RX_FLOW_IPSEC_PROTO,
  8281. };
  8282. /**
  8283. * Enumeration for FSE Cache Invalidation
  8284. * 0 - No Cache Invalidation required
  8285. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8286. * 2 - Complete FSE Cache Invalidation
  8287. * 3 - FSE Disable
  8288. * 4 - FSE Enable
  8289. */
  8290. enum htt_rx_fse_operation {
  8291. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8292. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8293. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8294. HTT_RX_FSE_DISABLE,
  8295. HTT_RX_FSE_ENABLE,
  8296. };
  8297. /* DWORD 0: Pdev ID */
  8298. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8299. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8300. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8301. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8302. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8303. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8304. do { \
  8305. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8306. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8307. } while (0)
  8308. /* DWORD 1:IP PROTO or IPSEC */
  8309. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8310. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8311. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8312. do { \
  8313. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8314. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8315. } while (0)
  8316. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8317. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8318. /* DWORD 1:FSE Operation */
  8319. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8320. #define HTT_RX_FSE_OPERATION_S 1
  8321. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8322. do { \
  8323. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8324. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8325. } while (0)
  8326. #define HTT_RX_FSE_OPERATION_GET(word) \
  8327. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8328. /* DWORD 2-9:IP Address */
  8329. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8330. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8331. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8332. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8333. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8334. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8335. do { \
  8336. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8337. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8338. } while (0)
  8339. /* DWORD 10:Source Port Number */
  8340. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8341. #define HTT_RX_FSE_SOURCEPORT_S 0
  8342. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8343. do { \
  8344. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8345. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8346. } while (0)
  8347. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8348. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8349. /* DWORD 11:Destination Port Number */
  8350. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8351. #define HTT_RX_FSE_DESTPORT_S 16
  8352. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8353. do { \
  8354. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8355. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8356. } while (0)
  8357. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8358. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8359. /* DWORD 10-11:SPI (In case of IPSEC) */
  8360. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8361. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8362. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8363. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8364. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8365. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8366. do { \
  8367. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8368. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8369. } while (0)
  8370. /* DWORD 12:L4 PROTO */
  8371. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8372. #define HTT_RX_FSE_L4_PROTO_S 0
  8373. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8374. do { \
  8375. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8376. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8377. } while (0)
  8378. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8379. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8380. /**
  8381. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8382. *
  8383. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8384. *
  8385. * |31 24|23 |15 8|7 2|1|0|
  8386. * |----------------+----------------+----------------+----------------|
  8387. * | reserved | pdev_id | msg_type |
  8388. * |---------------------------------+----------------+----------------|
  8389. * | reserved |E|F|
  8390. * |---------------------------------+----------------+----------------|
  8391. * Where E = Configure the target to provide the 3-tuple hash value in
  8392. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8393. * F = Configure the target to provide the 3-tuple hash value in
  8394. * flow_id_toeplitz field of rx_msdu_start tlv
  8395. *
  8396. * The following field definitions describe the format of the 3 tuple hash value
  8397. * message sent from the host to target as part of initialization sequence.
  8398. *
  8399. * Header fields:
  8400. * dword0 - b'7:0 - msg_type: This will be set to
  8401. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8402. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8403. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8404. * specified pdev's LMAC ring.
  8405. * b'31:16 - reserved : Reserved for future use
  8406. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8407. * b'1 - toeplitz_hash_2_or_4_field_enable
  8408. * b'31:2 - reserved : Reserved for future use
  8409. * ---------+------+----------------------------------------------------------
  8410. * bit1 | bit0 | Functionality
  8411. * ---------+------+----------------------------------------------------------
  8412. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8413. * | | in flow_id_toeplitz field
  8414. * ---------+------+----------------------------------------------------------
  8415. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8416. * | | in toeplitz_hash_2_or_4 field
  8417. * ---------+------+----------------------------------------------------------
  8418. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8419. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8420. * ---------+------+----------------------------------------------------------
  8421. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8422. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8423. * | | toeplitz_hash_2_or_4 field
  8424. *----------------------------------------------------------------------------
  8425. */
  8426. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8427. A_UINT32 msg_type :8,
  8428. pdev_id :8,
  8429. reserved0 :16;
  8430. A_UINT32 flow_id_toeplitz_field_enable :1,
  8431. toeplitz_hash_2_or_4_field_enable :1,
  8432. reserved1 :30;
  8433. } POSTPACK;
  8434. /* DWORD0 : pdev_id configuration Macros */
  8435. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8436. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8437. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8438. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8439. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8440. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8441. do { \
  8442. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8443. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8444. } while (0)
  8445. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8446. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8447. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8448. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8449. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8450. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8451. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8454. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8455. } while (0)
  8456. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8457. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8458. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8459. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8460. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8461. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8462. do { \
  8463. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8464. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8465. } while (0)
  8466. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8467. /**
  8468. * @brief host --> target Host PA Address Size
  8469. *
  8470. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8471. *
  8472. * @details
  8473. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8474. * provide the physical start address and size of each of the memory
  8475. * areas within host DDR that the target FW may need to access.
  8476. *
  8477. * For example, the host can use this message to allow the target FW
  8478. * to set up access to the host's pools of TQM link descriptors.
  8479. * The message would appear as follows:
  8480. *
  8481. * |31 24|23 16|15 8|7 0|
  8482. * |----------------+----------------+----------------+----------------|
  8483. * | reserved | num_entries | msg_type |
  8484. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8485. * | mem area 0 size |
  8486. * |----------------+----------------+----------------+----------------|
  8487. * | mem area 0 physical_address_lo |
  8488. * |----------------+----------------+----------------+----------------|
  8489. * | mem area 0 physical_address_hi |
  8490. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8491. * | mem area 1 size |
  8492. * |----------------+----------------+----------------+----------------|
  8493. * | mem area 1 physical_address_lo |
  8494. * |----------------+----------------+----------------+----------------|
  8495. * | mem area 1 physical_address_hi |
  8496. * |----------------+----------------+----------------+----------------|
  8497. * ...
  8498. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8499. * | mem area N size |
  8500. * |----------------+----------------+----------------+----------------|
  8501. * | mem area N physical_address_lo |
  8502. * |----------------+----------------+----------------+----------------|
  8503. * | mem area N physical_address_hi |
  8504. * |----------------+----------------+----------------+----------------|
  8505. *
  8506. * The message is interpreted as follows:
  8507. * dword0 - b'0:7 - msg_type: This will be set to
  8508. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8509. * b'8:15 - number_entries: Indicated the number of host memory
  8510. * areas specified within the remainder of the message
  8511. * b'16:31 - reserved.
  8512. * dword1 - b'0:31 - memory area 0 size in bytes
  8513. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8514. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8515. * and similar for memory area 1 through memory area N.
  8516. */
  8517. PREPACK struct htt_h2t_host_paddr_size {
  8518. A_UINT32 msg_type: 8,
  8519. num_entries: 8,
  8520. reserved: 16;
  8521. } POSTPACK;
  8522. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8523. A_UINT32 size;
  8524. A_UINT32 physical_address_lo;
  8525. A_UINT32 physical_address_hi;
  8526. } POSTPACK;
  8527. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8528. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8529. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8530. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8531. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8532. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8533. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8534. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8535. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8536. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8537. do { \
  8538. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8539. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8540. } while (0)
  8541. /**
  8542. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8543. *
  8544. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8545. *
  8546. * @details
  8547. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8548. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8549. *
  8550. * The message would appear as follows:
  8551. *
  8552. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8553. * |---------------------------------+---+---+----------+-+-----------|
  8554. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8555. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8556. *
  8557. *
  8558. * The message is interpreted as follows:
  8559. * dword0 - b'0:7 - msg_type: This will be set to
  8560. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8561. * b'8 - override bit to drive MSDUs to PPE ring
  8562. * b'9:13 - REO destination ring indication
  8563. * b'14 - Multi buffer msdu override enable bit
  8564. * b'15 - Intra BSS override
  8565. * b'16 - Decap raw override
  8566. * b'17 - Decap Native wifi override
  8567. * b'18 - IP frag override
  8568. * b'19:31 - reserved
  8569. */
  8570. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8571. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8572. override: 1,
  8573. reo_destination_indication: 5,
  8574. multi_buffer_msdu_override_en: 1,
  8575. intra_bss_override: 1,
  8576. decap_raw_override: 1,
  8577. decap_nwifi_override: 1,
  8578. ip_frag_override: 1,
  8579. reserved: 13;
  8580. } POSTPACK;
  8581. /* DWORD 0: Override */
  8582. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8583. #define HTT_PPE_CFG_OVERRIDE_S 8
  8584. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8585. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8586. HTT_PPE_CFG_OVERRIDE_S)
  8587. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8588. do { \
  8589. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8590. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8591. } while (0)
  8592. /* DWORD 0: REO Destination Indication*/
  8593. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8594. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8595. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8596. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8597. HTT_PPE_CFG_REO_DEST_IND_S)
  8598. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8599. do { \
  8600. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8601. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8602. } while (0)
  8603. /* DWORD 0: Multi buffer MSDU override */
  8604. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8605. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8606. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8607. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8608. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8609. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8610. do { \
  8611. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8612. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8613. } while (0)
  8614. /* DWORD 0: Intra BSS override */
  8615. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8616. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8617. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8618. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8619. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8620. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8621. do { \
  8622. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8623. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8624. } while (0)
  8625. /* DWORD 0: Decap RAW override */
  8626. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8627. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8628. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8629. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8630. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8631. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8632. do { \
  8633. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8634. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8635. } while (0)
  8636. /* DWORD 0: Decap NWIFI override */
  8637. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8638. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8639. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8640. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8641. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8642. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8643. do { \
  8644. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8645. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8646. } while (0)
  8647. /* DWORD 0: IP frag override */
  8648. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8649. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8650. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8651. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8652. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8653. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8654. do { \
  8655. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8656. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8657. } while (0)
  8658. /*
  8659. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8660. *
  8661. * @details
  8662. * The following field definitions describe the format of the HTT host
  8663. * to target FW VDEV TX RX stats retrieve message.
  8664. * The message specifies the type of stats the host wants to retrieve.
  8665. *
  8666. * |31 27|26 25|24 17|16|15 8|7 0|
  8667. * |-----------------------------------------------------------|
  8668. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8669. * |-----------------------------------------------------------|
  8670. * | vdev_id lower bitmask |
  8671. * |-----------------------------------------------------------|
  8672. * | vdev_id upper bitmask |
  8673. * |-----------------------------------------------------------|
  8674. * Header fields:
  8675. * Where:
  8676. * dword0 - b'7:0 - msg_type: This will be set to
  8677. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8678. * b'15:8 - pdev id
  8679. * b'16(E) - Enable/Disable the vdev HW stats
  8680. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8681. * b'25:26(R) - Reset stats bits
  8682. * 0: don't reset stats
  8683. * 1: reset stats once
  8684. * 2: reset stats at the start of each periodic interval
  8685. * b'27:31 - reserved for future use
  8686. * dword1 - b'0:31 - vdev_id lower bitmask
  8687. * dword2 - b'0:31 - vdev_id upper bitmask
  8688. */
  8689. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8690. A_UINT32 msg_type :8,
  8691. pdev_id :8,
  8692. enable :1,
  8693. periodic_interval :8,
  8694. reset_stats_bits :2,
  8695. reserved0 :5;
  8696. A_UINT32 vdev_id_lower_bitmask;
  8697. A_UINT32 vdev_id_upper_bitmask;
  8698. } POSTPACK;
  8699. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8700. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8701. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8702. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8703. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8704. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8705. do { \
  8706. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8707. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8708. } while (0)
  8709. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8710. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8711. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8712. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8713. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8714. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8715. do { \
  8716. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8717. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8718. } while (0)
  8719. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8720. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8721. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8722. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8723. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8724. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8725. do { \
  8726. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8727. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8728. } while (0)
  8729. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8730. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8731. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8732. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8733. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8734. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8735. do { \
  8736. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8737. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8738. } while (0)
  8739. /*
  8740. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8741. *
  8742. * @details
  8743. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8744. * the default MSDU queues for one of the TIDs within the specified peer
  8745. * to the specified service class.
  8746. * The TID is indirectly specified - each service class is associated
  8747. * with a TID. All default MSDU queues for this peer-TID will be
  8748. * linked to the service class in question.
  8749. *
  8750. * |31 16|15 8|7 0|
  8751. * |------------------------------+--------------+--------------|
  8752. * | peer ID | svc class ID | msg type |
  8753. * |------------------------------------------------------------|
  8754. * Header fields:
  8755. * dword0 - b'7:0 - msg_type: This will be set to
  8756. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8757. * b'15:8 - service class ID
  8758. * b'31:16 - peer ID
  8759. */
  8760. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8761. A_UINT32 msg_type :8,
  8762. svc_class_id :8,
  8763. peer_id :16;
  8764. } POSTPACK;
  8765. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8766. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8767. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8768. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8769. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8770. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8771. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8772. do { \
  8773. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8774. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8775. } while (0)
  8776. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8777. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8778. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8779. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8780. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8781. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8782. do { \
  8783. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8784. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8785. } while (0)
  8786. /*
  8787. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8788. *
  8789. * @details
  8790. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8791. * remove the linkage of the specified peer-TID's MSDU queues to
  8792. * service classes.
  8793. *
  8794. * |31 16|15 8|7 0|
  8795. * |------------------------------+--------------+--------------|
  8796. * | peer ID | svc class ID | msg type |
  8797. * |------------------------------------------------------------|
  8798. * Header fields:
  8799. * dword0 - b'7:0 - msg_type: This will be set to
  8800. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8801. * b'15:8 - service class ID
  8802. * b'31:16 - peer ID
  8803. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8804. * value for peer ID indicates that the target should
  8805. * apply the UNMAP_REQ to all peers.
  8806. */
  8807. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8808. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8809. A_UINT32 msg_type :8,
  8810. svc_class_id :8,
  8811. peer_id :16;
  8812. } POSTPACK;
  8813. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8814. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8815. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8816. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8817. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8818. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8819. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8820. do { \
  8821. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8822. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8823. } while (0)
  8824. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8825. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8826. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8827. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8828. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8829. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8830. do { \
  8831. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8832. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8833. } while (0)
  8834. /*
  8835. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8836. *
  8837. * @details
  8838. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8839. * request the target to report what service class the default MSDU queues
  8840. * of the specified TIDs within the peer are linked to.
  8841. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8842. * to report what service class (if any) the default MSDU queues for
  8843. * each of the specified TIDs are linked to.
  8844. *
  8845. * |31 16|15 8|7 1| 0|
  8846. * |------------------------------+--------------+--------------|
  8847. * | peer ID | TID mask | msg type |
  8848. * |------------------------------------------------------------|
  8849. * | reserved |ETO|
  8850. * |------------------------------------------------------------|
  8851. * Header fields:
  8852. * dword0 - b'7:0 - msg_type: This will be set to
  8853. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8854. * b'15:8 - TID mask
  8855. * b'31:16 - peer ID
  8856. * dword1 - b'0 - "Existing Tids Only" flag
  8857. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8858. * message generated by this REQ will only show the
  8859. * mapping for TIDs that actually exist in the target's
  8860. * peer object.
  8861. * Any TIDs that are covered by a MAP_REQ but which
  8862. * do not actually exist will be shown as being
  8863. * unmapped (i.e. svc class ID 0xff).
  8864. * If this flag is cleared, the MAP_REPORT_CONF message
  8865. * will consider not only the mapping of TIDs currently
  8866. * existing in the peer, but also the mapping that will
  8867. * be applied for any TID objects created within this
  8868. * peer in the future.
  8869. * b'31:1 - reserved for future use
  8870. */
  8871. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8872. A_UINT32 msg_type :8,
  8873. tid_mask :8,
  8874. peer_id :16;
  8875. A_UINT32 existing_tids_only:1,
  8876. reserved :31;
  8877. } POSTPACK;
  8878. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8879. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8880. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8881. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8882. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8883. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8884. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8885. do { \
  8886. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8887. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8888. } while (0)
  8889. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8890. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8891. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8892. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8893. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8894. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8895. do { \
  8896. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8897. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8898. } while (0)
  8899. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8900. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8901. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8902. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8903. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8904. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8905. do { \
  8906. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8907. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8908. } while (0)
  8909. /**
  8910. * @brief Format of shared memory between Host and Target
  8911. * for UMAC hang recovery feature messaging.
  8912. * @details
  8913. * This is shared memory between Host and Target allocated
  8914. * and used in chips where UMAC hang recovery feature is supported.
  8915. * This shared memory is allocated per SOC level by Host since each
  8916. * SOC's target Q6FW needs to communicate independently to the Host
  8917. * through its own shared memory.
  8918. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8919. * then host interprets it as a new message from target.
  8920. * Host clears that particular read bit in t2h_msg after each read
  8921. * operation. It is vice versa for h2t_msg. At any given point
  8922. * of time there is expected to be only one bit set
  8923. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8924. *
  8925. * The message is interpreted as follows:
  8926. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8927. * added for debuggability purpose.
  8928. * dword1 - b'0 - do_pre_reset
  8929. * b'1 - do_post_reset_start
  8930. * b'2 - do_post_reset_complete
  8931. * b'3 - initiate_umac_recovery
  8932. * b'4:31 - rsvd_t2h
  8933. * dword2 - b'0 - pre_reset_done
  8934. * b'1 - post_reset_start_done
  8935. * b'2 - post_reset_complete_done
  8936. * b'3 - start_pre_reset
  8937. * b'4:31 - rsvd_h2t
  8938. */
  8939. PREPACK typedef struct {
  8940. /** Magic number added for debuggability. */
  8941. A_UINT32 magic_num;
  8942. union {
  8943. /*
  8944. * BIT [0] :- T2H msg to do pre-reset
  8945. * BIT [1] :- T2H msg to do post-reset start
  8946. * BIT [2] :- T2H msg to do post-reset complete
  8947. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8948. * This is needed to synchronize UMAC recovery
  8949. * across all SOCs.
  8950. * BIT [31 : 4] :- reserved
  8951. */
  8952. A_UINT32 t2h_msg;
  8953. struct {
  8954. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8955. do_post_reset_start : 1, /* BIT [1] */
  8956. do_post_reset_complete : 1, /* BIT [2] */
  8957. initiate_umac_recovery : 1, /* BIT [3] */
  8958. rsvd_t2h : 28; /* BIT [31 : 4] */
  8959. };
  8960. };
  8961. union {
  8962. /*
  8963. * BIT [0] :- H2T msg to send pre-reset done
  8964. * BIT [1] :- H2T msg to send post-reset start done
  8965. * BIT [2] :- H2T msg to send post-reset complete done
  8966. * BIT [3] :- H2T msg to start pre-reset.
  8967. * This is expected only after T2H
  8968. * initiate_umac_recovery was received by Host
  8969. * from one of the SOCs.
  8970. * BIT [31 : 4] :- reserved
  8971. */
  8972. A_UINT32 h2t_msg;
  8973. struct {
  8974. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8975. post_reset_start_done : 1, /* BIT [1] */
  8976. post_reset_complete_done : 1, /* BIT [2] */
  8977. start_pre_reset : 1, /* BIT [3] */
  8978. rsvd_h2t : 28; /* BIT [31 : 4] */
  8979. };
  8980. };
  8981. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8982. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8983. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8984. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8985. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8986. /* dword1 - b'0 - do_pre_reset */
  8987. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8988. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8989. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8990. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8991. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8992. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8993. do { \
  8994. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8995. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8996. } while (0)
  8997. /* dword1 - b'1 - do_post_reset_start */
  8998. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8999. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  9000. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  9001. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  9002. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  9003. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  9004. do { \
  9005. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  9006. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  9007. } while (0)
  9008. /* dword1 - b'2 - do_post_reset_complete */
  9009. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  9010. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  9011. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  9012. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  9013. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  9014. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9015. do { \
  9016. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9017. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9018. } while (0)
  9019. /* dword1 - b'3 - initiate_umac_recovery */
  9020. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9021. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9022. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9023. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9024. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9025. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9026. do { \
  9027. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9028. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9029. } while (0)
  9030. /* dword2 - b'0 - pre_reset_done */
  9031. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9032. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9033. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9034. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9035. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9036. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9037. do { \
  9038. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9039. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9040. } while (0)
  9041. /* dword2 - b'1 - post_reset_start_done */
  9042. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9043. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9044. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9045. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9046. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9047. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9048. do { \
  9049. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9050. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9051. } while (0)
  9052. /* dword2 - b'2 - post_reset_complete_done */
  9053. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9054. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9055. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9056. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9057. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9058. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9059. do { \
  9060. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9061. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9062. } while (0)
  9063. /* dword2 - b'3 - start_pre_reset */
  9064. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9065. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9066. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9067. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9068. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9069. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9070. do { \
  9071. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9072. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9073. } while (0)
  9074. /**
  9075. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9076. *
  9077. * @details
  9078. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9079. * by the host to provide prerequisite info to target for the UMAC hang
  9080. * recovery feature.
  9081. * The info sent in this H2T message are T2H message method, H2T message
  9082. * method, T2H MSI interrupt number and physical start address, size of
  9083. * the shared memory (refers to the shared memory dedicated for messaging
  9084. * between host and target when the DUT is in UMAC hang recovery mode).
  9085. * This H2T message is expected to be only sent if the WMI service bit
  9086. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9087. *
  9088. * |31 16|15 12|11 8|7 0|
  9089. * |-------------------------------+--------------+--------------+------------|
  9090. * | reserved |h2t msg method|t2h msg method| msg_type |
  9091. * |--------------------------------------------------------------------------|
  9092. * | t2h msi interrupt number |
  9093. * |--------------------------------------------------------------------------|
  9094. * | shared memory area size |
  9095. * |--------------------------------------------------------------------------|
  9096. * | shared memory area physical address low |
  9097. * |--------------------------------------------------------------------------|
  9098. * | shared memory area physical address high |
  9099. * |--------------------------------------------------------------------------|
  9100. *
  9101. * The message is interpreted as follows:
  9102. * dword0 - b'0:7 - msg_type
  9103. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9104. * b'8:11 - t2h_msg_method: indicates method to be used for
  9105. * T2H communication in UMAC hang recovery mode.
  9106. * Value zero indicates MSI interrupt (default method).
  9107. * Refer to htt_umac_hang_recovery_msg_method enum.
  9108. * b'12:15 - h2t_msg_method: indicates method to be used for
  9109. * H2T communication in UMAC hang recovery mode.
  9110. * Value zero indicates polling by target for this h2t msg
  9111. * during UMAC hang recovery mode.
  9112. * Refer to htt_umac_hang_recovery_msg_method enum.
  9113. * b'16:31 - reserved.
  9114. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9115. * T2H communication in UMAC hang recovery mode.
  9116. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9117. * only when in UMAC hang recovery mode.
  9118. * This refers to size in bytes.
  9119. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9120. * of the shared memory dedicated for messaging only when
  9121. * in UMAC hang recovery mode.
  9122. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9123. * of the shared memory dedicated for messaging only when
  9124. * in UMAC hang recovery mode.
  9125. */
  9126. /* t2h_msg_method and h2t_msg_method */
  9127. enum htt_umac_hang_recovery_msg_method {
  9128. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9129. };
  9130. PREPACK typedef struct {
  9131. A_UINT32 msg_type : 8,
  9132. t2h_msg_method : 4,
  9133. h2t_msg_method : 4,
  9134. reserved : 16;
  9135. A_UINT32 t2h_msi_data;
  9136. /* size bytes and physical address of shared memory. */
  9137. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9138. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9139. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9140. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9141. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9142. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9143. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9144. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9145. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9146. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9147. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9148. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9149. do { \
  9150. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9151. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9152. } while (0)
  9153. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9154. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9155. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9156. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9157. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9158. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9159. do { \
  9160. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9161. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9162. } while (0)
  9163. /**
  9164. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9165. *
  9166. * @details
  9167. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9168. * HTT message sent by the host to indicate that the target needs to start the
  9169. * UMAC hang recovery feature from the point of pre-reset routine.
  9170. * The purpose of this H2T message is to have host synchronize and trigger
  9171. * UMAC recovery across all targets.
  9172. * The info sent in this H2T message is the flag to indicate whether the
  9173. * target needs to execute UMAC-recovery in context of the Initiator or
  9174. * Non-Initiator.
  9175. * This H2T message is expected to be sent as response to the
  9176. * initiate_umac_recovery indication from the Initiator target attached to
  9177. * this same host.
  9178. * This H2T message is expected to be only sent if the WMI service bit
  9179. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9180. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9181. * beforehand.
  9182. *
  9183. * |31 9|8|7 0|
  9184. * |-----------------------------------------------------------|
  9185. * | reserved |I| msg_type |
  9186. * |-----------------------------------------------------------|
  9187. * Where:
  9188. * I = is_initiator
  9189. *
  9190. * The message is interpreted as follows:
  9191. * dword0 - b'0:7 - msg_type
  9192. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9193. * b'8 - is_initiator: indicates whether the target needs to
  9194. * execute the UMAC-recovery in context of the Initiator or
  9195. * Non-Initiator.
  9196. * The value zero indicates this target is Non-Initiator.
  9197. * b'9:31 - reserved.
  9198. */
  9199. PREPACK typedef struct {
  9200. A_UINT32 msg_type : 8,
  9201. is_initiator : 1,
  9202. reserved : 23;
  9203. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9204. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9205. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9206. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9207. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9208. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9209. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9210. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9211. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9212. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9213. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9214. do { \
  9215. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9216. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9217. } while (0)
  9218. /*
  9219. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9220. *
  9221. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9222. *
  9223. * @details
  9224. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9225. * install or uninstall rx cce super rules to match certain kind of packets
  9226. * with specific parameters. Target sets up HW registers based on setup message
  9227. * and always confirms back to Host.
  9228. *
  9229. * The message would appear as follows:
  9230. * |31 24|23 16|15 8|7 0|
  9231. * |-----------------+-----------------+-----------------+-----------------|
  9232. * | reserved | operation | vdev_id | msg_type |
  9233. * |-----------------------------------------------------------------------|
  9234. * | cce_super_rule_param[0] |
  9235. * |-----------------------------------------------------------------------|
  9236. * | cce_super_rule_param[1] |
  9237. * |-----------------------------------------------------------------------|
  9238. *
  9239. * The message is interpreted as follows:
  9240. * dword0 - b'0:7 - msg_type: This will be set to
  9241. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9242. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is for
  9243. * b'16:23 - operation: Identify operation to be taken,
  9244. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9245. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9246. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9247. * b'24:31 - reserved
  9248. * dword1~10 - cce_super_rule_param[0]:
  9249. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9250. * dword11~20 - cce_super_rule_param[1]:
  9251. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9252. *
  9253. * Each cce_super_rule_param structure would appear as follows:
  9254. * |31 24|23 16|15 8|7 0|
  9255. * |-----------------+-----------------+-----------------+-----------------|
  9256. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9257. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9258. * |-----------------------------------------------------------------------|
  9259. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9260. * |-----------------------------------------------------------------------|
  9261. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9262. * |-----------------------------------------------------------------------|
  9263. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9264. * |-----------------------------------------------------------------------|
  9265. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9266. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9267. * |-----------------------------------------------------------------------|
  9268. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9269. * |-----------------------------------------------------------------------|
  9270. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9271. * |-----------------------------------------------------------------------|
  9272. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9273. * |-----------------------------------------------------------------------|
  9274. * | is_valid | l4_type | l3_type |
  9275. * |-----------------------------------------------------------------------|
  9276. * | l4_dst_port | l4_src_port |
  9277. * |-----------------------------------------------------------------------|
  9278. *
  9279. * The cce_super_rule_param[0] structure is interpreted as follows:
  9280. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9281. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9282. * in case of ipv4)
  9283. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9284. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9285. * in case of ipv4)
  9286. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9287. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9288. * in case of ipv4)
  9289. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9290. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9291. * in case of ipv4)
  9292. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9293. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9294. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9295. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9296. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9297. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9298. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9299. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9300. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9301. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9302. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9303. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9304. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9305. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9306. * ipv4 address, in case of ipv4)
  9307. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9308. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9309. * ipv4 address, in case of ipv4)
  9310. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9311. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9312. * ipv4 address, in case of ipv4)
  9313. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9314. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9315. * ipv4 address, in case of ipv4)
  9316. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9317. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9318. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9319. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9320. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9321. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9322. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9323. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9324. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9325. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9326. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9327. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9328. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9329. * 0x0008: ipv4
  9330. * 0xdd86: ipv6
  9331. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9332. * 6: TCP
  9333. * 17: UDP
  9334. * b'24:31 - is_valid: indicate whether this parameter is valid
  9335. * 0: invalid
  9336. * 1: valid
  9337. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9338. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9339. *
  9340. * The cce_super_rule_param[1] structure is similar.
  9341. */
  9342. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9343. enum htt_rx_cce_super_rule_setup_operation {
  9344. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9345. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9346. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9347. /* All operation should be before this */
  9348. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9349. };
  9350. typedef struct {
  9351. union {
  9352. A_UINT8 src_ipv4_addr[4];
  9353. A_UINT8 src_ipv6_addr[16];
  9354. };
  9355. union {
  9356. A_UINT8 dst_ipv4_addr[4];
  9357. A_UINT8 dst_ipv6_addr[16];
  9358. };
  9359. A_UINT32 l3_type: 16,
  9360. l4_type: 8,
  9361. is_valid: 8;
  9362. A_UINT32 l4_src_port: 16,
  9363. l4_dst_port: 16;
  9364. } htt_rx_cce_super_rule_param_t;
  9365. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9366. A_UINT32 msg_type: 8,
  9367. vdev_id: 8,
  9368. operation: 8,
  9369. reserved: 8;
  9370. htt_rx_cce_super_rule_param_t
  9371. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9372. } POSTPACK;
  9373. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9374. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9375. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M 0x0000ff00
  9376. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S 8
  9377. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_GET(_var) \
  9378. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M) >> \
  9379. HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)
  9380. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_SET(_var, _val) \
  9381. do { \
  9382. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID, _val); \
  9383. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)); \
  9384. } while (0)
  9385. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9386. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9387. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9388. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9389. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9390. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9391. do { \
  9392. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9393. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9394. } while (0)
  9395. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9396. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9397. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9398. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9399. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9400. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9401. do { \
  9402. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9403. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9404. } while (0)
  9405. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9406. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9407. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9408. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9409. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9410. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9411. do { \
  9412. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9413. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9414. } while (0)
  9415. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9416. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9417. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9418. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9419. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9420. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9421. do { \
  9422. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9423. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9424. } while (0)
  9425. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9426. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9427. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9428. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9429. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9430. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9431. do { \
  9432. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9433. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9434. } while (0)
  9435. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9436. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9437. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9438. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9439. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9440. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9441. do { \
  9442. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9443. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9444. } while (0)
  9445. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9446. do { \
  9447. A_MEMCPY(_array, _ptr, 4); \
  9448. } while (0)
  9449. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9450. do { \
  9451. A_MEMCPY(_ptr, _array, 4); \
  9452. } while (0)
  9453. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9454. do { \
  9455. A_MEMCPY(_array, _ptr, 16); \
  9456. } while (0)
  9457. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9458. do { \
  9459. A_MEMCPY(_ptr, _array, 16); \
  9460. } while (0)
  9461. /*=== target -> host messages ===============================================*/
  9462. enum htt_t2h_msg_type {
  9463. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9464. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9465. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9466. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9467. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9468. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9469. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9470. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9471. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9472. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9473. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9474. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9475. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9476. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9477. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9478. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9479. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9480. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9481. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9482. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9483. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9484. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9485. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9486. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9487. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9488. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9489. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9490. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9491. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9492. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9493. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9494. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9495. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9496. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9497. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9498. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9499. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9500. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9501. /* TX_OFFLOAD_DELIVER_IND:
  9502. * Forward the target's locally-generated packets to the host,
  9503. * to provide to the monitor mode interface.
  9504. */
  9505. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9506. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9507. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9508. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9509. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9510. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9511. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9512. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9513. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9514. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9515. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9516. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9517. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9518. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9519. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9520. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9521. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9522. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND = 0x34,
  9523. HTT_T2H_MSG_TYPE_RX_DATA_IND = 0x35,
  9524. HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND = 0x36,
  9525. HTT_T2H_MSG_TYPE_TEST,
  9526. /* keep this last */
  9527. HTT_T2H_NUM_MSGS
  9528. };
  9529. /*
  9530. * HTT target to host message type -
  9531. * stored in bits 7:0 of the first word of the message
  9532. */
  9533. #define HTT_T2H_MSG_TYPE_M 0xff
  9534. #define HTT_T2H_MSG_TYPE_S 0
  9535. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9536. do { \
  9537. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9538. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9539. } while (0)
  9540. #define HTT_T2H_MSG_TYPE_GET(word) \
  9541. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9542. /**
  9543. * @brief target -> host version number confirmation message definition
  9544. *
  9545. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9546. *
  9547. * |31 24|23 16|15 8|7 0|
  9548. * |----------------+----------------+----------------+----------------|
  9549. * | reserved | major number | minor number | msg type |
  9550. * |-------------------------------------------------------------------|
  9551. * : option request TLV (optional) |
  9552. * :...................................................................:
  9553. *
  9554. * The VER_CONF message may consist of a single 4-byte word, or may be
  9555. * extended with TLVs that specify HTT options selected by the target.
  9556. * The following option TLVs may be appended to the VER_CONF message:
  9557. * - LL_BUS_ADDR_SIZE
  9558. * - HL_SUPPRESS_TX_COMPL_IND
  9559. * - MAX_TX_QUEUE_GROUPS
  9560. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9561. * may be appended to the VER_CONF message (but only one TLV of each type).
  9562. *
  9563. * Header fields:
  9564. * - MSG_TYPE
  9565. * Bits 7:0
  9566. * Purpose: identifies this as a version number confirmation message
  9567. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9568. * - VER_MINOR
  9569. * Bits 15:8
  9570. * Purpose: Specify the minor number of the HTT message library version
  9571. * in use by the target firmware.
  9572. * The minor number specifies the specific revision within a range
  9573. * of fundamentally compatible HTT message definition revisions.
  9574. * Compatible revisions involve adding new messages or perhaps
  9575. * adding new fields to existing messages, in a backwards-compatible
  9576. * manner.
  9577. * Incompatible revisions involve changing the message type values,
  9578. * or redefining existing messages.
  9579. * Value: minor number
  9580. * - VER_MAJOR
  9581. * Bits 15:8
  9582. * Purpose: Specify the major number of the HTT message library version
  9583. * in use by the target firmware.
  9584. * The major number specifies the family of minor revisions that are
  9585. * fundamentally compatible with each other, but not with prior or
  9586. * later families.
  9587. * Value: major number
  9588. */
  9589. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9590. #define HTT_VER_CONF_MINOR_S 8
  9591. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9592. #define HTT_VER_CONF_MAJOR_S 16
  9593. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9594. do { \
  9595. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9596. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9597. } while (0)
  9598. #define HTT_VER_CONF_MINOR_GET(word) \
  9599. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9600. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9601. do { \
  9602. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9603. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9604. } while (0)
  9605. #define HTT_VER_CONF_MAJOR_GET(word) \
  9606. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9607. #define HTT_VER_CONF_BYTES 4
  9608. /**
  9609. * @brief - target -> host HTT Rx In order indication message
  9610. *
  9611. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9612. *
  9613. * @details
  9614. *
  9615. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9616. * |----------------+-------------------+---------------------+---------------|
  9617. * | peer ID | P| F| O| ext TID | msg type |
  9618. * |--------------------------------------------------------------------------|
  9619. * | MSDU count | Reserved | vdev id |
  9620. * |--------------------------------------------------------------------------|
  9621. * | MSDU 0 bus address (bits 31:0) |
  9622. #if HTT_PADDR64
  9623. * | MSDU 0 bus address (bits 63:32) |
  9624. #endif
  9625. * |--------------------------------------------------------------------------|
  9626. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9627. * |--------------------------------------------------------------------------|
  9628. * | MSDU 1 bus address (bits 31:0) |
  9629. #if HTT_PADDR64
  9630. * | MSDU 1 bus address (bits 63:32) |
  9631. #endif
  9632. * |--------------------------------------------------------------------------|
  9633. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9634. * |--------------------------------------------------------------------------|
  9635. */
  9636. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9637. *
  9638. * @details
  9639. * bits
  9640. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9641. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9642. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9643. * | | frag | | | | fail |chksum fail|
  9644. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9645. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9646. */
  9647. struct htt_rx_in_ord_paddr_ind_hdr_t
  9648. {
  9649. A_UINT32 /* word 0 */
  9650. msg_type: 8,
  9651. ext_tid: 5,
  9652. offload: 1,
  9653. frag: 1,
  9654. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9655. peer_id: 16;
  9656. A_UINT32 /* word 1 */
  9657. vap_id: 8,
  9658. /* NOTE:
  9659. * This reserved_1 field is not truly reserved - certain targets use
  9660. * this field internally to store debug information, and do not zero
  9661. * out the contents of the field before uploading the message to the
  9662. * host. Thus, any host-target communication supported by this field
  9663. * is limited to using values that are never used by the debug
  9664. * information stored by certain targets in the reserved_1 field.
  9665. * In particular, the targets in question don't use the value 0x3
  9666. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9667. * so this previously-unused value within these bits is available to
  9668. * use as the host / target PKT_CAPTURE_MODE flag.
  9669. */
  9670. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9671. /* if pkt_capture_mode == 0x3, host should
  9672. * send rx frames to monitor mode interface
  9673. */
  9674. msdu_cnt: 16;
  9675. };
  9676. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9677. {
  9678. A_UINT32 dma_addr;
  9679. A_UINT32
  9680. length: 16,
  9681. fw_desc: 8,
  9682. msdu_info:8;
  9683. };
  9684. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9685. {
  9686. A_UINT32 dma_addr_lo;
  9687. A_UINT32 dma_addr_hi;
  9688. A_UINT32
  9689. length: 16,
  9690. fw_desc: 8,
  9691. msdu_info:8;
  9692. };
  9693. #if HTT_PADDR64
  9694. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9695. #else
  9696. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9697. #endif
  9698. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9699. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9700. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9701. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9702. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9703. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9704. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9705. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9706. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9707. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9708. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9709. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9710. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9711. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9712. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9713. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9714. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9715. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9716. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9717. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9718. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9719. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9720. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9721. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9722. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9723. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9724. /* for systems using 64-bit format for bus addresses */
  9725. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9726. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9727. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9728. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9729. /* for systems using 32-bit format for bus addresses */
  9730. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9731. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9732. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9733. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9734. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9735. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9736. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9737. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9738. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9739. do { \
  9740. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9741. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9742. } while (0)
  9743. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9744. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9745. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9746. do { \
  9747. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9748. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9749. } while (0)
  9750. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9751. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9752. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9753. do { \
  9754. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9755. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9756. } while (0)
  9757. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9758. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9759. /*
  9760. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9761. * deliver the rx frames to the monitor mode interface.
  9762. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9763. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9764. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9765. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9766. */
  9767. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9768. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9769. do { \
  9770. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9771. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9772. } while (0)
  9773. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9774. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9775. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9776. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9777. do { \
  9778. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9779. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9780. } while (0)
  9781. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9782. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9783. /* for systems using 64-bit format for bus addresses */
  9784. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9785. do { \
  9786. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9787. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9788. } while (0)
  9789. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9790. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9791. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9792. do { \
  9793. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9794. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9795. } while (0)
  9796. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9797. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9798. /* for systems using 32-bit format for bus addresses */
  9799. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9800. do { \
  9801. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9802. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9803. } while (0)
  9804. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9805. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9806. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9807. do { \
  9808. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9809. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9810. } while (0)
  9811. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9812. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9813. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9814. do { \
  9815. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9816. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9817. } while (0)
  9818. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9819. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9820. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9821. do { \
  9822. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9823. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9824. } while (0)
  9825. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9826. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9827. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9828. do { \
  9829. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9830. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9831. } while (0)
  9832. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9833. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9834. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9835. do { \
  9836. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9837. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9838. } while (0)
  9839. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9840. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9841. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9842. do { \
  9843. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9844. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9845. } while (0)
  9846. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9847. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9848. /* definitions used within target -> host rx indication message */
  9849. PREPACK struct htt_rx_ind_hdr_prefix_t
  9850. {
  9851. A_UINT32 /* word 0 */
  9852. msg_type: 8,
  9853. ext_tid: 5,
  9854. release_valid: 1,
  9855. flush_valid: 1,
  9856. reserved0: 1,
  9857. peer_id: 16;
  9858. A_UINT32 /* word 1 */
  9859. flush_start_seq_num: 6,
  9860. flush_end_seq_num: 6,
  9861. release_start_seq_num: 6,
  9862. release_end_seq_num: 6,
  9863. num_mpdu_ranges: 8;
  9864. } POSTPACK;
  9865. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9866. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9867. #define HTT_TGT_RSSI_INVALID 0x80
  9868. PREPACK struct htt_rx_ppdu_desc_t
  9869. {
  9870. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9871. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9872. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9873. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9874. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9875. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9876. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9877. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9878. A_UINT32 /* word 0 */
  9879. rssi_cmb: 8,
  9880. timestamp_submicrosec: 8,
  9881. phy_err_code: 8,
  9882. phy_err: 1,
  9883. legacy_rate: 4,
  9884. legacy_rate_sel: 1,
  9885. end_valid: 1,
  9886. start_valid: 1;
  9887. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9888. union {
  9889. A_UINT32 /* word 1 */
  9890. rssi0_pri20: 8,
  9891. rssi0_ext20: 8,
  9892. rssi0_ext40: 8,
  9893. rssi0_ext80: 8;
  9894. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9895. } u0;
  9896. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9897. union {
  9898. A_UINT32 /* word 2 */
  9899. rssi1_pri20: 8,
  9900. rssi1_ext20: 8,
  9901. rssi1_ext40: 8,
  9902. rssi1_ext80: 8;
  9903. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9904. } u1;
  9905. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9906. union {
  9907. A_UINT32 /* word 3 */
  9908. rssi2_pri20: 8,
  9909. rssi2_ext20: 8,
  9910. rssi2_ext40: 8,
  9911. rssi2_ext80: 8;
  9912. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9913. } u2;
  9914. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9915. union {
  9916. A_UINT32 /* word 4 */
  9917. rssi3_pri20: 8,
  9918. rssi3_ext20: 8,
  9919. rssi3_ext40: 8,
  9920. rssi3_ext80: 8;
  9921. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9922. } u3;
  9923. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9924. A_UINT32 tsf32; /* word 5 */
  9925. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9926. A_UINT32 timestamp_microsec; /* word 6 */
  9927. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9928. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9929. A_UINT32 /* word 7 */
  9930. vht_sig_a1: 24,
  9931. preamble_type: 8;
  9932. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9933. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9934. A_UINT32 /* word 8 */
  9935. vht_sig_a2: 24,
  9936. /* sa_ant_matrix
  9937. * For cases where a single rx chain has options to be connected to
  9938. * different rx antennas, show which rx antennas were in use during
  9939. * receipt of a given PPDU.
  9940. * This sa_ant_matrix provides a bitmask of the antennas used while
  9941. * receiving this frame.
  9942. */
  9943. sa_ant_matrix: 8;
  9944. } POSTPACK;
  9945. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9946. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9947. PREPACK struct htt_rx_ind_hdr_suffix_t
  9948. {
  9949. A_UINT32 /* word 0 */
  9950. fw_rx_desc_bytes: 16,
  9951. reserved0: 16;
  9952. } POSTPACK;
  9953. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9954. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9955. PREPACK struct htt_rx_ind_hdr_t
  9956. {
  9957. struct htt_rx_ind_hdr_prefix_t prefix;
  9958. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9959. struct htt_rx_ind_hdr_suffix_t suffix;
  9960. } POSTPACK;
  9961. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9962. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9963. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9964. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9965. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9966. /*
  9967. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9968. * the offset into the HTT rx indication message at which the
  9969. * FW rx PPDU descriptor resides
  9970. */
  9971. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9972. /*
  9973. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9974. * the offset into the HTT rx indication message at which the
  9975. * header suffix (FW rx MSDU byte count) resides
  9976. */
  9977. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9978. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9979. /*
  9980. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9981. * the offset into the HTT rx indication message at which the per-MSDU
  9982. * information starts
  9983. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9984. * per-MSDU information portion of the message. The per-MSDU info itself
  9985. * starts at byte 12.
  9986. */
  9987. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9988. /**
  9989. * @brief target -> host rx indication message definition
  9990. *
  9991. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9992. *
  9993. * @details
  9994. * The following field definitions describe the format of the rx indication
  9995. * message sent from the target to the host.
  9996. * The message consists of three major sections:
  9997. * 1. a fixed-length header
  9998. * 2. a variable-length list of firmware rx MSDU descriptors
  9999. * 3. one or more 4-octet MPDU range information elements
  10000. * The fixed length header itself has two sub-sections
  10001. * 1. the message meta-information, including identification of the
  10002. * sender and type of the received data, and a 4-octet flush/release IE
  10003. * 2. the firmware rx PPDU descriptor
  10004. *
  10005. * The format of the message is depicted below.
  10006. * in this depiction, the following abbreviations are used for information
  10007. * elements within the message:
  10008. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  10009. * elements associated with the PPDU start are valid.
  10010. * Specifically, the following fields are valid only if SV is set:
  10011. * RSSI (all variants), L, legacy rate, preamble type, service,
  10012. * VHT-SIG-A
  10013. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  10014. * elements associated with the PPDU end are valid.
  10015. * Specifically, the following fields are valid only if EV is set:
  10016. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  10017. * - L - Legacy rate selector - if legacy rates are used, this flag
  10018. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10019. * (L == 0) PHY.
  10020. * - P - PHY error flag - boolean indication of whether the rx frame had
  10021. * a PHY error
  10022. *
  10023. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10024. * |----------------+-------------------+---------------------+---------------|
  10025. * | peer ID | |RV|FV| ext TID | msg type |
  10026. * |--------------------------------------------------------------------------|
  10027. * | num | release | release | flush | flush |
  10028. * | MPDU | end | start | end | start |
  10029. * | ranges | seq num | seq num | seq num | seq num |
  10030. * |==========================================================================|
  10031. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10032. * |V|V| | rate | | | timestamp | RSSI |
  10033. * |--------------------------------------------------------------------------|
  10034. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10035. * |--------------------------------------------------------------------------|
  10036. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10037. * |--------------------------------------------------------------------------|
  10038. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10039. * |--------------------------------------------------------------------------|
  10040. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10041. * |--------------------------------------------------------------------------|
  10042. * | TSF LSBs |
  10043. * |--------------------------------------------------------------------------|
  10044. * | microsec timestamp |
  10045. * |--------------------------------------------------------------------------|
  10046. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10047. * |--------------------------------------------------------------------------|
  10048. * | service | HT-SIG / VHT-SIG-A2 |
  10049. * |==========================================================================|
  10050. * | reserved | FW rx desc bytes |
  10051. * |--------------------------------------------------------------------------|
  10052. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10053. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10054. * |--------------------------------------------------------------------------|
  10055. * : : :
  10056. * |--------------------------------------------------------------------------|
  10057. * | alignment | MSDU Rx |
  10058. * | padding | desc Bn |
  10059. * |--------------------------------------------------------------------------|
  10060. * | reserved | MPDU range status | MPDU count |
  10061. * |--------------------------------------------------------------------------|
  10062. * : reserved : MPDU range status : MPDU count :
  10063. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10064. *
  10065. * Header fields:
  10066. * - MSG_TYPE
  10067. * Bits 7:0
  10068. * Purpose: identifies this as an rx indication message
  10069. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10070. * - EXT_TID
  10071. * Bits 12:8
  10072. * Purpose: identify the traffic ID of the rx data, including
  10073. * special "extended" TID values for multicast, broadcast, and
  10074. * non-QoS data frames
  10075. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10076. * - FLUSH_VALID (FV)
  10077. * Bit 13
  10078. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10079. * is valid
  10080. * Value:
  10081. * 1 -> flush IE is valid and needs to be processed
  10082. * 0 -> flush IE is not valid and should be ignored
  10083. * - REL_VALID (RV)
  10084. * Bit 13
  10085. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10086. * is valid
  10087. * Value:
  10088. * 1 -> release IE is valid and needs to be processed
  10089. * 0 -> release IE is not valid and should be ignored
  10090. * - PEER_ID
  10091. * Bits 31:16
  10092. * Purpose: Identify, by ID, which peer sent the rx data
  10093. * Value: ID of the peer who sent the rx data
  10094. * - FLUSH_SEQ_NUM_START
  10095. * Bits 5:0
  10096. * Purpose: Indicate the start of a series of MPDUs to flush
  10097. * Not all MPDUs within this series are necessarily valid - the host
  10098. * must check each sequence number within this range to see if the
  10099. * corresponding MPDU is actually present.
  10100. * This field is only valid if the FV bit is set.
  10101. * Value:
  10102. * The sequence number for the first MPDUs to check to flush.
  10103. * The sequence number is masked by 0x3f.
  10104. * - FLUSH_SEQ_NUM_END
  10105. * Bits 11:6
  10106. * Purpose: Indicate the end of a series of MPDUs to flush
  10107. * Value:
  10108. * The sequence number one larger than the sequence number of the
  10109. * last MPDU to check to flush.
  10110. * The sequence number is masked by 0x3f.
  10111. * Not all MPDUs within this series are necessarily valid - the host
  10112. * must check each sequence number within this range to see if the
  10113. * corresponding MPDU is actually present.
  10114. * This field is only valid if the FV bit is set.
  10115. * - REL_SEQ_NUM_START
  10116. * Bits 17:12
  10117. * Purpose: Indicate the start of a series of MPDUs to release.
  10118. * All MPDUs within this series are present and valid - the host
  10119. * need not check each sequence number within this range to see if
  10120. * the corresponding MPDU is actually present.
  10121. * This field is only valid if the RV bit is set.
  10122. * Value:
  10123. * The sequence number for the first MPDUs to check to release.
  10124. * The sequence number is masked by 0x3f.
  10125. * - REL_SEQ_NUM_END
  10126. * Bits 23:18
  10127. * Purpose: Indicate the end of a series of MPDUs to release.
  10128. * Value:
  10129. * The sequence number one larger than the sequence number of the
  10130. * last MPDU to check to release.
  10131. * The sequence number is masked by 0x3f.
  10132. * All MPDUs within this series are present and valid - the host
  10133. * need not check each sequence number within this range to see if
  10134. * the corresponding MPDU is actually present.
  10135. * This field is only valid if the RV bit is set.
  10136. * - NUM_MPDU_RANGES
  10137. * Bits 31:24
  10138. * Purpose: Indicate how many ranges of MPDUs are present.
  10139. * Each MPDU range consists of a series of contiguous MPDUs within the
  10140. * rx frame sequence which all have the same MPDU status.
  10141. * Value: 1-63 (typically a small number, like 1-3)
  10142. *
  10143. * Rx PPDU descriptor fields:
  10144. * - RSSI_CMB
  10145. * Bits 7:0
  10146. * Purpose: Combined RSSI from all active rx chains, across the active
  10147. * bandwidth.
  10148. * Value: RSSI dB units w.r.t. noise floor
  10149. * - TIMESTAMP_SUBMICROSEC
  10150. * Bits 15:8
  10151. * Purpose: high-resolution timestamp
  10152. * Value:
  10153. * Sub-microsecond time of PPDU reception.
  10154. * This timestamp ranges from [0,MAC clock MHz).
  10155. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10156. * to form a high-resolution, large range rx timestamp.
  10157. * - PHY_ERR_CODE
  10158. * Bits 23:16
  10159. * Purpose:
  10160. * If the rx frame processing resulted in a PHY error, indicate what
  10161. * type of rx PHY error occurred.
  10162. * Value:
  10163. * This field is valid if the "P" (PHY_ERR) flag is set.
  10164. * TBD: document/specify the values for this field
  10165. * - PHY_ERR
  10166. * Bit 24
  10167. * Purpose: indicate whether the rx PPDU had a PHY error
  10168. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10169. * - LEGACY_RATE
  10170. * Bits 28:25
  10171. * Purpose:
  10172. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10173. * specify which rate was used.
  10174. * Value:
  10175. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10176. * flag.
  10177. * If LEGACY_RATE_SEL is 0:
  10178. * 0x8: OFDM 48 Mbps
  10179. * 0x9: OFDM 24 Mbps
  10180. * 0xA: OFDM 12 Mbps
  10181. * 0xB: OFDM 6 Mbps
  10182. * 0xC: OFDM 54 Mbps
  10183. * 0xD: OFDM 36 Mbps
  10184. * 0xE: OFDM 18 Mbps
  10185. * 0xF: OFDM 9 Mbps
  10186. * If LEGACY_RATE_SEL is 1:
  10187. * 0x8: CCK 11 Mbps long preamble
  10188. * 0x9: CCK 5.5 Mbps long preamble
  10189. * 0xA: CCK 2 Mbps long preamble
  10190. * 0xB: CCK 1 Mbps long preamble
  10191. * 0xC: CCK 11 Mbps short preamble
  10192. * 0xD: CCK 5.5 Mbps short preamble
  10193. * 0xE: CCK 2 Mbps short preamble
  10194. * - LEGACY_RATE_SEL
  10195. * Bit 29
  10196. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10197. * Value:
  10198. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10199. * used a legacy rate.
  10200. * 0 -> OFDM, 1 -> CCK
  10201. * - END_VALID
  10202. * Bit 30
  10203. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10204. * the start of the PPDU are valid. Specifically, the following
  10205. * fields are only valid if END_VALID is set:
  10206. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10207. * TIMESTAMP_SUBMICROSEC
  10208. * Value:
  10209. * 0 -> rx PPDU desc end fields are not valid
  10210. * 1 -> rx PPDU desc end fields are valid
  10211. * - START_VALID
  10212. * Bit 31
  10213. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10214. * the end of the PPDU are valid. Specifically, the following
  10215. * fields are only valid if START_VALID is set:
  10216. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10217. * VHT-SIG-A
  10218. * Value:
  10219. * 0 -> rx PPDU desc start fields are not valid
  10220. * 1 -> rx PPDU desc start fields are valid
  10221. * - RSSI0_PRI20
  10222. * Bits 7:0
  10223. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10224. * Value: RSSI dB units w.r.t. noise floor
  10225. *
  10226. * - RSSI0_EXT20
  10227. * Bits 7:0
  10228. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10229. * (if the rx bandwidth was >= 40 MHz)
  10230. * Value: RSSI dB units w.r.t. noise floor
  10231. * - RSSI0_EXT40
  10232. * Bits 7:0
  10233. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10234. * (if the rx bandwidth was >= 80 MHz)
  10235. * Value: RSSI dB units w.r.t. noise floor
  10236. * - RSSI0_EXT80
  10237. * Bits 7:0
  10238. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10239. * (if the rx bandwidth was >= 160 MHz)
  10240. * Value: RSSI dB units w.r.t. noise floor
  10241. *
  10242. * - RSSI1_PRI20
  10243. * Bits 7:0
  10244. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10245. * Value: RSSI dB units w.r.t. noise floor
  10246. * - RSSI1_EXT20
  10247. * Bits 7:0
  10248. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10249. * (if the rx bandwidth was >= 40 MHz)
  10250. * Value: RSSI dB units w.r.t. noise floor
  10251. * - RSSI1_EXT40
  10252. * Bits 7:0
  10253. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10254. * (if the rx bandwidth was >= 80 MHz)
  10255. * Value: RSSI dB units w.r.t. noise floor
  10256. * - RSSI1_EXT80
  10257. * Bits 7:0
  10258. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10259. * (if the rx bandwidth was >= 160 MHz)
  10260. * Value: RSSI dB units w.r.t. noise floor
  10261. *
  10262. * - RSSI2_PRI20
  10263. * Bits 7:0
  10264. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10265. * Value: RSSI dB units w.r.t. noise floor
  10266. * - RSSI2_EXT20
  10267. * Bits 7:0
  10268. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10269. * (if the rx bandwidth was >= 40 MHz)
  10270. * Value: RSSI dB units w.r.t. noise floor
  10271. * - RSSI2_EXT40
  10272. * Bits 7:0
  10273. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10274. * (if the rx bandwidth was >= 80 MHz)
  10275. * Value: RSSI dB units w.r.t. noise floor
  10276. * - RSSI2_EXT80
  10277. * Bits 7:0
  10278. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10279. * (if the rx bandwidth was >= 160 MHz)
  10280. * Value: RSSI dB units w.r.t. noise floor
  10281. *
  10282. * - RSSI3_PRI20
  10283. * Bits 7:0
  10284. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10285. * Value: RSSI dB units w.r.t. noise floor
  10286. * - RSSI3_EXT20
  10287. * Bits 7:0
  10288. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10289. * (if the rx bandwidth was >= 40 MHz)
  10290. * Value: RSSI dB units w.r.t. noise floor
  10291. * - RSSI3_EXT40
  10292. * Bits 7:0
  10293. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10294. * (if the rx bandwidth was >= 80 MHz)
  10295. * Value: RSSI dB units w.r.t. noise floor
  10296. * - RSSI3_EXT80
  10297. * Bits 7:0
  10298. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10299. * (if the rx bandwidth was >= 160 MHz)
  10300. * Value: RSSI dB units w.r.t. noise floor
  10301. *
  10302. * - TSF32
  10303. * Bits 31:0
  10304. * Purpose: specify the time the rx PPDU was received, in TSF units
  10305. * Value: 32 LSBs of the TSF
  10306. * - TIMESTAMP_MICROSEC
  10307. * Bits 31:0
  10308. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10309. * Value: PPDU rx time, in microseconds
  10310. * - VHT_SIG_A1
  10311. * Bits 23:0
  10312. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10313. * from the rx PPDU
  10314. * Value:
  10315. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10316. * VHT-SIG-A1 data.
  10317. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10318. * first 24 bits of the HT-SIG data.
  10319. * Otherwise, this field is invalid.
  10320. * Refer to the the 802.11 protocol for the definition of the
  10321. * HT-SIG and VHT-SIG-A1 fields
  10322. * - VHT_SIG_A2
  10323. * Bits 23:0
  10324. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10325. * from the rx PPDU
  10326. * Value:
  10327. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10328. * VHT-SIG-A2 data.
  10329. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10330. * last 24 bits of the HT-SIG data.
  10331. * Otherwise, this field is invalid.
  10332. * Refer to the the 802.11 protocol for the definition of the
  10333. * HT-SIG and VHT-SIG-A2 fields
  10334. * - PREAMBLE_TYPE
  10335. * Bits 31:24
  10336. * Purpose: indicate the PHY format of the received burst
  10337. * Value:
  10338. * 0x4: Legacy (OFDM/CCK)
  10339. * 0x8: HT
  10340. * 0x9: HT with TxBF
  10341. * 0xC: VHT
  10342. * 0xD: VHT with TxBF
  10343. * - SERVICE
  10344. * Bits 31:24
  10345. * Purpose: TBD
  10346. * Value: TBD
  10347. *
  10348. * Rx MSDU descriptor fields:
  10349. * - FW_RX_DESC_BYTES
  10350. * Bits 15:0
  10351. * Purpose: Indicate how many bytes in the Rx indication are used for
  10352. * FW Rx descriptors
  10353. *
  10354. * Payload fields:
  10355. * - MPDU_COUNT
  10356. * Bits 7:0
  10357. * Purpose: Indicate how many sequential MPDUs share the same status.
  10358. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10359. * - MPDU_STATUS
  10360. * Bits 15:8
  10361. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10362. * received successfully.
  10363. * Value:
  10364. * 0x1: success
  10365. * 0x2: FCS error
  10366. * 0x3: duplicate error
  10367. * 0x4: replay error
  10368. * 0x5: invalid peer
  10369. */
  10370. /* header fields */
  10371. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10372. #define HTT_RX_IND_EXT_TID_S 8
  10373. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10374. #define HTT_RX_IND_FLUSH_VALID_S 13
  10375. #define HTT_RX_IND_REL_VALID_M 0x4000
  10376. #define HTT_RX_IND_REL_VALID_S 14
  10377. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10378. #define HTT_RX_IND_PEER_ID_S 16
  10379. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10380. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10381. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10382. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10383. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10384. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10385. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10386. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10387. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10388. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10389. /* rx PPDU descriptor fields */
  10390. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10391. #define HTT_RX_IND_RSSI_CMB_S 0
  10392. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10393. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10394. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10395. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10396. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10397. #define HTT_RX_IND_PHY_ERR_S 24
  10398. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10399. #define HTT_RX_IND_LEGACY_RATE_S 25
  10400. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10401. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10402. #define HTT_RX_IND_END_VALID_M 0x40000000
  10403. #define HTT_RX_IND_END_VALID_S 30
  10404. #define HTT_RX_IND_START_VALID_M 0x80000000
  10405. #define HTT_RX_IND_START_VALID_S 31
  10406. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10407. #define HTT_RX_IND_RSSI_PRI20_S 0
  10408. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10409. #define HTT_RX_IND_RSSI_EXT20_S 8
  10410. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10411. #define HTT_RX_IND_RSSI_EXT40_S 16
  10412. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10413. #define HTT_RX_IND_RSSI_EXT80_S 24
  10414. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10415. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10416. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10417. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10418. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10419. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10420. #define HTT_RX_IND_SERVICE_M 0xff000000
  10421. #define HTT_RX_IND_SERVICE_S 24
  10422. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10423. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10424. /* rx MSDU descriptor fields */
  10425. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10426. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10427. /* payload fields */
  10428. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10429. #define HTT_RX_IND_MPDU_COUNT_S 0
  10430. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10431. #define HTT_RX_IND_MPDU_STATUS_S 8
  10432. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10433. do { \
  10434. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10435. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10436. } while (0)
  10437. #define HTT_RX_IND_EXT_TID_GET(word) \
  10438. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10439. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10440. do { \
  10441. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10442. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10443. } while (0)
  10444. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10445. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10446. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10447. do { \
  10448. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10449. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10450. } while (0)
  10451. #define HTT_RX_IND_REL_VALID_GET(word) \
  10452. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10453. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10454. do { \
  10455. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10456. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10457. } while (0)
  10458. #define HTT_RX_IND_PEER_ID_GET(word) \
  10459. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10460. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10461. do { \
  10462. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10463. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10464. } while (0)
  10465. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10466. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10467. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10468. do { \
  10469. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10470. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10471. } while (0)
  10472. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10473. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10474. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10475. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10476. do { \
  10477. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10478. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10479. } while (0)
  10480. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10481. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10482. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10483. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10484. do { \
  10485. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10486. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10487. } while (0)
  10488. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10489. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10490. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10491. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10492. do { \
  10493. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10494. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10495. } while (0)
  10496. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10497. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10498. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10499. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10500. do { \
  10501. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10502. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10503. } while (0)
  10504. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10505. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10506. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10507. /* FW rx PPDU descriptor fields */
  10508. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10509. do { \
  10510. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10511. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10512. } while (0)
  10513. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10514. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10515. HTT_RX_IND_RSSI_CMB_S)
  10516. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10517. do { \
  10518. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10519. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10520. } while (0)
  10521. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10522. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10523. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10524. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10525. do { \
  10526. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10527. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10528. } while (0)
  10529. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10530. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10531. HTT_RX_IND_PHY_ERR_CODE_S)
  10532. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10533. do { \
  10534. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10535. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10536. } while (0)
  10537. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10538. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10539. HTT_RX_IND_PHY_ERR_S)
  10540. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10541. do { \
  10542. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10543. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10544. } while (0)
  10545. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10546. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10547. HTT_RX_IND_LEGACY_RATE_S)
  10548. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10549. do { \
  10550. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10551. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10552. } while (0)
  10553. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10554. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10555. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10556. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10557. do { \
  10558. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10559. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10560. } while (0)
  10561. #define HTT_RX_IND_END_VALID_GET(word) \
  10562. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10563. HTT_RX_IND_END_VALID_S)
  10564. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10565. do { \
  10566. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10567. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10568. } while (0)
  10569. #define HTT_RX_IND_START_VALID_GET(word) \
  10570. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10571. HTT_RX_IND_START_VALID_S)
  10572. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10573. do { \
  10574. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10575. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10576. } while (0)
  10577. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10578. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10579. HTT_RX_IND_RSSI_PRI20_S)
  10580. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10581. do { \
  10582. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10583. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10584. } while (0)
  10585. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10586. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10587. HTT_RX_IND_RSSI_EXT20_S)
  10588. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10589. do { \
  10590. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10591. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10592. } while (0)
  10593. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10594. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10595. HTT_RX_IND_RSSI_EXT40_S)
  10596. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10597. do { \
  10598. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10599. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10600. } while (0)
  10601. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10602. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10603. HTT_RX_IND_RSSI_EXT80_S)
  10604. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10605. do { \
  10606. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10607. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10608. } while (0)
  10609. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10610. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10611. HTT_RX_IND_VHT_SIG_A1_S)
  10612. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10613. do { \
  10614. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10615. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10616. } while (0)
  10617. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10618. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10619. HTT_RX_IND_VHT_SIG_A2_S)
  10620. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10621. do { \
  10622. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10623. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10624. } while (0)
  10625. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10626. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10627. HTT_RX_IND_PREAMBLE_TYPE_S)
  10628. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10629. do { \
  10630. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10631. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10632. } while (0)
  10633. #define HTT_RX_IND_SERVICE_GET(word) \
  10634. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10635. HTT_RX_IND_SERVICE_S)
  10636. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10637. do { \
  10638. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10639. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10640. } while (0)
  10641. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10642. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10643. HTT_RX_IND_SA_ANT_MATRIX_S)
  10644. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10645. do { \
  10646. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10647. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10648. } while (0)
  10649. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10650. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10651. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10652. do { \
  10653. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10654. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10655. } while (0)
  10656. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10657. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10658. #define HTT_RX_IND_HL_BYTES \
  10659. (HTT_RX_IND_HDR_BYTES + \
  10660. 4 /* single FW rx MSDU descriptor */ + \
  10661. 4 /* single MPDU range information element */)
  10662. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10663. /* Could we use one macro entry? */
  10664. #define HTT_WORD_SET(word, field, value) \
  10665. do { \
  10666. HTT_CHECK_SET_VAL(field, value); \
  10667. (word) |= ((value) << field ## _S); \
  10668. } while (0)
  10669. #define HTT_WORD_GET(word, field) \
  10670. (((word) & field ## _M) >> field ## _S)
  10671. PREPACK struct hl_htt_rx_ind_base {
  10672. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10673. } POSTPACK;
  10674. /*
  10675. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10676. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10677. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10678. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10679. * htt_rx_ind_hl_rx_desc_t.
  10680. */
  10681. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10682. struct htt_rx_ind_hl_rx_desc_t {
  10683. A_UINT8 ver;
  10684. A_UINT8 len;
  10685. struct {
  10686. A_UINT8
  10687. first_msdu: 1,
  10688. last_msdu: 1,
  10689. c3_failed: 1,
  10690. c4_failed: 1,
  10691. ipv6: 1,
  10692. tcp: 1,
  10693. udp: 1,
  10694. reserved: 1;
  10695. } flags;
  10696. /* NOTE: no reserved space - don't append any new fields here */
  10697. };
  10698. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10699. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10700. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10701. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10702. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10703. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10704. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10705. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10706. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10707. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10708. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10709. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10710. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10711. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10712. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10713. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10714. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10715. /* This structure is used in HL, the basic descriptor information
  10716. * used by host. the structure is translated by FW from HW desc
  10717. * or generated by FW. But in HL monitor mode, the host would use
  10718. * the same structure with LL.
  10719. */
  10720. PREPACK struct hl_htt_rx_desc_base {
  10721. A_UINT32
  10722. seq_num:12,
  10723. encrypted:1,
  10724. chan_info_present:1,
  10725. resv0:2,
  10726. mcast_bcast:1,
  10727. fragment:1,
  10728. key_id_oct:8,
  10729. resv1:6;
  10730. A_UINT32
  10731. pn_31_0;
  10732. union {
  10733. struct {
  10734. A_UINT16 pn_47_32;
  10735. A_UINT16 pn_63_48;
  10736. } pn16;
  10737. A_UINT32 pn_63_32;
  10738. } u0;
  10739. A_UINT32
  10740. pn_95_64;
  10741. A_UINT32
  10742. pn_127_96;
  10743. } POSTPACK;
  10744. /*
  10745. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10746. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10747. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10748. * Please see htt_chan_change_t for description of the fields.
  10749. */
  10750. PREPACK struct htt_chan_info_t
  10751. {
  10752. A_UINT32 primary_chan_center_freq_mhz: 16,
  10753. contig_chan1_center_freq_mhz: 16;
  10754. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10755. phy_mode: 8,
  10756. reserved: 8;
  10757. } POSTPACK;
  10758. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10759. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10760. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10761. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10762. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10763. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10764. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10765. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10766. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10767. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10768. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10769. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10770. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10771. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10772. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10773. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10774. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10775. /* Channel information */
  10776. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10777. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10778. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10779. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10780. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10781. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10782. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10783. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10784. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10785. do { \
  10786. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10787. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10788. } while (0)
  10789. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10790. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10791. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10792. do { \
  10793. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10794. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10795. } while (0)
  10796. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10797. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10798. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10799. do { \
  10800. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10801. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10802. } while (0)
  10803. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10804. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10805. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10806. do { \
  10807. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10808. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10809. } while (0)
  10810. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10811. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10812. /*
  10813. * @brief target -> host message definition for FW offloaded pkts
  10814. *
  10815. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10816. *
  10817. * @details
  10818. * The following field definitions describe the format of the firmware
  10819. * offload deliver message sent from the target to the host.
  10820. *
  10821. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10822. *
  10823. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10824. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10825. * | reserved_1 | msg type |
  10826. * |--------------------------------------------------------------------------|
  10827. * | phy_timestamp_l32 |
  10828. * |--------------------------------------------------------------------------|
  10829. * | WORD2 (see below) |
  10830. * |--------------------------------------------------------------------------|
  10831. * | seqno | framectrl |
  10832. * |--------------------------------------------------------------------------|
  10833. * | reserved_3 | vdev_id | tid_num|
  10834. * |--------------------------------------------------------------------------|
  10835. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10836. * |--------------------------------------------------------------------------|
  10837. *
  10838. * where:
  10839. * STAT = status
  10840. * F = format (802.3 vs. 802.11)
  10841. *
  10842. * definition for word 2
  10843. *
  10844. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10845. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10846. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10847. * |--------------------------------------------------------------------------|
  10848. *
  10849. * where:
  10850. * PR = preamble
  10851. * BF = beamformed
  10852. */
  10853. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10854. {
  10855. A_UINT32 /* word 0 */
  10856. msg_type:8, /* [ 7: 0] */
  10857. reserved_1:24; /* [31: 8] */
  10858. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10859. A_UINT32 /* word 2 */
  10860. /* preamble:
  10861. * 0-OFDM,
  10862. * 1-CCk,
  10863. * 2-HT,
  10864. * 3-VHT
  10865. */
  10866. preamble: 2, /* [1:0] */
  10867. /* mcs:
  10868. * In case of HT preamble interpret
  10869. * MCS along with NSS.
  10870. * Valid values for HT are 0 to 7.
  10871. * HT mcs 0 with NSS 2 is mcs 8.
  10872. * Valid values for VHT are 0 to 9.
  10873. */
  10874. mcs: 4, /* [5:2] */
  10875. /* rate:
  10876. * This is applicable only for
  10877. * CCK and OFDM preamble type
  10878. * rate 0: OFDM 48 Mbps,
  10879. * 1: OFDM 24 Mbps,
  10880. * 2: OFDM 12 Mbps
  10881. * 3: OFDM 6 Mbps
  10882. * 4: OFDM 54 Mbps
  10883. * 5: OFDM 36 Mbps
  10884. * 6: OFDM 18 Mbps
  10885. * 7: OFDM 9 Mbps
  10886. * rate 0: CCK 11 Mbps Long
  10887. * 1: CCK 5.5 Mbps Long
  10888. * 2: CCK 2 Mbps Long
  10889. * 3: CCK 1 Mbps Long
  10890. * 4: CCK 11 Mbps Short
  10891. * 5: CCK 5.5 Mbps Short
  10892. * 6: CCK 2 Mbps Short
  10893. */
  10894. rate : 3, /* [ 8: 6] */
  10895. rssi : 8, /* [16: 9] units=dBm */
  10896. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10897. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10898. stbc : 1, /* [22] */
  10899. sgi : 1, /* [23] */
  10900. ldpc : 1, /* [24] */
  10901. beamformed: 1, /* [25] */
  10902. reserved_2: 6; /* [31:26] */
  10903. A_UINT32 /* word 3 */
  10904. framectrl:16, /* [15: 0] */
  10905. seqno:16; /* [31:16] */
  10906. A_UINT32 /* word 4 */
  10907. tid_num:5, /* [ 4: 0] actual TID number */
  10908. vdev_id:8, /* [12: 5] */
  10909. reserved_3:19; /* [31:13] */
  10910. A_UINT32 /* word 5 */
  10911. /* status:
  10912. * 0: tx_ok
  10913. * 1: retry
  10914. * 2: drop
  10915. * 3: filtered
  10916. * 4: abort
  10917. * 5: tid delete
  10918. * 6: sw abort
  10919. * 7: dropped by peer migration
  10920. */
  10921. status:3, /* [2:0] */
  10922. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10923. tx_mpdu_bytes:16, /* [19:4] */
  10924. /* Indicates retry count of offloaded/local generated Data tx frames */
  10925. tx_retry_cnt:6, /* [25:20] */
  10926. reserved_4:6; /* [31:26] */
  10927. } POSTPACK;
  10928. /* FW offload deliver ind message header fields */
  10929. /* DWORD one */
  10930. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10931. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10932. /* DWORD two */
  10933. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10934. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10935. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10936. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10937. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10938. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10939. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10940. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10941. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10942. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10943. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10944. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10945. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10946. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10947. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10948. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10949. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10950. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10951. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10952. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10953. /* DWORD three*/
  10954. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10955. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10956. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10957. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10958. /* DWORD four */
  10959. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10960. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10961. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10962. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10963. /* DWORD five */
  10964. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10965. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10966. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10967. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10968. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10969. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10970. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10971. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10972. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10973. do { \
  10974. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10975. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10976. } while (0)
  10977. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10978. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10979. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10980. do { \
  10981. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10982. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10983. } while (0)
  10984. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10985. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10986. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10987. do { \
  10988. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10989. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10990. } while (0)
  10991. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10992. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10993. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10994. do { \
  10995. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10996. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10997. } while (0)
  10998. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10999. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  11000. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  11001. do { \
  11002. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  11003. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  11004. } while (0)
  11005. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  11006. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  11007. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  11008. do { \
  11009. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  11010. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  11011. } while (0)
  11012. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  11013. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  11014. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  11015. do { \
  11016. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  11017. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11018. } while (0)
  11019. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11020. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11021. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11022. do { \
  11023. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11024. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11025. } while (0)
  11026. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11027. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11028. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11029. do { \
  11030. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11031. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11032. } while (0)
  11033. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11034. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11035. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11036. do { \
  11037. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11038. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11039. } while (0)
  11040. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11041. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11042. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11043. do { \
  11044. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11045. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11046. } while (0)
  11047. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11048. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11049. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11050. do { \
  11051. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11052. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11053. } while (0)
  11054. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11055. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11056. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11057. do { \
  11058. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11059. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11060. } while (0)
  11061. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11062. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11063. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11064. do { \
  11065. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11066. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11067. } while (0)
  11068. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11069. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11070. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11071. do { \
  11072. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11073. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11074. } while (0)
  11075. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11076. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11077. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11078. do { \
  11079. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11080. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11081. } while (0)
  11082. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11083. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11084. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11085. do { \
  11086. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11087. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11088. } while (0)
  11089. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11090. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11091. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11092. do { \
  11093. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11094. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11095. } while (0)
  11096. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11097. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11098. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11099. do { \
  11100. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11101. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11102. } while (0)
  11103. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11104. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11105. /*
  11106. * @brief target -> host rx reorder flush message definition
  11107. *
  11108. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11109. *
  11110. * @details
  11111. * The following field definitions describe the format of the rx flush
  11112. * message sent from the target to the host.
  11113. * The message consists of a 4-octet header, followed by one or more
  11114. * 4-octet payload information elements.
  11115. *
  11116. * |31 24|23 8|7 0|
  11117. * |--------------------------------------------------------------|
  11118. * | TID | peer ID | msg type |
  11119. * |--------------------------------------------------------------|
  11120. * | seq num end | seq num start | MPDU status | reserved |
  11121. * |--------------------------------------------------------------|
  11122. * First DWORD:
  11123. * - MSG_TYPE
  11124. * Bits 7:0
  11125. * Purpose: identifies this as an rx flush message
  11126. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11127. * - PEER_ID
  11128. * Bits 23:8 (only bits 18:8 actually used)
  11129. * Purpose: identify which peer's rx data is being flushed
  11130. * Value: (rx) peer ID
  11131. * - TID
  11132. * Bits 31:24 (only bits 27:24 actually used)
  11133. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11134. * Value: traffic identifier
  11135. * Second DWORD:
  11136. * - MPDU_STATUS
  11137. * Bits 15:8
  11138. * Purpose:
  11139. * Indicate whether the flushed MPDUs should be discarded or processed.
  11140. * Value:
  11141. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11142. * stages of rx processing
  11143. * other: discard the MPDUs
  11144. * It is anticipated that flush messages will always have
  11145. * MPDU status == 1, but the status flag is included for
  11146. * flexibility.
  11147. * - SEQ_NUM_START
  11148. * Bits 23:16
  11149. * Purpose:
  11150. * Indicate the start of a series of consecutive MPDUs being flushed.
  11151. * Not all MPDUs within this range are necessarily valid - the host
  11152. * must check each sequence number within this range to see if the
  11153. * corresponding MPDU is actually present.
  11154. * Value:
  11155. * The sequence number for the first MPDU in the sequence.
  11156. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11157. * - SEQ_NUM_END
  11158. * Bits 30:24
  11159. * Purpose:
  11160. * Indicate the end of a series of consecutive MPDUs being flushed.
  11161. * Value:
  11162. * The sequence number one larger than the sequence number of the
  11163. * last MPDU being flushed.
  11164. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11165. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11166. * are to be released for further rx processing.
  11167. * Not all MPDUs within this range are necessarily valid - the host
  11168. * must check each sequence number within this range to see if the
  11169. * corresponding MPDU is actually present.
  11170. */
  11171. /* first DWORD */
  11172. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11173. #define HTT_RX_FLUSH_PEER_ID_S 8
  11174. #define HTT_RX_FLUSH_TID_M 0xff000000
  11175. #define HTT_RX_FLUSH_TID_S 24
  11176. /* second DWORD */
  11177. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11178. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11179. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11180. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11181. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11182. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11183. #define HTT_RX_FLUSH_BYTES 8
  11184. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11185. do { \
  11186. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11187. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11188. } while (0)
  11189. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11190. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11191. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11192. do { \
  11193. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11194. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11195. } while (0)
  11196. #define HTT_RX_FLUSH_TID_GET(word) \
  11197. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11198. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11199. do { \
  11200. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11201. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11202. } while (0)
  11203. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11204. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11205. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11206. do { \
  11207. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11208. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11209. } while (0)
  11210. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11211. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11212. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11213. do { \
  11214. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11215. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11216. } while (0)
  11217. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11218. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11219. /*
  11220. * @brief target -> host rx pn check indication message
  11221. *
  11222. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11223. *
  11224. * @details
  11225. * The following field definitions describe the format of the Rx PN check
  11226. * indication message sent from the target to the host.
  11227. * The message consists of a 4-octet header, followed by the start and
  11228. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11229. * IE is one octet containing the sequence number that failed the PN
  11230. * check.
  11231. *
  11232. * |31 24|23 8|7 0|
  11233. * |--------------------------------------------------------------|
  11234. * | TID | peer ID | msg type |
  11235. * |--------------------------------------------------------------|
  11236. * | Reserved | PN IE count | seq num end | seq num start|
  11237. * |--------------------------------------------------------------|
  11238. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11239. * |--------------------------------------------------------------|
  11240. * First DWORD:
  11241. * - MSG_TYPE
  11242. * Bits 7:0
  11243. * Purpose: Identifies this as an rx pn check indication message
  11244. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11245. * - PEER_ID
  11246. * Bits 23:8 (only bits 18:8 actually used)
  11247. * Purpose: identify which peer
  11248. * Value: (rx) peer ID
  11249. * - TID
  11250. * Bits 31:24 (only bits 27:24 actually used)
  11251. * Purpose: identify traffic identifier
  11252. * Value: traffic identifier
  11253. * Second DWORD:
  11254. * - SEQ_NUM_START
  11255. * Bits 7:0
  11256. * Purpose:
  11257. * Indicates the starting sequence number of the MPDU in this
  11258. * series of MPDUs that went though PN check.
  11259. * Value:
  11260. * The sequence number for the first MPDU in the sequence.
  11261. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11262. * - SEQ_NUM_END
  11263. * Bits 15:8
  11264. * Purpose:
  11265. * Indicates the ending sequence number of the MPDU in this
  11266. * series of MPDUs that went though PN check.
  11267. * Value:
  11268. * The sequence number one larger then the sequence number of the last
  11269. * MPDU being flushed.
  11270. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11271. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11272. * for invalid PN numbers and are ready to be released for further processing.
  11273. * Not all MPDUs within this range are necessarily valid - the host
  11274. * must check each sequence number within this range to see if the
  11275. * corresponding MPDU is actually present.
  11276. * - PN_IE_COUNT
  11277. * Bits 23:16
  11278. * Purpose:
  11279. * Used to determine the variable number of PN information elements in this
  11280. * message
  11281. *
  11282. * PN information elements:
  11283. * - PN_IE_x-
  11284. * Purpose:
  11285. * Each PN information element contains the sequence number of the MPDU that
  11286. * has failed the target PN check.
  11287. * Value:
  11288. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11289. * that failed the PN check.
  11290. */
  11291. /* first DWORD */
  11292. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11293. #define HTT_RX_PN_IND_PEER_ID_S 8
  11294. #define HTT_RX_PN_IND_TID_M 0xff000000
  11295. #define HTT_RX_PN_IND_TID_S 24
  11296. /* second DWORD */
  11297. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11298. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11299. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11300. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11301. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11302. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11303. #define HTT_RX_PN_IND_BYTES 8
  11304. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11305. do { \
  11306. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11307. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11308. } while (0)
  11309. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11310. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11311. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11312. do { \
  11313. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11314. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11315. } while (0)
  11316. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11317. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11318. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11319. do { \
  11320. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11321. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11322. } while (0)
  11323. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11324. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11325. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11326. do { \
  11327. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11328. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11329. } while (0)
  11330. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11331. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11332. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11333. do { \
  11334. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11335. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11336. } while (0)
  11337. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11338. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11339. /*
  11340. * @brief target -> host rx offload deliver message for LL system
  11341. *
  11342. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11343. *
  11344. * @details
  11345. * In a low latency system this message is sent whenever the offload
  11346. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11347. * The DMA of the actual packets into host memory is done before sending out
  11348. * this message. This message indicates only how many MSDUs to reap. The
  11349. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11350. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11351. * DMA'd by the MAC directly into host memory these packets do not contain
  11352. * the MAC descriptors in the header portion of the packet. Instead they contain
  11353. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11354. * message, the packets are delivered directly to the NW stack without going
  11355. * through the regular reorder buffering and PN checking path since it has
  11356. * already been done in target.
  11357. *
  11358. * |31 24|23 16|15 8|7 0|
  11359. * |-----------------------------------------------------------------------|
  11360. * | Total MSDU count | reserved | msg type |
  11361. * |-----------------------------------------------------------------------|
  11362. *
  11363. * @brief target -> host rx offload deliver message for HL system
  11364. *
  11365. * @details
  11366. * In a high latency system this message is sent whenever the offload manager
  11367. * flushes out the packets it has coalesced in its coalescing buffer. The
  11368. * actual packets are also carried along with this message. When the host
  11369. * receives this message, it is expected to deliver these packets to the NW
  11370. * stack directly instead of routing them through the reorder buffering and
  11371. * PN checking path since it has already been done in target.
  11372. *
  11373. * |31 24|23 16|15 8|7 0|
  11374. * |-----------------------------------------------------------------------|
  11375. * | Total MSDU count | reserved | msg type |
  11376. * |-----------------------------------------------------------------------|
  11377. * | peer ID | MSDU length |
  11378. * |-----------------------------------------------------------------------|
  11379. * | MSDU payload | FW Desc | tid | vdev ID |
  11380. * |-----------------------------------------------------------------------|
  11381. * | MSDU payload contd. |
  11382. * |-----------------------------------------------------------------------|
  11383. * | peer ID | MSDU length |
  11384. * |-----------------------------------------------------------------------|
  11385. * | MSDU payload | FW Desc | tid | vdev ID |
  11386. * |-----------------------------------------------------------------------|
  11387. * | MSDU payload contd. |
  11388. * |-----------------------------------------------------------------------|
  11389. *
  11390. */
  11391. /* first DWORD */
  11392. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11393. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11394. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11395. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11396. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11397. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11398. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11399. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11400. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11401. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11402. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11403. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11404. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11405. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11406. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11407. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11408. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11409. do { \
  11410. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11411. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11412. } while (0)
  11413. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11414. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11415. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11416. do { \
  11417. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11418. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11419. } while (0)
  11420. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11421. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11422. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11423. do { \
  11424. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11425. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11426. } while (0)
  11427. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11428. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11429. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11430. do { \
  11431. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11432. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11433. } while (0)
  11434. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11435. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11436. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11437. do { \
  11438. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11439. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11440. } while (0)
  11441. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11442. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11443. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11444. do { \
  11445. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11446. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11447. } while (0)
  11448. /**
  11449. * @brief target -> host rx peer map/unmap message definition
  11450. *
  11451. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11452. *
  11453. * @details
  11454. * The following diagram shows the format of the rx peer map message sent
  11455. * from the target to the host. This layout assumes the target operates
  11456. * as little-endian.
  11457. *
  11458. * This message always contains a SW peer ID. The main purpose of the
  11459. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11460. * with, so that the host can use that peer ID to determine which peer
  11461. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11462. * other purposes, such as identifying during tx completions which peer
  11463. * the tx frames in question were transmitted to.
  11464. *
  11465. * In certain generations of chips, the peer map message also contains
  11466. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11467. * to identify which peer the frame needs to be forwarded to (i.e. the
  11468. * peer associated with the Destination MAC Address within the packet),
  11469. * and particularly which vdev needs to transmit the frame (for cases
  11470. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11471. * meaning as AST_INDEX_0.
  11472. * This DA-based peer ID that is provided for certain rx frames
  11473. * (the rx frames that need to be re-transmitted as tx frames)
  11474. * is the ID that the HW uses for referring to the peer in question,
  11475. * rather than the peer ID that the SW+FW use to refer to the peer.
  11476. *
  11477. *
  11478. * |31 24|23 16|15 8|7 0|
  11479. * |-----------------------------------------------------------------------|
  11480. * | SW peer ID | VDEV ID | msg type |
  11481. * |-----------------------------------------------------------------------|
  11482. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11483. * |-----------------------------------------------------------------------|
  11484. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11485. * |-----------------------------------------------------------------------|
  11486. *
  11487. *
  11488. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11489. *
  11490. * The following diagram shows the format of the rx peer unmap message sent
  11491. * from the target to the host.
  11492. *
  11493. * |31 24|23 16|15 8|7 0|
  11494. * |-----------------------------------------------------------------------|
  11495. * | SW peer ID | VDEV ID | msg type |
  11496. * |-----------------------------------------------------------------------|
  11497. *
  11498. * The following field definitions describe the format of the rx peer map
  11499. * and peer unmap messages sent from the target to the host.
  11500. * - MSG_TYPE
  11501. * Bits 7:0
  11502. * Purpose: identifies this as an rx peer map or peer unmap message
  11503. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11504. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11505. * - VDEV_ID
  11506. * Bits 15:8
  11507. * Purpose: Indicates which virtual device the peer is associated
  11508. * with.
  11509. * Value: vdev ID (used in the host to look up the vdev object)
  11510. * - PEER_ID (a.k.a. SW_PEER_ID)
  11511. * Bits 31:16
  11512. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11513. * freeing (unmap)
  11514. * Value: (rx) peer ID
  11515. * - MAC_ADDR_L32 (peer map only)
  11516. * Bits 31:0
  11517. * Purpose: Identifies which peer node the peer ID is for.
  11518. * Value: lower 4 bytes of peer node's MAC address
  11519. * - MAC_ADDR_U16 (peer map only)
  11520. * Bits 15:0
  11521. * Purpose: Identifies which peer node the peer ID is for.
  11522. * Value: upper 2 bytes of peer node's MAC address
  11523. * - HW_PEER_ID
  11524. * Bits 31:16
  11525. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11526. * address, so for rx frames marked for rx --> tx forwarding, the
  11527. * host can determine from the HW peer ID provided as meta-data with
  11528. * the rx frame which peer the frame is supposed to be forwarded to.
  11529. * Value: ID used by the MAC HW to identify the peer
  11530. */
  11531. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11532. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11533. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11534. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11535. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11536. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11537. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11538. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11539. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11540. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11541. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11542. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11543. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11544. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11545. do { \
  11546. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11547. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11548. } while (0)
  11549. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11550. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11551. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11552. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11553. do { \
  11554. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11555. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11556. } while (0)
  11557. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11558. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11559. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11560. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11561. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11562. do { \
  11563. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11564. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11565. } while (0)
  11566. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11567. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11568. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11569. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11570. #define HTT_RX_PEER_MAP_BYTES 12
  11571. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11572. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11573. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11574. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11575. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11576. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11577. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11578. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11579. #define HTT_RX_PEER_UNMAP_BYTES 4
  11580. /**
  11581. * @brief target -> host rx peer map V2 message definition
  11582. *
  11583. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11584. *
  11585. * @details
  11586. * The following diagram shows the format of the rx peer map v2 message sent
  11587. * from the target to the host. This layout assumes the target operates
  11588. * as little-endian.
  11589. *
  11590. * This message always contains a SW peer ID. The main purpose of the
  11591. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11592. * with, so that the host can use that peer ID to determine which peer
  11593. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11594. * other purposes, such as identifying during tx completions which peer
  11595. * the tx frames in question were transmitted to.
  11596. *
  11597. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11598. * is used during rx --> tx frame forwarding to identify which peer the
  11599. * frame needs to be forwarded to (i.e. the peer associated with the
  11600. * Destination MAC Address within the packet), and particularly which vdev
  11601. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11602. * This DA-based peer ID that is provided for certain rx frames
  11603. * (the rx frames that need to be re-transmitted as tx frames)
  11604. * is the ID that the HW uses for referring to the peer in question,
  11605. * rather than the peer ID that the SW+FW use to refer to the peer.
  11606. *
  11607. * The HW peer id here is the same meaning as AST_INDEX_0.
  11608. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11609. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11610. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11611. * AST is valid.
  11612. *
  11613. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11614. * |-------------------------------------------------------------------------|
  11615. * | SW peer ID | VDEV ID | msg type |
  11616. * |-------------------------------------------------------------------------|
  11617. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11618. * |-------------------------------------------------------------------------|
  11619. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11620. * |-------------------------------------------------------------------------|
  11621. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11622. * |-------------------------------------------------------------------------|
  11623. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11624. * |-------------------------------------------------------------------------|
  11625. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11626. * |-------------------------------------------------------------------------|
  11627. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11628. * |-------------------------------------------------------------------------|
  11629. * | Reserved_2 |
  11630. * |-------------------------------------------------------------------------|
  11631. * Where:
  11632. * NH = Next Hop
  11633. * ASTVM = AST valid mask
  11634. * OA = on-chip AST valid bit
  11635. * ASTFM = AST flow mask
  11636. *
  11637. * The following field definitions describe the format of the rx peer map v2
  11638. * messages sent from the target to the host.
  11639. * - MSG_TYPE
  11640. * Bits 7:0
  11641. * Purpose: identifies this as an rx peer map v2 message
  11642. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11643. * - VDEV_ID
  11644. * Bits 15:8
  11645. * Purpose: Indicates which virtual device the peer is associated with.
  11646. * Value: vdev ID (used in the host to look up the vdev object)
  11647. * - SW_PEER_ID
  11648. * Bits 31:16
  11649. * Purpose: The peer ID (index) that WAL is allocating
  11650. * Value: (rx) peer ID
  11651. * - MAC_ADDR_L32
  11652. * Bits 31:0
  11653. * Purpose: Identifies which peer node the peer ID is for.
  11654. * Value: lower 4 bytes of peer node's MAC address
  11655. * - MAC_ADDR_U16
  11656. * Bits 15:0
  11657. * Purpose: Identifies which peer node the peer ID is for.
  11658. * Value: upper 2 bytes of peer node's MAC address
  11659. * - HW_PEER_ID / AST_INDEX_0
  11660. * Bits 31:16
  11661. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11662. * address, so for rx frames marked for rx --> tx forwarding, the
  11663. * host can determine from the HW peer ID provided as meta-data with
  11664. * the rx frame which peer the frame is supposed to be forwarded to.
  11665. * Value: ID used by the MAC HW to identify the peer
  11666. * - AST_HASH_VALUE
  11667. * Bits 15:0
  11668. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11669. * override feature.
  11670. * - NEXT_HOP
  11671. * Bit 16
  11672. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11673. * (Wireless Distribution System).
  11674. * - AST_VALID_MASK
  11675. * Bits 19:17
  11676. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11677. * - ONCHIP_AST_VALID_FLAG
  11678. * Bit 20
  11679. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11680. * is valid.
  11681. * - AST_INDEX_1
  11682. * Bits 15:0
  11683. * Purpose: indicate the second AST index for this peer
  11684. * - AST_0_FLOW_MASK
  11685. * Bits 19:16
  11686. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11687. * - AST_1_FLOW_MASK
  11688. * Bits 23:20
  11689. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11690. * - AST_2_FLOW_MASK
  11691. * Bits 27:24
  11692. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11693. * - AST_3_FLOW_MASK
  11694. * Bits 31:28
  11695. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11696. * - AST_INDEX_2
  11697. * Bits 15:0
  11698. * Purpose: indicate the third AST index for this peer
  11699. * - TID_VALID_HI_PRI
  11700. * Bits 23:16
  11701. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11702. * - TID_VALID_LOW_PRI
  11703. * Bits 31:24
  11704. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11705. * - AST_INDEX_3
  11706. * Bits 15:0
  11707. * Purpose: indicate the fourth AST index for this peer
  11708. * - ONCHIP_AST_IDX / RESERVED
  11709. * Bits 31:16
  11710. * Purpose: This field is valid only when split AST feature is enabled.
  11711. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11712. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11713. * address, this ast_idx is used for LMAC modules for RXPCU.
  11714. * Value: ID used by the LMAC HW to identify the peer
  11715. */
  11716. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11717. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11718. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11719. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11720. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11721. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11722. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11723. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11724. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11725. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11726. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11727. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11728. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11729. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11730. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11731. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11732. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11733. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11734. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11735. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11736. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11737. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11738. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11739. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11740. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11741. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11742. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11743. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11744. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11745. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11746. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11747. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11748. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11749. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11750. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11751. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11752. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11753. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11754. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11755. do { \
  11756. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11757. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11758. } while (0)
  11759. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11760. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11761. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11762. do { \
  11763. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11764. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11765. } while (0)
  11766. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11767. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11768. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11769. do { \
  11770. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11771. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11772. } while (0)
  11773. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11774. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11775. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11776. do { \
  11777. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11778. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11779. } while (0)
  11780. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11781. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11782. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11783. do { \
  11784. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11785. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11786. } while (0)
  11787. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11788. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11789. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11790. do { \
  11791. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11792. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11793. } while (0)
  11794. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11795. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11796. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11797. do { \
  11798. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11799. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11800. } while (0)
  11801. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11802. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11803. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11804. do { \
  11805. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11806. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11807. } while (0)
  11808. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11809. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11810. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11811. do { \
  11812. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11813. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11814. } while (0)
  11815. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11816. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11817. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11818. do { \
  11819. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11820. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11821. } while (0)
  11822. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11823. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11824. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11825. do { \
  11826. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11827. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11828. } while (0)
  11829. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11830. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11831. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11832. do { \
  11833. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11834. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11835. } while (0)
  11836. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11837. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11838. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11839. do { \
  11840. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11841. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11842. } while (0)
  11843. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11844. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11845. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11846. do { \
  11847. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11848. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11849. } while (0)
  11850. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11851. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11852. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11853. do { \
  11854. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11855. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11856. } while (0)
  11857. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11858. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11859. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11860. do { \
  11861. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11862. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11863. } while (0)
  11864. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11865. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11866. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11867. do { \
  11868. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11869. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11870. } while (0)
  11871. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11872. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11873. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11874. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11875. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11876. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11877. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11878. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11879. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11880. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11881. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11882. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11883. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11884. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11885. /**
  11886. * @brief target -> host rx peer map V3 message definition
  11887. *
  11888. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11889. *
  11890. * @details
  11891. * The following diagram shows the format of the rx peer map v3 message sent
  11892. * from the target to the host.
  11893. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11894. * This layout assumes the target operates as little-endian.
  11895. *
  11896. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11897. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11898. * | SW peer ID | VDEV ID | msg type |
  11899. * |-----------------+--------------------+-----------------+-----------------|
  11900. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11901. * |-----------------+--------------------+-----------------+-----------------|
  11902. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11903. * |-----------------+--------+-----------+-----------------+-----------------|
  11904. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11905. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11906. * | (8bits) | | (4bits) | |
  11907. * |-----------------+--------+--+--+--+--------------------------------------|
  11908. * | RESERVED |E |O | | |
  11909. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11910. * | |V |V | | |
  11911. * |-----------------+--------------------+-----------------------------------|
  11912. * | HTT_MSDU_IDX_ | RESERVED | |
  11913. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11914. * | (8bits) | | |
  11915. * |-----------------+--------------------+-----------------------------------|
  11916. * | Reserved_2 |
  11917. * |--------------------------------------------------------------------------|
  11918. * | Reserved_3 |
  11919. * |--------------------------------------------------------------------------|
  11920. *
  11921. * Where:
  11922. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11923. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11924. * NH = Next Hop
  11925. * The following field definitions describe the format of the rx peer map v3
  11926. * messages sent from the target to the host.
  11927. * - MSG_TYPE
  11928. * Bits 7:0
  11929. * Purpose: identifies this as a peer map v3 message
  11930. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11931. * - VDEV_ID
  11932. * Bits 15:8
  11933. * Purpose: Indicates which virtual device the peer is associated with.
  11934. * - SW_PEER_ID
  11935. * Bits 31:16
  11936. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11937. * - MAC_ADDR_L32
  11938. * Bits 31:0
  11939. * Purpose: Identifies which peer node the peer ID is for.
  11940. * Value: lower 4 bytes of peer node's MAC address
  11941. * - MAC_ADDR_U16
  11942. * Bits 15:0
  11943. * Purpose: Identifies which peer node the peer ID is for.
  11944. * Value: upper 2 bytes of peer node's MAC address
  11945. * - MULTICAST_SW_PEER_ID
  11946. * Bits 31:16
  11947. * Purpose: The multicast peer ID (index)
  11948. * Value: set to HTT_INVALID_PEER if not valid
  11949. * - HW_PEER_ID / AST_INDEX
  11950. * Bits 15:0
  11951. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11952. * address, so for rx frames marked for rx --> tx forwarding, the
  11953. * host can determine from the HW peer ID provided as meta-data with
  11954. * the rx frame which peer the frame is supposed to be forwarded to.
  11955. * - CACHE_SET_NUM
  11956. * Bits 19:16
  11957. * Purpose: Cache Set Number for AST_INDEX
  11958. * Cache set number that should be used to cache the index based
  11959. * search results, for address and flow search.
  11960. * This value should be equal to LSB 4 bits of the hash value
  11961. * of match data, in case of search index points to an entry which
  11962. * may be used in content based search also. The value can be
  11963. * anything when the entry pointed by search index will not be
  11964. * used for content based search.
  11965. * - HTT_MSDU_IDX_VALID_MASK
  11966. * Bits 31:24
  11967. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11968. * - ONCHIP_AST_IDX / RESERVED
  11969. * Bits 15:0
  11970. * Purpose: This field is valid only when split AST feature is enabled.
  11971. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11972. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11973. * address, this ast_idx is used for LMAC modules for RXPCU.
  11974. * - NEXT_HOP
  11975. * Bits 16
  11976. * Purpose: Flag indicates next_hop AST entry used for WDS
  11977. * (Wireless Distribution System).
  11978. * - ONCHIP_AST_VALID
  11979. * Bits 17
  11980. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11981. * - EXT_AST_VALID
  11982. * Bits 18
  11983. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11984. * - EXT_AST_INDEX
  11985. * Bits 15:0
  11986. * Purpose: This field describes Extended AST index
  11987. * Valid if EXT_AST_VALID flag set
  11988. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11989. * Bits 31:24
  11990. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11991. */
  11992. /* dword 0 */
  11993. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11994. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11995. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11996. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11997. /* dword 1 */
  11998. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11999. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  12000. /* dword 2 */
  12001. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  12002. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  12003. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  12004. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  12005. /* dword 3 */
  12006. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  12007. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  12008. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  12009. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  12010. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  12011. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  12012. /* dword 4 */
  12013. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  12014. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  12015. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  12016. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  12017. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12018. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12019. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12020. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12021. /* dword 5 */
  12022. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12023. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12024. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12025. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12026. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12027. do { \
  12028. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12029. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12030. } while (0)
  12031. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12032. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12033. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12034. do { \
  12035. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12036. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12037. } while (0)
  12038. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12039. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12040. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12041. do { \
  12042. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12043. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12044. } while (0)
  12045. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12046. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12047. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12048. do { \
  12049. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12050. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12051. } while (0)
  12052. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12053. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12054. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12055. do { \
  12056. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12057. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12058. } while (0)
  12059. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12060. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12061. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12062. do { \
  12063. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12064. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12065. } while (0)
  12066. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12067. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12068. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12069. do { \
  12070. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12071. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12072. } while (0)
  12073. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12074. (((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)
  12075. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12076. do { \
  12077. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12078. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12079. } while (0)
  12080. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12081. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12082. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12083. do { \
  12084. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12085. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12086. } while (0)
  12087. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12088. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12089. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12090. do { \
  12091. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12092. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12093. } while (0)
  12094. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12095. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12096. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12097. do { \
  12098. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12099. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12100. } while (0)
  12101. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12102. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12103. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12104. do { \
  12105. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12106. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12107. } while (0)
  12108. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12109. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12110. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12111. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12112. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12113. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12114. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12115. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12116. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12117. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12118. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12119. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12120. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12121. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12122. /**
  12123. * @brief target -> host rx peer unmap V2 message definition
  12124. *
  12125. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12126. *
  12127. * The following diagram shows the format of the rx peer unmap message sent
  12128. * from the target to the host.
  12129. *
  12130. * |31 24|23 16|15 8|7 0|
  12131. * |-----------------------------------------------------------------------|
  12132. * | SW peer ID | VDEV ID | msg type |
  12133. * |-----------------------------------------------------------------------|
  12134. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12135. * |-----------------------------------------------------------------------|
  12136. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12137. * |-----------------------------------------------------------------------|
  12138. * | Peer Delete Duration |
  12139. * |-----------------------------------------------------------------------|
  12140. * | Reserved_0 | WDS Free Count |
  12141. * |-----------------------------------------------------------------------|
  12142. * | Reserved_1 |
  12143. * |-----------------------------------------------------------------------|
  12144. * | Reserved_2 |
  12145. * |-----------------------------------------------------------------------|
  12146. *
  12147. *
  12148. * The following field definitions describe the format of the rx peer unmap
  12149. * messages sent from the target to the host.
  12150. * - MSG_TYPE
  12151. * Bits 7:0
  12152. * Purpose: identifies this as an rx peer unmap v2 message
  12153. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12154. * - VDEV_ID
  12155. * Bits 15:8
  12156. * Purpose: Indicates which virtual device the peer is associated
  12157. * with.
  12158. * Value: vdev ID (used in the host to look up the vdev object)
  12159. * - SW_PEER_ID
  12160. * Bits 31:16
  12161. * Purpose: The peer ID (index) that WAL is freeing
  12162. * Value: (rx) peer ID
  12163. * - MAC_ADDR_L32
  12164. * Bits 31:0
  12165. * Purpose: Identifies which peer node the peer ID is for.
  12166. * Value: lower 4 bytes of peer node's MAC address
  12167. * - MAC_ADDR_U16
  12168. * Bits 15:0
  12169. * Purpose: Identifies which peer node the peer ID is for.
  12170. * Value: upper 2 bytes of peer node's MAC address
  12171. * - NEXT_HOP
  12172. * Bits 16
  12173. * Purpose: Bit indicates next_hop AST entry used for WDS
  12174. * (Wireless Distribution System).
  12175. * - PEER_DELETE_DURATION
  12176. * Bits 31:0
  12177. * Purpose: Time taken to delete peer, in msec,
  12178. * Used for monitoring / debugging PEER delete response delay
  12179. * - PEER_WDS_FREE_COUNT
  12180. * Bits 15:0
  12181. * Purpose: Count of WDS entries deleted associated to peer deleted
  12182. */
  12183. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12184. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12185. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12186. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12187. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12188. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12189. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12190. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12191. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12192. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12193. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12194. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12195. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12196. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12197. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12198. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12199. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12200. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12201. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12202. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12203. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12204. do { \
  12205. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12206. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12207. } while (0)
  12208. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12209. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12210. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12211. do { \
  12212. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12213. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12214. } while (0)
  12215. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12216. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12217. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12218. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12219. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12220. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12221. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12222. /**
  12223. * @brief target -> host rx peer mlo map message definition
  12224. *
  12225. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12226. *
  12227. * @details
  12228. * The following diagram shows the format of the rx mlo peer map message sent
  12229. * from the target to the host. This layout assumes the target operates
  12230. * as little-endian.
  12231. *
  12232. * MCC:
  12233. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12234. *
  12235. * WIN:
  12236. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12237. * It will be sent on the Assoc Link.
  12238. *
  12239. * This message always contains a MLO peer ID. The main purpose of the
  12240. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12241. * with, so that the host can use that MLO peer ID to determine which peer
  12242. * transmitted the rx frame.
  12243. *
  12244. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12245. * |-------------------------------------------------------------------------|
  12246. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12247. * |-------------------------------------------------------------------------|
  12248. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12249. * |-------------------------------------------------------------------------|
  12250. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12251. * |-------------------------------------------------------------------------|
  12252. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12253. * |-------------------------------------------------------------------------|
  12254. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12255. * |-------------------------------------------------------------------------|
  12256. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12257. * |-------------------------------------------------------------------------|
  12258. * |RSVD |
  12259. * |-------------------------------------------------------------------------|
  12260. * |RSVD |
  12261. * |-------------------------------------------------------------------------|
  12262. * | htt_tlv_hdr_t |
  12263. * |-------------------------------------------------------------------------|
  12264. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12265. * |-------------------------------------------------------------------------|
  12266. * | htt_tlv_hdr_t |
  12267. * |-------------------------------------------------------------------------|
  12268. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12269. * |-------------------------------------------------------------------------|
  12270. * | htt_tlv_hdr_t |
  12271. * |-------------------------------------------------------------------------|
  12272. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12273. * |-------------------------------------------------------------------------|
  12274. *
  12275. * Where:
  12276. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12277. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12278. * V (valid) - 1 Bit Bit17
  12279. * CHIPID - 3 Bits
  12280. * TIDMASK - 8 Bits
  12281. * CACHE_SET_NUM - 8 Bits
  12282. *
  12283. * The following field definitions describe the format of the rx MLO peer map
  12284. * messages sent from the target to the host.
  12285. * - MSG_TYPE
  12286. * Bits 7:0
  12287. * Purpose: identifies this as an rx mlo peer map message
  12288. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12289. *
  12290. * - MLO_PEER_ID
  12291. * Bits 23:8
  12292. * Purpose: The MLO peer ID (index).
  12293. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12294. * Value: MLO peer ID
  12295. *
  12296. * - NUMLINK
  12297. * Bits: 26:24 (3Bits)
  12298. * Purpose: Indicate the max number of logical links supported per client.
  12299. * Value: number of logical links
  12300. *
  12301. * - PRC
  12302. * Bits: 29:27 (3Bits)
  12303. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12304. * if there is migration of the primary chip.
  12305. * Value: Primary REO CHIPID
  12306. *
  12307. * - MAC_ADDR_L32
  12308. * Bits 31:0
  12309. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12310. * Value: lower 4 bytes of peer node's MAC address
  12311. *
  12312. * - MAC_ADDR_U16
  12313. * Bits 15:0
  12314. * Purpose: Identifies which peer node the peer ID is for.
  12315. * Value: upper 2 bytes of peer node's MAC address
  12316. *
  12317. * - PRIMARY_TCL_AST_IDX
  12318. * Bits 15:0
  12319. * Purpose: Primary TCL AST index for this peer.
  12320. *
  12321. * - V
  12322. * 1 Bit Position 16
  12323. * Purpose: If the ast idx is valid.
  12324. *
  12325. * - CHIPID
  12326. * Bits 19:17
  12327. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12328. *
  12329. * - TIDMASK
  12330. * Bits 27:20
  12331. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12332. *
  12333. * - CACHE_SET_NUM
  12334. * Bits 31:28
  12335. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12336. * Cache set number that should be used to cache the index based
  12337. * search results, for address and flow search.
  12338. * This value should be equal to LSB four bits of the hash value
  12339. * of match data, in case of search index points to an entry which
  12340. * may be used in content based search also. The value can be
  12341. * anything when the entry pointed by search index will not be
  12342. * used for content based search.
  12343. *
  12344. * - htt_tlv_hdr_t
  12345. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12346. *
  12347. * Bits 11:0
  12348. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12349. *
  12350. * Bits 23:12
  12351. * Purpose: Length, Length of the value that follows the header
  12352. *
  12353. * Bits 31:28
  12354. * Purpose: Reserved.
  12355. *
  12356. *
  12357. * - SW_PEER_ID
  12358. * Bits 15:0
  12359. * Purpose: The peer ID (index) that WAL is allocating
  12360. * Value: (rx) peer ID
  12361. *
  12362. * - VDEV_ID
  12363. * Bits 23:16
  12364. * Purpose: Indicates which virtual device the peer is associated with.
  12365. * Value: vdev ID (used in the host to look up the vdev object)
  12366. *
  12367. * - CHIPID
  12368. * Bits 26:24
  12369. * Purpose: Indicates which Chip id the peer is associated with.
  12370. * Value: chip ID (Provided by Host as part of QMI exchange)
  12371. */
  12372. typedef enum {
  12373. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12374. } MLO_PEER_MAP_TLV_TAG_ID;
  12375. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12376. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12377. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12378. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12379. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12380. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12381. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12382. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12383. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12384. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12385. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12386. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12387. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12388. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12389. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12390. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12391. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12392. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12393. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12394. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12395. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12396. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12397. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12398. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12399. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12400. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12401. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12402. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12403. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12404. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12405. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12406. do { \
  12407. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12408. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12409. } while (0)
  12410. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12411. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12412. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12413. do { \
  12414. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12415. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12416. } while (0)
  12417. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12418. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12419. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12420. do { \
  12421. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12422. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12423. } while (0)
  12424. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12425. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12426. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12427. do { \
  12428. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12429. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12430. } while (0)
  12431. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12432. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12433. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12434. do { \
  12435. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12436. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12437. } while (0)
  12438. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12439. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12440. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12441. do { \
  12442. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12443. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12444. } while (0)
  12445. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12446. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12447. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12448. do { \
  12449. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12450. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12451. } while (0)
  12452. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12453. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12454. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12455. do { \
  12456. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12457. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12458. } while (0)
  12459. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12460. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12461. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12462. do { \
  12463. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12464. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12465. } while (0)
  12466. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12467. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12468. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12469. do { \
  12470. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12471. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12472. } while (0)
  12473. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12474. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12475. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12476. do { \
  12477. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12478. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12479. } while (0)
  12480. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12481. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12482. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12483. do { \
  12484. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12485. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12486. } while (0)
  12487. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12488. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12489. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12490. do { \
  12491. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12492. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12493. } while (0)
  12494. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12495. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12496. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12497. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12498. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12499. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12500. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12501. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12502. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12503. *
  12504. * The following diagram shows the format of the rx mlo peer unmap message sent
  12505. * from the target to the host.
  12506. *
  12507. * |31 24|23 16|15 8|7 0|
  12508. * |-----------------------------------------------------------------------|
  12509. * | RSVD_24_31 | MLO peer ID | msg type |
  12510. * |-----------------------------------------------------------------------|
  12511. */
  12512. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12513. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12514. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12515. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12516. /**
  12517. * @brief target -> host message specifying security parameters
  12518. *
  12519. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12520. *
  12521. * @details
  12522. * The following diagram shows the format of the security specification
  12523. * message sent from the target to the host.
  12524. * This security specification message tells the host whether a PN check is
  12525. * necessary on rx data frames, and if so, how large the PN counter is.
  12526. * This message also tells the host about the security processing to apply
  12527. * to defragmented rx frames - specifically, whether a Message Integrity
  12528. * Check is required, and the Michael key to use.
  12529. *
  12530. * |31 24|23 16|15|14 8|7 0|
  12531. * |-----------------------------------------------------------------------|
  12532. * | peer ID | U| security type | msg type |
  12533. * |-----------------------------------------------------------------------|
  12534. * | Michael Key K0 |
  12535. * |-----------------------------------------------------------------------|
  12536. * | Michael Key K1 |
  12537. * |-----------------------------------------------------------------------|
  12538. * | WAPI RSC Low0 |
  12539. * |-----------------------------------------------------------------------|
  12540. * | WAPI RSC Low1 |
  12541. * |-----------------------------------------------------------------------|
  12542. * | WAPI RSC Hi0 |
  12543. * |-----------------------------------------------------------------------|
  12544. * | WAPI RSC Hi1 |
  12545. * |-----------------------------------------------------------------------|
  12546. *
  12547. * The following field definitions describe the format of the security
  12548. * indication message sent from the target to the host.
  12549. * - MSG_TYPE
  12550. * Bits 7:0
  12551. * Purpose: identifies this as a security specification message
  12552. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12553. * - SEC_TYPE
  12554. * Bits 14:8
  12555. * Purpose: specifies which type of security applies to the peer
  12556. * Value: htt_sec_type enum value
  12557. * - UNICAST
  12558. * Bit 15
  12559. * Purpose: whether this security is applied to unicast or multicast data
  12560. * Value: 1 -> unicast, 0 -> multicast
  12561. * - PEER_ID
  12562. * Bits 31:16
  12563. * Purpose: The ID number for the peer the security specification is for
  12564. * Value: peer ID
  12565. * - MICHAEL_KEY_K0
  12566. * Bits 31:0
  12567. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12568. * Value: Michael Key K0 (if security type is TKIP)
  12569. * - MICHAEL_KEY_K1
  12570. * Bits 31:0
  12571. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12572. * Value: Michael Key K1 (if security type is TKIP)
  12573. * - WAPI_RSC_LOW0
  12574. * Bits 31:0
  12575. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12576. * Value: WAPI RSC Low0 (if security type is WAPI)
  12577. * - WAPI_RSC_LOW1
  12578. * Bits 31:0
  12579. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12580. * Value: WAPI RSC Low1 (if security type is WAPI)
  12581. * - WAPI_RSC_HI0
  12582. * Bits 31:0
  12583. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12584. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12585. * - WAPI_RSC_HI1
  12586. * Bits 31:0
  12587. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12588. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12589. */
  12590. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12591. #define HTT_SEC_IND_SEC_TYPE_S 8
  12592. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12593. #define HTT_SEC_IND_UNICAST_S 15
  12594. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12595. #define HTT_SEC_IND_PEER_ID_S 16
  12596. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12597. do { \
  12598. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12599. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12600. } while (0)
  12601. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12602. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12603. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12604. do { \
  12605. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12606. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12607. } while (0)
  12608. #define HTT_SEC_IND_UNICAST_GET(word) \
  12609. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12610. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12611. do { \
  12612. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12613. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12614. } while (0)
  12615. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12616. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12617. #define HTT_SEC_IND_BYTES 28
  12618. /**
  12619. * @brief target -> host rx ADDBA / DELBA message definitions
  12620. *
  12621. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12622. *
  12623. * @details
  12624. * The following diagram shows the format of the rx ADDBA message sent
  12625. * from the target to the host:
  12626. *
  12627. * |31 20|19 16|15 8|7 0|
  12628. * |---------------------------------------------------------------------|
  12629. * | peer ID | TID | window size | msg type |
  12630. * |---------------------------------------------------------------------|
  12631. *
  12632. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12633. *
  12634. * The following diagram shows the format of the rx DELBA message sent
  12635. * from the target to the host:
  12636. *
  12637. * |31 20|19 16|15 10|9 8|7 0|
  12638. * |---------------------------------------------------------------------|
  12639. * | peer ID | TID | window size | IR| msg type |
  12640. * |---------------------------------------------------------------------|
  12641. *
  12642. * The following field definitions describe the format of the rx ADDBA
  12643. * and DELBA messages sent from the target to the host.
  12644. * - MSG_TYPE
  12645. * Bits 7:0
  12646. * Purpose: identifies this as an rx ADDBA or DELBA message
  12647. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12648. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12649. * - IR (initiator / recipient)
  12650. * Bits 9:8 (DELBA only)
  12651. * Purpose: specify whether the DELBA handshake was initiated by the
  12652. * local STA/AP, or by the peer STA/AP
  12653. * Value:
  12654. * 0 - unspecified
  12655. * 1 - initiator (a.k.a. originator)
  12656. * 2 - recipient (a.k.a. responder)
  12657. * 3 - unused / reserved
  12658. * - WIN_SIZE
  12659. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12660. * Purpose: Specifies the length of the block ack window (max = 64).
  12661. * Value:
  12662. * block ack window length specified by the received ADDBA/DELBA
  12663. * management message.
  12664. * - TID
  12665. * Bits 19:16
  12666. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12667. * Value:
  12668. * TID specified by the received ADDBA or DELBA management message.
  12669. * - PEER_ID
  12670. * Bits 31:20
  12671. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12672. * Value:
  12673. * ID (hash value) used by the host for fast, direct lookup of
  12674. * host SW peer info, including rx reorder states.
  12675. */
  12676. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12677. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12678. #define HTT_RX_ADDBA_TID_M 0xf0000
  12679. #define HTT_RX_ADDBA_TID_S 16
  12680. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12681. #define HTT_RX_ADDBA_PEER_ID_S 20
  12682. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12683. do { \
  12684. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12685. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12686. } while (0)
  12687. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12688. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12689. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12690. do { \
  12691. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12692. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12693. } while (0)
  12694. #define HTT_RX_ADDBA_TID_GET(word) \
  12695. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12696. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12697. do { \
  12698. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12699. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12700. } while (0)
  12701. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12702. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12703. #define HTT_RX_ADDBA_BYTES 4
  12704. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12705. #define HTT_RX_DELBA_INITIATOR_S 8
  12706. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12707. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12708. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12709. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12710. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12711. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12712. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12713. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12714. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12715. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12716. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12717. do { \
  12718. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12719. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12720. } while (0)
  12721. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12722. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12723. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12724. do { \
  12725. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12726. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12727. } while (0)
  12728. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12729. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12730. #define HTT_RX_DELBA_BYTES 4
  12731. /**
  12732. * @brief target -> host rx ADDBA / DELBA message definitions
  12733. *
  12734. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12735. *
  12736. * @details
  12737. * The following diagram shows the format of the rx ADDBA extn message sent
  12738. * from the target to the host:
  12739. *
  12740. * |31 20|19 16|15 13|12 8|7 0|
  12741. * |---------------------------------------------------------------------|
  12742. * | peer ID | TID | reserved | msg type |
  12743. * |---------------------------------------------------------------------|
  12744. * | reserved | window size |
  12745. * |---------------------------------------------------------------------|
  12746. *
  12747. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12748. *
  12749. * The following diagram shows the format of the rx DELBA message sent
  12750. * from the target to the host:
  12751. *
  12752. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12753. * |---------------------------------------------------------------------|
  12754. * | peer ID | TID | reserved | IR| msg type |
  12755. * |---------------------------------------------------------------------|
  12756. * | reserved | window size |
  12757. * |---------------------------------------------------------------------|
  12758. *
  12759. * The following field definitions describe the format of the rx ADDBA
  12760. * and DELBA messages sent from the target to the host.
  12761. * - MSG_TYPE
  12762. * Bits 7:0
  12763. * Purpose: identifies this as an rx ADDBA or DELBA message
  12764. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12765. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12766. * - IR (initiator / recipient)
  12767. * Bits 9:8 (DELBA only)
  12768. * Purpose: specify whether the DELBA handshake was initiated by the
  12769. * local STA/AP, or by the peer STA/AP
  12770. * Value:
  12771. * 0 - unspecified
  12772. * 1 - initiator (a.k.a. originator)
  12773. * 2 - recipient (a.k.a. responder)
  12774. * 3 - unused / reserved
  12775. * Value:
  12776. * block ack window length specified by the received ADDBA/DELBA
  12777. * management message.
  12778. * - TID
  12779. * Bits 19:16
  12780. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12781. * Value:
  12782. * TID specified by the received ADDBA or DELBA management message.
  12783. * - PEER_ID
  12784. * Bits 31:20
  12785. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12786. * Value:
  12787. * ID (hash value) used by the host for fast, direct lookup of
  12788. * host SW peer info, including rx reorder states.
  12789. * == DWORD 1
  12790. * - WIN_SIZE
  12791. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12792. * Purpose: Specifies the length of the block ack window (max = 8191).
  12793. */
  12794. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12795. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12796. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12797. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12798. /*--- Dword 0 ---*/
  12799. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12800. do { \
  12801. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12802. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12803. } while (0)
  12804. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12805. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12806. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12807. do { \
  12808. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12809. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12810. } while (0)
  12811. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12812. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12813. /*--- Dword 1 ---*/
  12814. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12815. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12816. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12817. do { \
  12818. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12819. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12820. } while (0)
  12821. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12822. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12823. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12824. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12825. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12826. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12827. #define HTT_RX_DELBA_EXTN_TID_S 16
  12828. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12829. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12830. /*--- Dword 0 ---*/
  12831. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12832. do { \
  12833. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12834. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12835. } while (0)
  12836. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12837. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12838. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12839. do { \
  12840. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12841. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12842. } while (0)
  12843. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12844. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12845. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12846. do { \
  12847. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12848. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12849. } while (0)
  12850. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12851. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12852. /*--- Dword 1 ---*/
  12853. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12854. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12855. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12856. do { \
  12857. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12858. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12859. } while (0)
  12860. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12861. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12862. #define HTT_RX_DELBA_EXTN_BYTES 8
  12863. /**
  12864. * @brief tx queue group information element definition
  12865. *
  12866. * @details
  12867. * The following diagram shows the format of the tx queue group
  12868. * information element, which can be included in target --> host
  12869. * messages to specify the number of tx "credits" (tx descriptors
  12870. * for LL, or tx buffers for HL) available to a particular group
  12871. * of host-side tx queues, and which host-side tx queues belong to
  12872. * the group.
  12873. *
  12874. * |31|30 24|23 16|15|14|13 0|
  12875. * |------------------------------------------------------------------------|
  12876. * | X| reserved | tx queue grp ID | A| S| credit count |
  12877. * |------------------------------------------------------------------------|
  12878. * | vdev ID mask | AC mask |
  12879. * |------------------------------------------------------------------------|
  12880. *
  12881. * The following definitions describe the fields within the tx queue group
  12882. * information element:
  12883. * - credit_count
  12884. * Bits 13:1
  12885. * Purpose: specify how many tx credits are available to the tx queue group
  12886. * Value: An absolute or relative, positive or negative credit value
  12887. * The 'A' bit specifies whether the value is absolute or relative.
  12888. * The 'S' bit specifies whether the value is positive or negative.
  12889. * A negative value can only be relative, not absolute.
  12890. * An absolute value replaces any prior credit value the host has for
  12891. * the tx queue group in question.
  12892. * A relative value is added to the prior credit value the host has for
  12893. * the tx queue group in question.
  12894. * - sign
  12895. * Bit 14
  12896. * Purpose: specify whether the credit count is positive or negative
  12897. * Value: 0 -> positive, 1 -> negative
  12898. * - absolute
  12899. * Bit 15
  12900. * Purpose: specify whether the credit count is absolute or relative
  12901. * Value: 0 -> relative, 1 -> absolute
  12902. * - txq_group_id
  12903. * Bits 23:16
  12904. * Purpose: indicate which tx queue group's credit and/or membership are
  12905. * being specified
  12906. * Value: 0 to max_tx_queue_groups-1
  12907. * - reserved
  12908. * Bits 30:16
  12909. * Value: 0x0
  12910. * - eXtension
  12911. * Bit 31
  12912. * Purpose: specify whether another tx queue group info element follows
  12913. * Value: 0 -> no more tx queue group information elements
  12914. * 1 -> another tx queue group information element immediately follows
  12915. * - ac_mask
  12916. * Bits 15:0
  12917. * Purpose: specify which Access Categories belong to the tx queue group
  12918. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12919. * the tx queue group.
  12920. * The AC bit-mask values are obtained by left-shifting by the
  12921. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12922. * - vdev_id_mask
  12923. * Bits 31:16
  12924. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12925. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12926. * belong to the tx queue group.
  12927. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12928. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12929. */
  12930. PREPACK struct htt_txq_group {
  12931. A_UINT32
  12932. credit_count: 14,
  12933. sign: 1,
  12934. absolute: 1,
  12935. tx_queue_group_id: 8,
  12936. reserved0: 7,
  12937. extension: 1;
  12938. A_UINT32
  12939. ac_mask: 16,
  12940. vdev_id_mask: 16;
  12941. } POSTPACK;
  12942. /* first word */
  12943. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12944. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12945. #define HTT_TXQ_GROUP_SIGN_S 14
  12946. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12947. #define HTT_TXQ_GROUP_ABS_S 15
  12948. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12949. #define HTT_TXQ_GROUP_ID_S 16
  12950. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12951. #define HTT_TXQ_GROUP_EXT_S 31
  12952. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12953. /* second word */
  12954. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12955. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12956. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12957. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12958. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12959. do { \
  12960. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12961. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12962. } while (0)
  12963. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12964. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12965. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12966. do { \
  12967. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12968. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12969. } while (0)
  12970. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12971. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12972. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12973. do { \
  12974. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12975. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12976. } while (0)
  12977. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12978. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12979. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12980. do { \
  12981. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12982. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12983. } while (0)
  12984. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12985. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12986. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12987. do { \
  12988. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12989. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12990. } while (0)
  12991. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12992. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12993. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12994. do { \
  12995. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12996. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12997. } while (0)
  12998. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12999. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  13000. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  13001. do { \
  13002. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  13003. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  13004. } while (0)
  13005. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  13006. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  13007. /**
  13008. * @brief target -> host TX completion indication message definition
  13009. *
  13010. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  13011. *
  13012. * @details
  13013. * The following diagram shows the format of the TX completion indication sent
  13014. * from the target to the host
  13015. *
  13016. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  13017. * |-------------------------------------------------------------------|
  13018. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13019. * |-------------------------------------------------------------------|
  13020. * payload:| MSDU1 ID | MSDU0 ID |
  13021. * |-------------------------------------------------------------------|
  13022. * : MSDU3 ID | MSDU2 ID :
  13023. * |-------------------------------------------------------------------|
  13024. * | struct htt_tx_compl_ind_append_retries |
  13025. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13026. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13027. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13028. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13029. * |-------------------------------------------------------------------|
  13030. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13031. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13032. * | MSDU0 tx_tsf64_low |
  13033. * |-------------------------------------------------------------------|
  13034. * | MSDU0 tx_tsf64_high |
  13035. * |-------------------------------------------------------------------|
  13036. * | MSDU1 tx_tsf64_low |
  13037. * |-------------------------------------------------------------------|
  13038. * | MSDU1 tx_tsf64_high |
  13039. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13040. * | phy_timestamp |
  13041. * |-------------------------------------------------------------------|
  13042. * | rate specs (see below) |
  13043. * |-------------------------------------------------------------------|
  13044. * | seqctrl | framectrl |
  13045. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13046. * Where:
  13047. * A0 = append (a.k.a. append0)
  13048. * A1 = append1
  13049. * TP = MSDU tx power presence
  13050. * A2 = append2
  13051. * A3 = append3
  13052. * A4 = append4
  13053. *
  13054. * The following field definitions describe the format of the TX completion
  13055. * indication sent from the target to the host
  13056. * Header fields:
  13057. * - msg_type
  13058. * Bits 7:0
  13059. * Purpose: identifies this as HTT TX completion indication
  13060. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13061. * - status
  13062. * Bits 10:8
  13063. * Purpose: the TX completion status of payload fragmentations descriptors
  13064. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13065. * - tid
  13066. * Bits 14:11
  13067. * Purpose: the tid associated with those fragmentation descriptors. It is
  13068. * valid or not, depending on the tid_invalid bit.
  13069. * Value: 0 to 15
  13070. * - tid_invalid
  13071. * Bits 15:15
  13072. * Purpose: this bit indicates whether the tid field is valid or not
  13073. * Value: 0 indicates valid; 1 indicates invalid
  13074. * - num
  13075. * Bits 23:16
  13076. * Purpose: the number of payload in this indication
  13077. * Value: 1 to 255
  13078. * - append (a.k.a. append0)
  13079. * Bits 24:24
  13080. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13081. * the number of tx retries for one MSDU at the end of this message
  13082. * Value: 0 indicates no appending; 1 indicates appending
  13083. * - append1
  13084. * Bits 25:25
  13085. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13086. * contains the timestamp info for each TX msdu id in payload.
  13087. * The order of the timestamps matches the order of the MSDU IDs.
  13088. * Note that a big-endian host needs to account for the reordering
  13089. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13090. * conversion) when determining which tx timestamp corresponds to
  13091. * which MSDU ID.
  13092. * Value: 0 indicates no appending; 1 indicates appending
  13093. * - msdu_tx_power_presence
  13094. * Bits 26:26
  13095. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13096. * for each MSDU referenced by the TX_COMPL_IND message.
  13097. * The tx power is reported in 0.5 dBm units.
  13098. * The order of the per-MSDU tx power reports matches the order
  13099. * of the MSDU IDs.
  13100. * Note that a big-endian host needs to account for the reordering
  13101. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13102. * conversion) when determining which Tx Power corresponds to
  13103. * which MSDU ID.
  13104. * Value: 0 indicates MSDU tx power reports are not appended,
  13105. * 1 indicates MSDU tx power reports are appended
  13106. * - append2
  13107. * Bits 27:27
  13108. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13109. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13110. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13111. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13112. * for each MSDU, for convenience.
  13113. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13114. * this append2 bit is set).
  13115. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13116. * dB above the noise floor.
  13117. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13118. * 1 indicates MSDU ACK RSSI values are appended.
  13119. * - append3
  13120. * Bits 28:28
  13121. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13122. * contains the tx tsf info based on wlan global TSF for
  13123. * each TX msdu id in payload.
  13124. * The order of the tx tsf matches the order of the MSDU IDs.
  13125. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13126. * values to indicate the the lower 32 bits and higher 32 bits of
  13127. * the tx tsf.
  13128. * The tx_tsf64 here represents the time MSDU was acked and the
  13129. * tx_tsf64 has microseconds units.
  13130. * Value: 0 indicates no appending; 1 indicates appending
  13131. * - append4
  13132. * Bits 29:29
  13133. * Purpose: Indicate whether data frame control fields and fields required
  13134. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13135. * message. The order of the this message matches the order of
  13136. * the MSDU IDs.
  13137. * Value: 0 indicates frame control fields and fields required for
  13138. * radio tap header values are not appended,
  13139. * 1 indicates frame control fields and fields required for
  13140. * radio tap header values are appended.
  13141. * Payload fields:
  13142. * - hmsdu_id
  13143. * Bits 15:0
  13144. * Purpose: this ID is used to track the Tx buffer in host
  13145. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13146. */
  13147. PREPACK struct htt_tx_data_hdr_information {
  13148. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13149. A_UINT32 /* word 1 */
  13150. /* preamble:
  13151. * 0-OFDM,
  13152. * 1-CCk,
  13153. * 2-HT,
  13154. * 3-VHT
  13155. */
  13156. preamble: 2, /* [1:0] */
  13157. /* mcs:
  13158. * In case of HT preamble interpret
  13159. * MCS along with NSS.
  13160. * Valid values for HT are 0 to 7.
  13161. * HT mcs 0 with NSS 2 is mcs 8.
  13162. * Valid values for VHT are 0 to 9.
  13163. */
  13164. mcs: 4, /* [5:2] */
  13165. /* rate:
  13166. * This is applicable only for
  13167. * CCK and OFDM preamble type
  13168. * rate 0: OFDM 48 Mbps,
  13169. * 1: OFDM 24 Mbps,
  13170. * 2: OFDM 12 Mbps
  13171. * 3: OFDM 6 Mbps
  13172. * 4: OFDM 54 Mbps
  13173. * 5: OFDM 36 Mbps
  13174. * 6: OFDM 18 Mbps
  13175. * 7: OFDM 9 Mbps
  13176. * rate 0: CCK 11 Mbps Long
  13177. * 1: CCK 5.5 Mbps Long
  13178. * 2: CCK 2 Mbps Long
  13179. * 3: CCK 1 Mbps Long
  13180. * 4: CCK 11 Mbps Short
  13181. * 5: CCK 5.5 Mbps Short
  13182. * 6: CCK 2 Mbps Short
  13183. */
  13184. rate : 3, /* [ 8: 6] */
  13185. rssi : 8, /* [16: 9] units=dBm */
  13186. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13187. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13188. stbc : 1, /* [22] */
  13189. sgi : 1, /* [23] */
  13190. ldpc : 1, /* [24] */
  13191. beamformed: 1, /* [25] */
  13192. /* tx_retry_cnt:
  13193. * Indicates retry count of data tx frames provided by the host.
  13194. */
  13195. tx_retry_cnt: 6; /* [31:26] */
  13196. A_UINT32 /* word 2 */
  13197. framectrl:16, /* [15: 0] */
  13198. seqno:16; /* [31:16] */
  13199. } POSTPACK;
  13200. #define HTT_TX_COMPL_IND_STATUS_S 8
  13201. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13202. #define HTT_TX_COMPL_IND_TID_S 11
  13203. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13204. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13205. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13206. #define HTT_TX_COMPL_IND_NUM_S 16
  13207. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13208. #define HTT_TX_COMPL_IND_APPEND_S 24
  13209. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13210. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13211. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13212. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13213. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13214. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13215. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13216. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13217. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13218. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13219. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13220. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13221. do { \
  13222. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13223. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13224. } while (0)
  13225. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13226. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13227. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13228. do { \
  13229. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13230. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13231. } while (0)
  13232. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13233. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13234. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13235. do { \
  13236. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13237. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13238. } while (0)
  13239. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13240. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13241. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13242. do { \
  13243. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13244. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13245. } while (0)
  13246. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13247. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13248. HTT_TX_COMPL_IND_TID_INV_S)
  13249. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13250. do { \
  13251. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13252. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13253. } while (0)
  13254. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13255. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13256. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13257. do { \
  13258. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13259. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13260. } while (0)
  13261. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13262. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13263. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13264. do { \
  13265. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13266. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13267. } while (0)
  13268. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13269. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13270. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13271. do { \
  13272. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13273. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13274. } while (0)
  13275. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13276. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13277. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13278. do { \
  13279. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13280. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13281. } while (0)
  13282. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13283. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13284. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13285. do { \
  13286. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13287. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13288. } while (0)
  13289. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13290. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13291. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13292. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13293. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13294. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13295. #define HTT_TX_COMPL_IND_STAT_OK 0
  13296. /* DISCARD:
  13297. * current meaning:
  13298. * MSDUs were queued for transmission but filtered by HW or SW
  13299. * without any over the air attempts
  13300. * legacy meaning (HL Rome):
  13301. * MSDUs were discarded by the target FW without any over the air
  13302. * attempts due to lack of space
  13303. */
  13304. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13305. /* NO_ACK:
  13306. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13307. */
  13308. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13309. /* POSTPONE:
  13310. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13311. * be downloaded again later (in the appropriate order), when they are
  13312. * deliverable.
  13313. */
  13314. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13315. /*
  13316. * The PEER_DEL tx completion status is used for HL cases
  13317. * where the peer the frame is for has been deleted.
  13318. * The host has already discarded its copy of the frame, but
  13319. * it still needs the tx completion to restore its credit.
  13320. */
  13321. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13322. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13323. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13324. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13325. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13326. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13327. PREPACK struct htt_tx_compl_ind_base {
  13328. A_UINT32 hdr;
  13329. A_UINT16 payload[1/*or more*/];
  13330. } POSTPACK;
  13331. PREPACK struct htt_tx_compl_ind_append_retries {
  13332. A_UINT16 msdu_id;
  13333. A_UINT8 tx_retries;
  13334. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13335. 0: this is the last append_retries struct */
  13336. } POSTPACK;
  13337. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13338. A_UINT32 timestamp[1/*or more*/];
  13339. } POSTPACK;
  13340. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13341. A_UINT32 tx_tsf64_low;
  13342. A_UINT32 tx_tsf64_high;
  13343. } POSTPACK;
  13344. /* htt_tx_data_hdr_information payload extension fields: */
  13345. /* DWORD zero */
  13346. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13347. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13348. /* DWORD one */
  13349. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13350. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13351. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13352. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13353. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13354. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13355. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13356. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13357. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13358. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13359. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13360. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13361. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13362. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13363. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13364. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13365. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13366. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13367. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13368. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13369. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13370. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13371. /* DWORD two */
  13372. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13373. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13374. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13375. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13376. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13377. do { \
  13378. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13379. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13380. } while (0)
  13381. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13382. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13383. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13384. do { \
  13385. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13386. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13387. } while (0)
  13388. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13389. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13390. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13391. do { \
  13392. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13393. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13394. } while (0)
  13395. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13396. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13397. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13398. do { \
  13399. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13400. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13401. } while (0)
  13402. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13403. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13404. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13405. do { \
  13406. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13407. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13408. } while (0)
  13409. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13410. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13411. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13412. do { \
  13413. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13414. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13415. } while (0)
  13416. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13417. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13418. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13419. do { \
  13420. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13421. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13422. } while (0)
  13423. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13424. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13425. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13426. do { \
  13427. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13428. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13429. } while (0)
  13430. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13431. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13432. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13433. do { \
  13434. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13435. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13436. } while (0)
  13437. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13438. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13439. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13440. do { \
  13441. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13442. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13443. } while (0)
  13444. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13445. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13446. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13447. do { \
  13448. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13449. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13450. } while (0)
  13451. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13452. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13453. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13454. do { \
  13455. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13456. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13457. } while (0)
  13458. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13459. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13460. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13461. do { \
  13462. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13463. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13464. } while (0)
  13465. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13466. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13467. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13468. do { \
  13469. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13470. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13471. } while (0)
  13472. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13473. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13474. /**
  13475. * @brief target -> host software UMAC TX completion indication message
  13476. *
  13477. * MSG_TYPE => HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND
  13478. *
  13479. * @details
  13480. * The following diagram shows the format of the soft UMAC TX completion
  13481. * indication sent from the target to the host
  13482. *
  13483. * |31 30|29|28|27|26 20|19 17|16|15 12|11|10| 9|8|7 4|3 1|0|
  13484. * |-------------------------------------+----------------+------------|
  13485. * hdr: | rsvd | msdu_cnt | msg_type |
  13486. * pyld: |===================================================================|
  13487. * MSDU 0| buf addr low (bits 31:0) |
  13488. * |-----------------------------------------------+------+------------|
  13489. * | SW buffer cookie | RS | buf addr hi|
  13490. * |--------+--+--+-------------+--------+---------+------+------------|
  13491. * | rsvd0 | M| V| tx count | TID | SW peer ID |
  13492. * |--------+--+--+-------------+--------+----------------------+------|
  13493. * | frametype | TQM status number | RELR |
  13494. * |-----+-----+-----------------------------------+--+-+-+-----+------|
  13495. * |rsvd1| buffer timestamp | A|L|F| ACK RSSI |
  13496. * |-----+--+-------------------------+--+------+-----+--+-+-----+---+-|
  13497. * | rsvd2 | tones in RU |OF|tx MCS|txSGI|LC|S|PKTYP|BW |I|
  13498. * |--------+-------------------------+--+------+-----+--+-+-----+---+-|
  13499. * | PPDU transmission TSF |
  13500. * |-------------------------------------------------------------------|
  13501. * | rsvd3 |
  13502. * |===================================================================|
  13503. * MSDU 1| buf addr low (bits 31:0) |
  13504. * : ... :
  13505. * | rsvd3 |
  13506. * |===================================================================|
  13507. * etc.
  13508. *
  13509. * Where:
  13510. * RS = release source
  13511. * V = valid
  13512. * M = multicast
  13513. * RELR = release reason
  13514. * F = first MSDU
  13515. * L = last MSDU
  13516. * A = MSDU is part of A-MSDU
  13517. * I = rate info valid
  13518. * PKTYP = packet type
  13519. * S = STBC
  13520. * LC = LDPC
  13521. * OF = OFDMA transmission
  13522. */
  13523. typedef enum {
  13524. /* 0 (REASON_FRAME_ACKED):
  13525. * Corresponds to tqm_release_reason = <enum 0 tqm_rr_frame_acked>;
  13526. * frame is removed because an ACK of BA for it was received.
  13527. */
  13528. HTT_TX_MSDU_RELEASE_REASON_FRAME_ACKED,
  13529. /* 1 (REASON_REMOVE_CMD_FW):
  13530. * Corresponds to tqm_release_reason = <enum 1 tqm_rr_rem_cmd_rem>;
  13531. * frame is removed because a remove command of type "Remove_mpdus"
  13532. * initiated by SW.
  13533. */
  13534. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_FW,
  13535. /* 2 (REASON_REMOVE_CMD_TX):
  13536. * Corresponds to tqm_release_reason = <enum 2 tqm_rr_rem_cmd_tx>;
  13537. * frame is removed because a remove command of type
  13538. * "Remove_transmitted_mpdus" initiated by SW.
  13539. */
  13540. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_TX,
  13541. /* 3 (REASON_REMOVE_CMD_NOTX):
  13542. * Corresponds to tqm_release_reason = <enum 3 tqm_rr_rem_cmd_notx>;
  13543. * frame is removed because a remove command of type
  13544. * "Remove_untransmitted_mpdus" initiated by SW.
  13545. */
  13546. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_NOTX,
  13547. /* 4 (REASON_REMOVE_CMD_AGED):
  13548. * Corresponds to tqm_release_reason = <enum 4 tqm_rr_rem_cmd_aged>;
  13549. * frame is removed because a remove command of type "Remove_aged_mpdus"
  13550. * or "Remove_aged_msdus" initiated by SW.
  13551. */
  13552. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_AGED,
  13553. /* 5 (RELEASE_FW_REASON1):
  13554. * Corresponds to tqm_release_reason = <enum 5 tqm_fw_reason1>;
  13555. * frame is removed because a remove command where fw indicated that
  13556. * remove reason is fw_reason1.
  13557. */
  13558. HTT_TX_MSDU_RELEASE_FW_REASON1,
  13559. /* 6 (RELEASE_FW_REASON2):
  13560. * Corresponds to tqm_release_reason = <enum 6 tqm_fw_reason2>;
  13561. * frame is removed because a remove command where fw indicated that
  13562. * remove reason is fw_reason1.
  13563. */
  13564. HTT_TX_MSDU_RELEASE_FW_REASON2,
  13565. /* 7 (RELEASE_FW_REASON3):
  13566. * Corresponds to tqm_release_reason = <enum 7 tqm_fw_reason3>;
  13567. * frame is removed because a remove command where fw indicated that
  13568. * remove reason is fw_reason1.
  13569. */
  13570. HTT_TX_MSDU_RELEASE_FW_REASON3,
  13571. /* 8 (REASON_REMOVE_CMD_DISABLEQ):
  13572. * Corresponds to tqm_release_reason = <enum 8 tqm_rr_rem_cmd_disable_queue>
  13573. * frame is removed because a remove command of type
  13574. * "remove_mpdus_and_disable_queue" or "remove_msdus_and_disable_flow"
  13575. * initiated by SW.
  13576. */
  13577. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_DISABLEQ,
  13578. /* 9 (REASON_DROP_MISC):
  13579. * Corresponds to sw_release_reason = Packet dropped by FW due to
  13580. * any discard reason that is not categorized as MSDU TTL expired.
  13581. * Examples: TXDE ENQ layer dropped the packet due to peer delete,
  13582. * tid delete, no resource credit available.
  13583. */
  13584. HTT_TX_MSDU_RELEASE_REASON_DROP_MISC,
  13585. /* 10 (REASON_DROP_TTL):
  13586. * Corresponds to sw_release_reason = Packet dropped by FW due to
  13587. * discard reason that frame is not transmitted due to MSDU TTL expired.
  13588. */
  13589. HTT_TX_MSDU_RELEASE_REASON_DROP_TTL,
  13590. /* 11 - available for use */
  13591. /* 12 - available for use */
  13592. /* 13 - available for use */
  13593. /* 14 - available for use */
  13594. /* 15 - available for use */
  13595. HTT_TX_MSDU_RELEASE_REASON_MAX = 16
  13596. } htt_t2h_tx_msdu_release_reason_e;
  13597. typedef enum {
  13598. /* 0 (RELEASE_SOURCE_FW):
  13599. * MSDU released by FW even before the frame was queued to TQM-L HW.
  13600. */
  13601. HTT_TX_MSDU_RELEASE_SOURCE_FW,
  13602. /* 1 (RELEASE_SOURCE_TQM_LITE):
  13603. * MSDU released by TQM-L HW.
  13604. */
  13605. HTT_TX_MSDU_RELEASE_SOURCE_TQM_LITE,
  13606. HTT_TX_MSDU_RELEASE_SOURCE_MAX = 8
  13607. } htt_t2h_tx_msdu_release_source_e;
  13608. struct htt_t2h_tx_buffer_addr_info { /* 2 words */
  13609. A_UINT32 buffer_addr_31_0 : 32; /* [31:0] */
  13610. A_UINT32 buffer_addr_39_32 : 8, /* [7:0] */
  13611. /* release_source:
  13612. * holds a htt_t2h_tx_msdu_release_source_e enum value
  13613. */
  13614. release_source : 3, /* [10:8] */
  13615. sw_buffer_cookie : 21; /* [31:11] */
  13616. /* NOTE:
  13617. * To preserve backwards compatibility,
  13618. * no new fields can be added in this struct.
  13619. */
  13620. };
  13621. /* member definitions of htt_t2h_tx_buffer_addr_info */
  13622. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M 0xFFFFFFFF
  13623. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S 0
  13624. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_SET(word, value) \
  13625. do { \
  13626. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0, value); \
  13627. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S; \
  13628. } while (0)
  13629. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_GET(word) \
  13630. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S)
  13631. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M 0x000000FF
  13632. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S 0
  13633. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_SET(word, value) \
  13634. do { \
  13635. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32, value); \
  13636. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S; \
  13637. } while (0)
  13638. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_GET(word) \
  13639. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S)
  13640. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M 0x00000700
  13641. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S 8
  13642. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_SET(word, value) \
  13643. do { \
  13644. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE, value); \
  13645. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S; \
  13646. } while (0)
  13647. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_GET(word) \
  13648. (((word) & HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M) >> HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S)
  13649. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M 0xFFFFF800
  13650. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S 11
  13651. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  13652. do { \
  13653. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE, value); \
  13654. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S; \
  13655. } while (0)
  13656. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_GET(word) \
  13657. (((word) & HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M) >> HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S)
  13658. struct htt_t2h_tx_rate_stats_info { /* 2 words */
  13659. /* word 0 */
  13660. A_UINT32
  13661. /* tx_rate_stats_info_valid:
  13662. * Indicates if the tx rate stats below are valid.
  13663. */
  13664. tx_rate_stats_info_valid : 1, /* [0] */
  13665. /* transmit_bw:
  13666. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13667. * Indicates the BW of the upcoming transmission that shall likely
  13668. * start in about 3 -4 us on the medium:
  13669. * <enum 0 transmit_bw_20_MHz>
  13670. * <enum 1 transmit_bw_40_MHz>
  13671. * <enum 2 transmit_bw_80_MHz>
  13672. * <enum 3 transmit_bw_160_MHz>
  13673. * <enum 4 transmit_bw_320_MHz>
  13674. */
  13675. transmit_bw : 3, /* [3:1] */
  13676. /* transmit_pkt_type:
  13677. * same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13678. * Field filled in by PDG.
  13679. * Not valid when in SW transmit mode
  13680. * The packet type
  13681. * <enum_type PKT_TYPE_ENUM>
  13682. * Type: enum Definition Name: PKT_TYPE_ENUM
  13683. * enum number enum name Description
  13684. * ------------------------------------
  13685. * 0 dot11a 802.11a PPDU type
  13686. * 1 dot11b 802.11b PPDU type
  13687. * 2 dot11n_mm 802.11n Mixed Mode PPDU type
  13688. * 3 dot11ac 802.11ac PPDU type
  13689. * 4 dot11ax 802.11ax PPDU type
  13690. * 5 dot11ba 802.11ba (WUR) PPDU type
  13691. * 6 dot11be 802.11be PPDU type
  13692. * 7 dot11az 802.11az (ranging) PPDU type
  13693. */
  13694. transmit_pkt_type : 4, /* [7:4] */
  13695. /* transmit_stbc:
  13696. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13697. * Field filled in by PDG.
  13698. * Not valid when in SW transmit mode
  13699. * When set, STBC transmission rate was used.
  13700. */
  13701. transmit_stbc : 1, /* [8] */
  13702. /* transmit_ldpc:
  13703. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13704. * Field filled in by PDG.
  13705. * Not valid when in SW transmit mode
  13706. * When set, use LDPC transmission rates
  13707. */
  13708. transmit_ldpc : 1, /* [9] */
  13709. /* transmit_sgi:
  13710. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13711. * Field filled in by PDG.
  13712. * Not valid when in SW transmit mode
  13713. * <enum 0 0_8_us_sgi > Legacy normal GI. Can also be used for HE
  13714. * <enum 1 0_4_us_sgi > Legacy short GI. Can also be used for HE
  13715. * <enum 2 1_6_us_sgi > HE related GI
  13716. * <enum 3 3_2_us_sgi > HE related GI
  13717. * <legal 0 - 3>
  13718. */
  13719. transmit_sgi : 2, /* [11:10] */
  13720. /* transmit_mcs:
  13721. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13722. * Field filled in by PDG.
  13723. * Not valid when in SW transmit mode
  13724. *
  13725. * For details, refer to MCS_TYPE description
  13726. * <legal all>
  13727. * Pkt_type Related definition of MCS_TYPE
  13728. * dot11b This field is the rate:
  13729. * 0: CCK 11 Mbps Long
  13730. * 1: CCK 5.5 Mbps Long
  13731. * 2: CCK 2 Mbps Long
  13732. * 3: CCK 1 Mbps Long
  13733. * 4: CCK 11 Mbps Short
  13734. * 5: CCK 5.5 Mbps Short
  13735. * 6: CCK 2 Mbps Short
  13736. * NOTE: The numbering here is NOT the same as the as MAC gives
  13737. * in the "rate" field in the SIG given to the PHY.
  13738. * The MAC will do an internal translation.
  13739. *
  13740. * Dot11a This field is the rate:
  13741. * 0: OFDM 48 Mbps
  13742. * 1: OFDM 24 Mbps
  13743. * 2: OFDM 12 Mbps
  13744. * 3: OFDM 6 Mbps
  13745. * 4: OFDM 54 Mbps
  13746. * 5: OFDM 36 Mbps
  13747. * 6: OFDM 18 Mbps
  13748. * 7: OFDM 9 Mbps
  13749. * NOTE: The numbering here is NOT the same as the as MAC gives
  13750. * in the "rate" field in the SIG given to the PHY.
  13751. * The MAC will do an internal translation.
  13752. *
  13753. * Dot11n_mm (mixed mode) This field represends the MCS.
  13754. * 0: HT MCS 0 (BPSK 1/2)
  13755. * 1: HT MCS 1 (QPSK 1/2)
  13756. * 2: HT MCS 2 (QPSK 3/4)
  13757. * 3: HT MCS 3 (16-QAM 1/2)
  13758. * 4: HT MCS 4 (16-QAM 3/4)
  13759. * 5: HT MCS 5 (64-QAM 2/3)
  13760. * 6: HT MCS 6 (64-QAM 3/4)
  13761. * 7: HT MCS 7 (64-QAM 5/6)
  13762. * NOTE: To get higher MCS's use the nss field to indicate the
  13763. * number of spatial streams.
  13764. *
  13765. * Dot11ac This field represends the MCS.
  13766. * 0: VHT MCS 0 (BPSK 1/2)
  13767. * 1: VHT MCS 1 (QPSK 1/2)
  13768. * 2: VHT MCS 2 (QPSK 3/4)
  13769. * 3: VHT MCS 3 (16-QAM 1/2)
  13770. * 4: VHT MCS 4 (16-QAM 3/4)
  13771. * 5: VHT MCS 5 (64-QAM 2/3)
  13772. * 6: VHT MCS 6 (64-QAM 3/4)
  13773. * 7: VHT MCS 7 (64-QAM 5/6)
  13774. * 8: VHT MCS 8 (256-QAM 3/4)
  13775. * 9: VHT MCS 9 (256-QAM 5/6)
  13776. * 10: VHT MCS 10 (1024-QAM 3/4)
  13777. * 11: VHT MCS 11 (1024-QAM 5/6)
  13778. * NOTE: There are several illegal VHT rates due to fractional
  13779. * number of bits per symbol.
  13780. * Below are the illegal rates for 4 streams and lower:
  13781. * 20 MHz, 1 stream, MCS 9
  13782. * 20 MHz, 2 stream, MCS 9
  13783. * 20 MHz, 4 stream, MCS 9
  13784. * 80 MHz, 3 stream, MCS 6
  13785. * 160 MHz, 3 stream, MCS 9 (Unsupported)
  13786. * 160 MHz, 4 stream, MCS 7 (Unsupported)
  13787. *
  13788. * dot11ax This field represends the MCS.
  13789. * 0: HE MCS 0 (BPSK 1/2)
  13790. * 1: HE MCS 1 (QPSK 1/2)
  13791. * 2: HE MCS 2 (QPSK 3/4)
  13792. * 3: HE MCS 3 (16-QAM 1/2)
  13793. * 4: HE MCS 4 (16-QAM 3/4)
  13794. * 5: HE MCS 5 (64-QAM 2/3)
  13795. * 6: HE MCS 6 (64-QAM 3/4)
  13796. * 7: HE MCS 7 (64-QAM 5/6)
  13797. * 8: HE MCS 8 (256-QAM 3/4)
  13798. * 9: HE MCS 9 (256-QAM 5/6)
  13799. * 10: HE MCS 10 (1024-QAM 3/4)
  13800. * 11: HE MCS 11 (1024-QAM 5/6)
  13801. * 12: HE MCS 12 (4096-QAM 3/4)
  13802. * 13: HE MCS 13 (4096-QAM 5/6)
  13803. *
  13804. * dot11ba This field is the rate:
  13805. * 0: LDR
  13806. * 1: HDR
  13807. * 2: Q2Q proprietary rate
  13808. */
  13809. transmit_mcs : 4, /* [15:12] */
  13810. /* ofdma_transmission:
  13811. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13812. * Field filled in by PDG.
  13813. * Set when the transmission was an OFDMA transmission (DL or UL).
  13814. * <legal all>
  13815. */
  13816. ofdma_transmission : 1, /* [16] */
  13817. /* tones_in_ru:
  13818. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13819. * Field filled in by PDG.
  13820. * Not valid when in SW transmit mode
  13821. * The number of tones in the RU used.
  13822. * <legal all>
  13823. */
  13824. tones_in_ru : 12, /* [28:17] */
  13825. rsvd2 : 3; /* [31:29] */
  13826. /* word 1 */
  13827. /* ppdu_transmission_tsf:
  13828. * Based on a HWSCH configuration register setting,
  13829. * this field either contains:
  13830. * Lower 32 bits of the TSF, snapshot of this value when transmission
  13831. * of the PPDU containing the frame finished.
  13832. * OR
  13833. * Lower 32 bits of the TSF, snapshot of this value when transmission
  13834. * of the PPDU containing the frame started.
  13835. * <legal all>
  13836. */
  13837. A_UINT32 ppdu_transmission_tsf;
  13838. /* NOTE:
  13839. * To preserve backwards compatibility,
  13840. * no new fields can be added in this struct.
  13841. */
  13842. };
  13843. /* member definitions of htt_t2h_tx_rate_stats_info */
  13844. #define HTT_TX_RATE_STATS_INFO_VALID_M 0x00000001
  13845. #define HTT_TX_RATE_STATS_INFO_VALID_S 0
  13846. #define HTT_TX_RATE_STATS_INFO_VALID_SET(word, value) \
  13847. do { \
  13848. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_VALID, value); \
  13849. (word) |= (value) << HTT_TX_RATE_STATS_INFO_VALID_S; \
  13850. } while (0)
  13851. #define HTT_TX_RATE_STATS_INFO_VALID_GET(word) \
  13852. (((word) & HTT_TX_RATE_STATS_INFO_VALID_M) >> HTT_TX_RATE_STATS_INFO_VALID_S)
  13853. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M 0x0000000E
  13854. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S 1
  13855. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_SET(word, value) \
  13856. do { \
  13857. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_BW, value); \
  13858. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S; \
  13859. } while (0)
  13860. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_GET(word) \
  13861. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S)
  13862. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M 0x000000F0
  13863. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S 4
  13864. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_SET(word, value) \
  13865. do { \
  13866. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE, value); \
  13867. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S; \
  13868. } while (0)
  13869. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_GET(word) \
  13870. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S)
  13871. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M 0x00000100
  13872. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S 8
  13873. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_SET(word, value) \
  13874. do { \
  13875. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC, value); \
  13876. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S; \
  13877. } while (0)
  13878. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_GET(word) \
  13879. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S)
  13880. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M 0x00000200
  13881. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S 9
  13882. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_SET(word, value) \
  13883. do { \
  13884. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC, value); \
  13885. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S; \
  13886. } while (0)
  13887. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_GET(word) \
  13888. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S)
  13889. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M 0x00000C00
  13890. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S 10
  13891. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_SET(word, value) \
  13892. do { \
  13893. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI, value); \
  13894. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S; \
  13895. } while (0)
  13896. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_GET(word) \
  13897. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S)
  13898. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M 0x0000F000
  13899. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S 12
  13900. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_SET(word, value) \
  13901. do { \
  13902. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS, value); \
  13903. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S; \
  13904. } while (0)
  13905. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_GET(word) \
  13906. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S)
  13907. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M 0x00010000
  13908. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S 16
  13909. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_SET(word, value) \
  13910. do { \
  13911. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION, value); \
  13912. (word) |= (value) << HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S; \
  13913. } while (0)
  13914. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_GET(word) \
  13915. (((word) & HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M) >> HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S)
  13916. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M 0x1FFE0000
  13917. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S 17
  13918. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_SET(word, value) \
  13919. do { \
  13920. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TONES_IN_RU, value); \
  13921. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S; \
  13922. } while (0)
  13923. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_GET(word) \
  13924. (((word) & HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M) >> HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S)
  13925. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M 0xFFFFFFFF
  13926. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S 0
  13927. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_SET(word, value) \
  13928. do { \
  13929. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF, value); \
  13930. (word) |= (value) << HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S; \
  13931. } while (0)
  13932. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_GET(word) \
  13933. (((word) & HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M) >> HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S)
  13934. struct htt_t2h_tx_msdu_info { /* 8 words */
  13935. /* words 0 + 1 */
  13936. struct htt_t2h_tx_buffer_addr_info addr_info;
  13937. /* word 2 */
  13938. A_UINT32
  13939. sw_peer_id : 16,
  13940. tid : 4,
  13941. transmit_cnt : 7,
  13942. valid : 1,
  13943. mcast : 1,
  13944. rsvd0 : 3;
  13945. /* word 3 */
  13946. A_UINT32
  13947. release_reason : 4, /* Refer to htt_t2h_tx_msdu_release_reason_e */
  13948. tqm_status_number : 24,
  13949. frame_type : 4; /* holds htt_tx_wbm_status_frame_type value */
  13950. /* word 4 */
  13951. A_UINT32
  13952. /* ack_frame_rssi:
  13953. * If this frame is removed as the result of the
  13954. * reception of an ACK or BA, this field indicates
  13955. * the RSSI of the received ACK or BA frame.
  13956. * When the frame is removed as result of a direct
  13957. * remove command from the SW, this field is set
  13958. * to 0x0 (which is never a valid value when real
  13959. * RSSI is available).
  13960. * Units: dB w.r.t noise floor
  13961. */
  13962. ack_frame_rssi : 8,
  13963. first_msdu : 1,
  13964. last_msdu : 1,
  13965. msdu_part_of_amsdu : 1,
  13966. buffer_timestamp : 19, /* units = TU = 1024 microseconds */
  13967. rsvd1 : 2;
  13968. /* words 5 + 6 */
  13969. struct htt_t2h_tx_rate_stats_info tx_rate_stats;
  13970. /* word 7 */
  13971. /* rsvd3:
  13972. * backup reserved field to add new parameters if [rsvd0, rsvd1, rsvd2]
  13973. * is not sufficient
  13974. */
  13975. A_UINT32 rsvd3;
  13976. /* NOTE:
  13977. * To preserve backwards compatibility,
  13978. * no new fields can be added in this struct.
  13979. */
  13980. };
  13981. /* member definitions of htt_t2h_tx_msdu_info */
  13982. #define HTT_TX_MSDU_INFO_SW_PEER_ID_M 0x0000FFFF
  13983. #define HTT_TX_MSDU_INFO_SW_PEER_ID_S 0
  13984. #define HTT_TX_MSDU_INFO_SW_PEER_ID_SET(word, value) \
  13985. do { \
  13986. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_SW_PEER_ID, value); \
  13987. (word) |= (value) << HTT_TX_MSDU_INFO_SW_PEER_ID_S; \
  13988. } while (0)
  13989. #define HTT_TX_MSDU_INFO_SW_PEER_ID_GET(word) \
  13990. (((word) & HTT_TX_MSDU_INFO_SW_PEER_ID_M) >> HTT_TX_MSDU_INFO_SW_PEER_ID_S)
  13991. #define HTT_TX_MSDU_INFO_TID_M 0x000F0000
  13992. #define HTT_TX_MSDU_INFO_TID_S 16
  13993. #define HTT_TX_MSDU_INFO_TID_SET(word, value) \
  13994. do { \
  13995. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TID, value); \
  13996. (word) |= (value) << HTT_TX_MSDU_INFO_TID_S; \
  13997. } while (0)
  13998. #define HTT_TX_MSDU_INFO_TID_GET(word) \
  13999. (((word) & HTT_TX_MSDU_INFO_TID_M) >> HTT_TX_MSDU_INFO_TID_S)
  14000. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_M 0x07F00000
  14001. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_S 20
  14002. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_SET(word, value) \
  14003. do { \
  14004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TRANSMIT_CNT, value); \
  14005. (word) |= (value) << HTT_TX_MSDU_INFO_TRANSMIT_CNT_S; \
  14006. } while (0)
  14007. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_GET(word) \
  14008. (((word) & HTT_TX_MSDU_INFO_TRANSMIT_CNT_M) >> HTT_TX_MSDU_INFO_TRANSMIT_CNT_S)
  14009. #define HTT_TX_MSDU_INFO_VALID_M 0x08000000
  14010. #define HTT_TX_MSDU_INFO_VALID_S 27
  14011. #define HTT_TX_MSDU_INFO_VALID_SET(word, value) \
  14012. do { \
  14013. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_VALID, value); \
  14014. (word) |= (value) << HTT_TX_MSDU_INFO_VALID_S; \
  14015. } while (0)
  14016. #define HTT_TX_MSDU_INFO_VALID_GET(word) \
  14017. (((word) & HTT_TX_MSDU_INFO_VALID_M) >> HTT_TX_MSDU_INFO_VALID_S)
  14018. #define HTT_TX_MSDU_INFO_MCAST_M 0x10000000
  14019. #define HTT_TX_MSDU_INFO_MCAST_S 28
  14020. #define HTT_TX_MSDU_INFO_MCAST_SET(word, value) \
  14021. do { \
  14022. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MCAST, value); \
  14023. (word) |= (value) << HTT_TX_MSDU_INFO_MCAST_S; \
  14024. } while (0)
  14025. #define HTT_TX_MSDU_INFO_MCAST_GET(word) \
  14026. (((word) & HTT_TX_MSDU_INFO_MCAST_M) >> HTT_TX_MSDU_INFO_MCAST_S)
  14027. #define HTT_TX_MSDU_INFO_RELEASE_REASON_M 0x0000000F
  14028. #define HTT_TX_MSDU_INFO_RELEASE_REASON_S 0
  14029. #define HTT_TX_MSDU_INFO_RELEASE_REASON_SET(word, value) \
  14030. do { \
  14031. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_RELEASE_REASON, value); \
  14032. (word) |= (value) << HTT_TX_MSDU_INFO_RELEASE_REASON_S; \
  14033. } while (0)
  14034. #define HTT_TX_MSDU_INFO_RELEASE_REASON_GET(word) \
  14035. (((word) & HTT_TX_MSDU_INFO_RELEASE_REASON_M) >> HTT_TX_MSDU_INFO_RELEASE_REASON_S)
  14036. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M 0x0FFFFFF0
  14037. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S 4
  14038. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_SET(word, value) \
  14039. do { \
  14040. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER, value); \
  14041. (word) |= (value) << HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S; \
  14042. } while (0)
  14043. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_GET(word) \
  14044. (((word) & HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M) >> HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S)
  14045. #define HTT_TX_MSDU_INFO_FRAME_TYPE_M 0xF0000000
  14046. #define HTT_TX_MSDU_INFO_FRAME_TYPE_S 28
  14047. #define HTT_TX_MSDU_INFO_FRAME_TYPE_SET(word, value) \
  14048. do { \
  14049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FRAME_TYPE, value); \
  14050. (word) |= (value) << HTT_TX_MSDU_INFO_FRAME_TYPE_S; \
  14051. } while (0)
  14052. #define HTT_TX_MSDU_INFO_FRAME_TYPE_GET(word) \
  14053. (((word) & HTT_TX_MSDU_INFO_FRAME_TYPE_M) >> HTT_TX_MSDU_INFO_FRAME_TYPE_S)
  14054. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M 0x000000FF
  14055. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S 0
  14056. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_SET(word, value) \
  14057. do { \
  14058. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_ACK_FRAME_RSSI, value); \
  14059. (word) |= (value) << HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S; \
  14060. } while (0)
  14061. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_GET(word) \
  14062. (((word) & HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M) >> HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S)
  14063. #define HTT_TX_MSDU_INFO_FIRST_MSDU_M 0x00000100
  14064. #define HTT_TX_MSDU_INFO_FIRST_MSDU_S 8
  14065. #define HTT_TX_MSDU_INFO_FIRST_MSDU_SET(word, value) \
  14066. do { \
  14067. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FIRST_MSDU, value); \
  14068. (word) |= (value) << HTT_TX_MSDU_INFO_FIRST_MSDU_S; \
  14069. } while (0)
  14070. #define HTT_TX_MSDU_INFO_FIRST_MSDU_GET(word) \
  14071. (((word) & HTT_TX_MSDU_INFO_FIRST_MSDU_M) >> HTT_TX_MSDU_INFO_FIRST_MSDU_S)
  14072. #define HTT_TX_MSDU_INFO_LAST_MSDU_M 0x00000200
  14073. #define HTT_TX_MSDU_INFO_LAST_MSDU_S 9
  14074. #define HTT_TX_MSDU_INFO_LAST_MSDU_SET(word, value) \
  14075. do { \
  14076. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_LAST_MSDU, value); \
  14077. (word) |= (value) << HTT_TX_MSDU_INFO_LAST_MSDU_S; \
  14078. } while (0)
  14079. #define HTT_TX_MSDU_INFO_LAST_MSDU_GET(word) \
  14080. (((word) & HTT_TX_MSDU_INFO_LAST_MSDU_M) >> HTT_TX_MSDU_INFO_LAST_MSDU_S)
  14081. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M 0x00000400
  14082. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S 10
  14083. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_SET(word, value) \
  14084. do { \
  14085. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU, value); \
  14086. (word) |= (value) << HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S; \
  14087. } while (0)
  14088. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_GET(word) \
  14089. (((word) & HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M) >> HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S)
  14090. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M 0x3FFFF800
  14091. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S 11
  14092. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_SET(word, value) \
  14093. do { \
  14094. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP, value); \
  14095. (word) |= (value) << HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S; \
  14096. } while (0)
  14097. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_GET(word) \
  14098. (((word) & HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M) >> HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S)
  14099. struct htt_t2h_soft_umac_tx_compl_ind {
  14100. A_UINT32 msg_type : 8, /* HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND */
  14101. msdu_cnt : 8, /* min: 0, max: 255 */
  14102. rsvd0 : 16;
  14103. /* NOTE:
  14104. * To preserve backwards compatibility,
  14105. * no new fields can be added in this struct.
  14106. */
  14107. /*
  14108. * append here:
  14109. * struct htt_t2h_tx_msdu_info payload[1(or more)]
  14110. * for all the msdu's that are part of this completion.
  14111. */
  14112. };
  14113. /* member definitions of htt_t2h_soft_umac_tx_compl_ind */
  14114. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M 0x0000FF00
  14115. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S 8
  14116. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_SET(word, value) \
  14117. do { \
  14118. HTT_CHECK_SET_VAL(HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT, value); \
  14119. (word) |= (value) << HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S; \
  14120. } while (0)
  14121. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_GET(word) \
  14122. (((word) & HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M) >> HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S)
  14123. /**
  14124. * @brief target -> host rate-control update indication message
  14125. *
  14126. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  14127. *
  14128. * @details
  14129. * The following diagram shows the format of the RC Update message
  14130. * sent from the target to the host, while processing the tx-completion
  14131. * of a transmitted PPDU.
  14132. *
  14133. * |31 24|23 16|15 8|7 0|
  14134. * |-------------------------------------------------------------|
  14135. * | peer ID | vdev ID | msg_type |
  14136. * |-------------------------------------------------------------|
  14137. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  14138. * |-------------------------------------------------------------|
  14139. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  14140. * |-------------------------------------------------------------|
  14141. * | : |
  14142. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14143. * | : |
  14144. * |-------------------------------------------------------------|
  14145. * | : |
  14146. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14147. * | : |
  14148. * |-------------------------------------------------------------|
  14149. * : :
  14150. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14151. *
  14152. */
  14153. typedef struct {
  14154. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  14155. A_UINT32 rate_code_flags;
  14156. A_UINT32 flags; /* Encodes information such as excessive
  14157. retransmission, aggregate, some info
  14158. from .11 frame control,
  14159. STBC, LDPC, (SGI and Tx Chain Mask
  14160. are encoded in ptx_rc->flags field),
  14161. AMPDU truncation (BT/time based etc.),
  14162. RTS/CTS attempt */
  14163. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  14164. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  14165. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  14166. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  14167. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  14168. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  14169. } HTT_RC_TX_DONE_PARAMS;
  14170. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  14171. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  14172. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  14173. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  14174. #define HTT_RC_UPDATE_VDEVID_S 8
  14175. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  14176. #define HTT_RC_UPDATE_PEERID_S 16
  14177. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  14178. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  14179. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  14180. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  14181. do { \
  14182. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  14183. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  14184. } while (0)
  14185. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  14186. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  14187. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  14188. do { \
  14189. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  14190. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  14191. } while (0)
  14192. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  14193. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  14194. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  14195. do { \
  14196. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  14197. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  14198. } while (0)
  14199. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  14200. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  14201. /**
  14202. * @brief target -> host rx fragment indication message definition
  14203. *
  14204. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  14205. *
  14206. * @details
  14207. * The following field definitions describe the format of the rx fragment
  14208. * indication message sent from the target to the host.
  14209. * The rx fragment indication message shares the format of the
  14210. * rx indication message, but not all fields from the rx indication message
  14211. * are relevant to the rx fragment indication message.
  14212. *
  14213. *
  14214. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  14215. * |-----------+-------------------+---------------------+-------------|
  14216. * | peer ID | |FV| ext TID | msg type |
  14217. * |-------------------------------------------------------------------|
  14218. * | | flush | flush |
  14219. * | | end | start |
  14220. * | | seq num | seq num |
  14221. * |-------------------------------------------------------------------|
  14222. * | reserved | FW rx desc bytes |
  14223. * |-------------------------------------------------------------------|
  14224. * | | FW MSDU Rx |
  14225. * | | desc B0 |
  14226. * |-------------------------------------------------------------------|
  14227. * Header fields:
  14228. * - MSG_TYPE
  14229. * Bits 7:0
  14230. * Purpose: identifies this as an rx fragment indication message
  14231. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  14232. * - EXT_TID
  14233. * Bits 12:8
  14234. * Purpose: identify the traffic ID of the rx data, including
  14235. * special "extended" TID values for multicast, broadcast, and
  14236. * non-QoS data frames
  14237. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  14238. * - FLUSH_VALID (FV)
  14239. * Bit 13
  14240. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  14241. * is valid
  14242. * Value:
  14243. * 1 -> flush IE is valid and needs to be processed
  14244. * 0 -> flush IE is not valid and should be ignored
  14245. * - PEER_ID
  14246. * Bits 31:16
  14247. * Purpose: Identify, by ID, which peer sent the rx data
  14248. * Value: ID of the peer who sent the rx data
  14249. * - FLUSH_SEQ_NUM_START
  14250. * Bits 5:0
  14251. * Purpose: Indicate the start of a series of MPDUs to flush
  14252. * Not all MPDUs within this series are necessarily valid - the host
  14253. * must check each sequence number within this range to see if the
  14254. * corresponding MPDU is actually present.
  14255. * This field is only valid if the FV bit is set.
  14256. * Value:
  14257. * The sequence number for the first MPDUs to check to flush.
  14258. * The sequence number is masked by 0x3f.
  14259. * - FLUSH_SEQ_NUM_END
  14260. * Bits 11:6
  14261. * Purpose: Indicate the end of a series of MPDUs to flush
  14262. * Value:
  14263. * The sequence number one larger than the sequence number of the
  14264. * last MPDU to check to flush.
  14265. * The sequence number is masked by 0x3f.
  14266. * Not all MPDUs within this series are necessarily valid - the host
  14267. * must check each sequence number within this range to see if the
  14268. * corresponding MPDU is actually present.
  14269. * This field is only valid if the FV bit is set.
  14270. * Rx descriptor fields:
  14271. * - FW_RX_DESC_BYTES
  14272. * Bits 15:0
  14273. * Purpose: Indicate how many bytes in the Rx indication are used for
  14274. * FW Rx descriptors
  14275. * Value: 1
  14276. */
  14277. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  14278. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  14279. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  14280. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  14281. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  14282. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  14283. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  14284. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  14285. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  14286. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  14287. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  14288. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  14289. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  14290. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  14291. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  14292. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  14293. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  14294. #define HTT_RX_FRAG_IND_BYTES \
  14295. (4 /* msg hdr */ + \
  14296. 4 /* flush spec */ + \
  14297. 4 /* (unused) FW rx desc bytes spec */ + \
  14298. 4 /* FW rx desc */)
  14299. /**
  14300. * @brief target -> host test message definition
  14301. *
  14302. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  14303. *
  14304. * @details
  14305. * The following field definitions describe the format of the test
  14306. * message sent from the target to the host.
  14307. * The message consists of a 4-octet header, followed by a variable
  14308. * number of 32-bit integer values, followed by a variable number
  14309. * of 8-bit character values.
  14310. *
  14311. * |31 16|15 8|7 0|
  14312. * |-----------------------------------------------------------|
  14313. * | num chars | num ints | msg type |
  14314. * |-----------------------------------------------------------|
  14315. * | int 0 |
  14316. * |-----------------------------------------------------------|
  14317. * | int 1 |
  14318. * |-----------------------------------------------------------|
  14319. * | ... |
  14320. * |-----------------------------------------------------------|
  14321. * | char 3 | char 2 | char 1 | char 0 |
  14322. * |-----------------------------------------------------------|
  14323. * | | | ... | char 4 |
  14324. * |-----------------------------------------------------------|
  14325. * - MSG_TYPE
  14326. * Bits 7:0
  14327. * Purpose: identifies this as a test message
  14328. * Value: HTT_MSG_TYPE_TEST
  14329. * - NUM_INTS
  14330. * Bits 15:8
  14331. * Purpose: indicate how many 32-bit integers follow the message header
  14332. * - NUM_CHARS
  14333. * Bits 31:16
  14334. * Purpose: indicate how many 8-bit characters follow the series of integers
  14335. */
  14336. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  14337. #define HTT_RX_TEST_NUM_INTS_S 8
  14338. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  14339. #define HTT_RX_TEST_NUM_CHARS_S 16
  14340. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  14341. do { \
  14342. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  14343. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  14344. } while (0)
  14345. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  14346. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  14347. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  14348. do { \
  14349. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  14350. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  14351. } while (0)
  14352. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  14353. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  14354. /**
  14355. * @brief target -> host packet log message
  14356. *
  14357. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  14358. *
  14359. * @details
  14360. * The following field definitions describe the format of the packet log
  14361. * message sent from the target to the host.
  14362. * The message consists of a 4-octet header,followed by a variable number
  14363. * of 32-bit character values.
  14364. *
  14365. * |31 16|15 12|11 10|9 8|7 0|
  14366. * |------------------------------------------------------------------|
  14367. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  14368. * |------------------------------------------------------------------|
  14369. * | payload |
  14370. * |------------------------------------------------------------------|
  14371. * - MSG_TYPE
  14372. * Bits 7:0
  14373. * Purpose: identifies this as a pktlog message
  14374. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  14375. * - mac_id
  14376. * Bits 9:8
  14377. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  14378. * Value: 0-3
  14379. * - pdev_id
  14380. * Bits 11:10
  14381. * Purpose: pdev_id
  14382. * Value: 0-3
  14383. * 0 (for rings at SOC level),
  14384. * 1/2/3 PDEV -> 0/1/2
  14385. * - payload_size
  14386. * Bits 31:16
  14387. * Purpose: explicitly specify the payload size
  14388. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  14389. */
  14390. PREPACK struct htt_pktlog_msg {
  14391. A_UINT32 header;
  14392. A_UINT32 payload[1/* or more */];
  14393. } POSTPACK;
  14394. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  14395. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  14396. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  14397. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  14398. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  14399. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  14400. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  14401. do { \
  14402. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  14403. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  14404. } while (0)
  14405. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  14406. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  14407. HTT_T2H_PKTLOG_MAC_ID_S)
  14408. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  14409. do { \
  14410. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  14411. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  14412. } while (0)
  14413. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  14414. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  14415. HTT_T2H_PKTLOG_PDEV_ID_S)
  14416. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  14417. do { \
  14418. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  14419. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  14420. } while (0)
  14421. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  14422. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  14423. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  14424. /*
  14425. * Rx reorder statistics
  14426. * NB: all the fields must be defined in 4 octets size.
  14427. */
  14428. struct rx_reorder_stats {
  14429. /* Non QoS MPDUs received */
  14430. A_UINT32 deliver_non_qos;
  14431. /* MPDUs received in-order */
  14432. A_UINT32 deliver_in_order;
  14433. /* Flush due to reorder timer expired */
  14434. A_UINT32 deliver_flush_timeout;
  14435. /* Flush due to move out of window */
  14436. A_UINT32 deliver_flush_oow;
  14437. /* Flush due to DELBA */
  14438. A_UINT32 deliver_flush_delba;
  14439. /* MPDUs dropped due to FCS error */
  14440. A_UINT32 fcs_error;
  14441. /* MPDUs dropped due to monitor mode non-data packet */
  14442. A_UINT32 mgmt_ctrl;
  14443. /* Unicast-data MPDUs dropped due to invalid peer */
  14444. A_UINT32 invalid_peer;
  14445. /* MPDUs dropped due to duplication (non aggregation) */
  14446. A_UINT32 dup_non_aggr;
  14447. /* MPDUs dropped due to processed before */
  14448. A_UINT32 dup_past;
  14449. /* MPDUs dropped due to duplicate in reorder queue */
  14450. A_UINT32 dup_in_reorder;
  14451. /* Reorder timeout happened */
  14452. A_UINT32 reorder_timeout;
  14453. /* invalid bar ssn */
  14454. A_UINT32 invalid_bar_ssn;
  14455. /* reorder reset due to bar ssn */
  14456. A_UINT32 ssn_reset;
  14457. /* Flush due to delete peer */
  14458. A_UINT32 deliver_flush_delpeer;
  14459. /* Flush due to offload*/
  14460. A_UINT32 deliver_flush_offload;
  14461. /* Flush due to out of buffer*/
  14462. A_UINT32 deliver_flush_oob;
  14463. /* MPDUs dropped due to PN check fail */
  14464. A_UINT32 pn_fail;
  14465. /* MPDUs dropped due to unable to allocate memory */
  14466. A_UINT32 store_fail;
  14467. /* Number of times the tid pool alloc succeeded */
  14468. A_UINT32 tid_pool_alloc_succ;
  14469. /* Number of times the MPDU pool alloc succeeded */
  14470. A_UINT32 mpdu_pool_alloc_succ;
  14471. /* Number of times the MSDU pool alloc succeeded */
  14472. A_UINT32 msdu_pool_alloc_succ;
  14473. /* Number of times the tid pool alloc failed */
  14474. A_UINT32 tid_pool_alloc_fail;
  14475. /* Number of times the MPDU pool alloc failed */
  14476. A_UINT32 mpdu_pool_alloc_fail;
  14477. /* Number of times the MSDU pool alloc failed */
  14478. A_UINT32 msdu_pool_alloc_fail;
  14479. /* Number of times the tid pool freed */
  14480. A_UINT32 tid_pool_free;
  14481. /* Number of times the MPDU pool freed */
  14482. A_UINT32 mpdu_pool_free;
  14483. /* Number of times the MSDU pool freed */
  14484. A_UINT32 msdu_pool_free;
  14485. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  14486. A_UINT32 msdu_queued;
  14487. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  14488. A_UINT32 msdu_recycled;
  14489. /* Number of MPDUs with invalid peer but A2 found in AST */
  14490. A_UINT32 invalid_peer_a2_in_ast;
  14491. /* Number of MPDUs with invalid peer but A3 found in AST */
  14492. A_UINT32 invalid_peer_a3_in_ast;
  14493. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  14494. A_UINT32 invalid_peer_bmc_mpdus;
  14495. /* Number of MSDUs with err attention word */
  14496. A_UINT32 rxdesc_err_att;
  14497. /* Number of MSDUs with flag of peer_idx_invalid */
  14498. A_UINT32 rxdesc_err_peer_idx_inv;
  14499. /* Number of MSDUs with flag of peer_idx_timeout */
  14500. A_UINT32 rxdesc_err_peer_idx_to;
  14501. /* Number of MSDUs with flag of overflow */
  14502. A_UINT32 rxdesc_err_ov;
  14503. /* Number of MSDUs with flag of msdu_length_err */
  14504. A_UINT32 rxdesc_err_msdu_len;
  14505. /* Number of MSDUs with flag of mpdu_length_err */
  14506. A_UINT32 rxdesc_err_mpdu_len;
  14507. /* Number of MSDUs with flag of tkip_mic_err */
  14508. A_UINT32 rxdesc_err_tkip_mic;
  14509. /* Number of MSDUs with flag of decrypt_err */
  14510. A_UINT32 rxdesc_err_decrypt;
  14511. /* Number of MSDUs with flag of fcs_err */
  14512. A_UINT32 rxdesc_err_fcs;
  14513. /* Number of Unicast (bc_mc bit is not set in attention word)
  14514. * frames with invalid peer handler
  14515. */
  14516. A_UINT32 rxdesc_uc_msdus_inv_peer;
  14517. /* Number of unicast frame directly (direct bit is set in attention word)
  14518. * to DUT with invalid peer handler
  14519. */
  14520. A_UINT32 rxdesc_direct_msdus_inv_peer;
  14521. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  14522. * frames with invalid peer handler
  14523. */
  14524. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  14525. /* Number of MSDUs dropped due to no first MSDU flag */
  14526. A_UINT32 rxdesc_no_1st_msdu;
  14527. /* Number of MSDUs dropped due to ring overflow */
  14528. A_UINT32 msdu_drop_ring_ov;
  14529. /* Number of MSDUs dropped due to FC mismatch */
  14530. A_UINT32 msdu_drop_fc_mismatch;
  14531. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  14532. A_UINT32 msdu_drop_mgmt_remote_ring;
  14533. /* Number of MSDUs dropped due to errors not reported in attention word */
  14534. A_UINT32 msdu_drop_misc;
  14535. /* Number of MSDUs go to offload before reorder */
  14536. A_UINT32 offload_msdu_wal;
  14537. /* Number of data frame dropped by offload after reorder */
  14538. A_UINT32 offload_msdu_reorder;
  14539. /* Number of MPDUs with sequence number in the past and within the BA window */
  14540. A_UINT32 dup_past_within_window;
  14541. /* Number of MPDUs with sequence number in the past and outside the BA window */
  14542. A_UINT32 dup_past_outside_window;
  14543. /* Number of MSDUs with decrypt/MIC error */
  14544. A_UINT32 rxdesc_err_decrypt_mic;
  14545. /* Number of data MSDUs received on both local and remote rings */
  14546. A_UINT32 data_msdus_on_both_rings;
  14547. /* MPDUs never filled */
  14548. A_UINT32 holes_not_filled;
  14549. };
  14550. /*
  14551. * Rx Remote buffer statistics
  14552. * NB: all the fields must be defined in 4 octets size.
  14553. */
  14554. struct rx_remote_buffer_mgmt_stats {
  14555. /* Total number of MSDUs reaped for Rx processing */
  14556. A_UINT32 remote_reaped;
  14557. /* MSDUs recycled within firmware */
  14558. A_UINT32 remote_recycled;
  14559. /* MSDUs stored by Data Rx */
  14560. A_UINT32 data_rx_msdus_stored;
  14561. /* Number of HTT indications from WAL Rx MSDU */
  14562. A_UINT32 wal_rx_ind;
  14563. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  14564. A_UINT32 wal_rx_ind_unconsumed;
  14565. /* Number of HTT indications from Data Rx MSDU */
  14566. A_UINT32 data_rx_ind;
  14567. /* Number of unconsumed HTT indications from Data Rx MSDU */
  14568. A_UINT32 data_rx_ind_unconsumed;
  14569. /* Number of HTT indications from ATHBUF */
  14570. A_UINT32 athbuf_rx_ind;
  14571. /* Number of remote buffers requested for refill */
  14572. A_UINT32 refill_buf_req;
  14573. /* Number of remote buffers filled by the host */
  14574. A_UINT32 refill_buf_rsp;
  14575. /* Number of times MAC hw_index = f/w write_index */
  14576. A_INT32 mac_no_bufs;
  14577. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  14578. A_INT32 fw_indices_equal;
  14579. /* Number of times f/w finds no buffers to post */
  14580. A_INT32 host_no_bufs;
  14581. };
  14582. /*
  14583. * TXBF MU/SU packets and NDPA statistics
  14584. * NB: all the fields must be defined in 4 octets size.
  14585. */
  14586. struct rx_txbf_musu_ndpa_pkts_stats {
  14587. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  14588. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  14589. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  14590. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  14591. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  14592. A_UINT32 reserved[3]; /* must be set to 0x0 */
  14593. };
  14594. /*
  14595. * htt_dbg_stats_status -
  14596. * present - The requested stats have been delivered in full.
  14597. * This indicates that either the stats information was contained
  14598. * in its entirety within this message, or else this message
  14599. * completes the delivery of the requested stats info that was
  14600. * partially delivered through earlier STATS_CONF messages.
  14601. * partial - The requested stats have been delivered in part.
  14602. * One or more subsequent STATS_CONF messages with the same
  14603. * cookie value will be sent to deliver the remainder of the
  14604. * information.
  14605. * error - The requested stats could not be delivered, for example due
  14606. * to a shortage of memory to construct a message holding the
  14607. * requested stats.
  14608. * invalid - The requested stat type is either not recognized, or the
  14609. * target is configured to not gather the stats type in question.
  14610. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14611. * series_done - This special value indicates that no further stats info
  14612. * elements are present within a series of stats info elems
  14613. * (within a stats upload confirmation message).
  14614. */
  14615. enum htt_dbg_stats_status {
  14616. HTT_DBG_STATS_STATUS_PRESENT = 0,
  14617. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  14618. HTT_DBG_STATS_STATUS_ERROR = 2,
  14619. HTT_DBG_STATS_STATUS_INVALID = 3,
  14620. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  14621. };
  14622. /**
  14623. * @brief target -> host statistics upload
  14624. *
  14625. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  14626. *
  14627. * @details
  14628. * The following field definitions describe the format of the HTT target
  14629. * to host stats upload confirmation message.
  14630. * The message contains a cookie echoed from the HTT host->target stats
  14631. * upload request, which identifies which request the confirmation is
  14632. * for, and a series of tag-length-value stats information elements.
  14633. * The tag-length header for each stats info element also includes a
  14634. * status field, to indicate whether the request for the stat type in
  14635. * question was fully met, partially met, unable to be met, or invalid
  14636. * (if the stat type in question is disabled in the target).
  14637. * A special value of all 1's in this status field is used to indicate
  14638. * the end of the series of stats info elements.
  14639. *
  14640. *
  14641. * |31 16|15 8|7 5|4 0|
  14642. * |------------------------------------------------------------|
  14643. * | reserved | msg type |
  14644. * |------------------------------------------------------------|
  14645. * | cookie LSBs |
  14646. * |------------------------------------------------------------|
  14647. * | cookie MSBs |
  14648. * |------------------------------------------------------------|
  14649. * | stats entry length | reserved | S |stat type|
  14650. * |------------------------------------------------------------|
  14651. * | |
  14652. * | type-specific stats info |
  14653. * | |
  14654. * |------------------------------------------------------------|
  14655. * | stats entry length | reserved | S |stat type|
  14656. * |------------------------------------------------------------|
  14657. * | |
  14658. * | type-specific stats info |
  14659. * | |
  14660. * |------------------------------------------------------------|
  14661. * | n/a | reserved | 111 | n/a |
  14662. * |------------------------------------------------------------|
  14663. * Header fields:
  14664. * - MSG_TYPE
  14665. * Bits 7:0
  14666. * Purpose: identifies this is a statistics upload confirmation message
  14667. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  14668. * - COOKIE_LSBS
  14669. * Bits 31:0
  14670. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14671. * message with its preceding host->target stats request message.
  14672. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14673. * - COOKIE_MSBS
  14674. * Bits 31:0
  14675. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14676. * message with its preceding host->target stats request message.
  14677. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14678. *
  14679. * Stats Information Element tag-length header fields:
  14680. * - STAT_TYPE
  14681. * Bits 4:0
  14682. * Purpose: identifies the type of statistics info held in the
  14683. * following information element
  14684. * Value: htt_dbg_stats_type
  14685. * - STATUS
  14686. * Bits 7:5
  14687. * Purpose: indicate whether the requested stats are present
  14688. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  14689. * the completion of the stats entry series
  14690. * - LENGTH
  14691. * Bits 31:16
  14692. * Purpose: indicate the stats information size
  14693. * Value: This field specifies the number of bytes of stats information
  14694. * that follows the element tag-length header.
  14695. * It is expected but not required that this length is a multiple of
  14696. * 4 bytes. Even if the length is not an integer multiple of 4, the
  14697. * subsequent stats entry header will begin on a 4-byte aligned
  14698. * boundary.
  14699. */
  14700. #define HTT_T2H_STATS_COOKIE_SIZE 8
  14701. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  14702. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  14703. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  14704. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  14705. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  14706. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  14707. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  14708. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14709. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  14710. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  14711. do { \
  14712. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  14713. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  14714. } while (0)
  14715. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  14716. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  14717. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  14718. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  14719. do { \
  14720. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  14721. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  14722. } while (0)
  14723. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  14724. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  14725. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  14726. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14727. do { \
  14728. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  14729. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  14730. } while (0)
  14731. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  14732. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  14733. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  14734. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  14735. #define HTT_MAX_AGGR 64
  14736. #define HTT_HL_MAX_AGGR 18
  14737. /**
  14738. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  14739. *
  14740. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  14741. *
  14742. * @details
  14743. * The following field definitions describe the format of the HTT host
  14744. * to target frag_desc/msdu_ext bank configuration message.
  14745. * The message contains the based address and the min and max id of the
  14746. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  14747. * MSDU_EXT/FRAG_DESC.
  14748. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  14749. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  14750. * the hardware does the mapping/translation.
  14751. *
  14752. * Total banks that can be configured is configured to 16.
  14753. *
  14754. * This should be called before any TX has be initiated by the HTT
  14755. *
  14756. * |31 16|15 8|7 5|4 0|
  14757. * |------------------------------------------------------------|
  14758. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  14759. * |------------------------------------------------------------|
  14760. * | BANK0_BASE_ADDRESS (bits 31:0) |
  14761. #if HTT_PADDR64
  14762. * | BANK0_BASE_ADDRESS (bits 63:32) |
  14763. #endif
  14764. * |------------------------------------------------------------|
  14765. * | ... |
  14766. * |------------------------------------------------------------|
  14767. * | BANK15_BASE_ADDRESS (bits 31:0) |
  14768. #if HTT_PADDR64
  14769. * | BANK15_BASE_ADDRESS (bits 63:32) |
  14770. #endif
  14771. * |------------------------------------------------------------|
  14772. * | BANK0_MAX_ID | BANK0_MIN_ID |
  14773. * |------------------------------------------------------------|
  14774. * | ... |
  14775. * |------------------------------------------------------------|
  14776. * | BANK15_MAX_ID | BANK15_MIN_ID |
  14777. * |------------------------------------------------------------|
  14778. * Header fields:
  14779. * - MSG_TYPE
  14780. * Bits 7:0
  14781. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  14782. * for systems with 64-bit format for bus addresses:
  14783. * - BANKx_BASE_ADDRESS_LO
  14784. * Bits 31:0
  14785. * Purpose: Provide a mechanism to specify the base address of the
  14786. * MSDU_EXT bank physical/bus address.
  14787. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  14788. * - BANKx_BASE_ADDRESS_HI
  14789. * Bits 31:0
  14790. * Purpose: Provide a mechanism to specify the base address of the
  14791. * MSDU_EXT bank physical/bus address.
  14792. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  14793. * for systems with 32-bit format for bus addresses:
  14794. * - BANKx_BASE_ADDRESS
  14795. * Bits 31:0
  14796. * Purpose: Provide a mechanism to specify the base address of the
  14797. * MSDU_EXT bank physical/bus address.
  14798. * Value: MSDU_EXT bank physical / bus address
  14799. * - BANKx_MIN_ID
  14800. * Bits 15:0
  14801. * Purpose: Provide a mechanism to specify the min index that needs to
  14802. * mapped.
  14803. * - BANKx_MAX_ID
  14804. * Bits 31:16
  14805. * Purpose: Provide a mechanism to specify the max index that needs to
  14806. * mapped.
  14807. *
  14808. */
  14809. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  14810. * safe value.
  14811. * @note MAX supported banks is 16.
  14812. */
  14813. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  14814. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  14815. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  14816. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  14817. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  14818. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  14819. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  14820. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  14821. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  14822. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  14823. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  14824. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  14825. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  14826. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  14827. do { \
  14828. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  14829. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  14830. } while (0)
  14831. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  14832. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  14833. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  14834. do { \
  14835. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  14836. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  14837. } while (0)
  14838. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  14839. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  14840. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  14841. do { \
  14842. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  14843. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  14844. } while (0)
  14845. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  14846. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  14847. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  14848. do { \
  14849. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  14850. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  14851. } while (0)
  14852. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  14853. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  14854. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  14855. do { \
  14856. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  14857. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  14858. } while (0)
  14859. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  14860. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  14861. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  14862. do { \
  14863. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  14864. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  14865. } while (0)
  14866. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  14867. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  14868. /*
  14869. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  14870. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  14871. * addresses are stored in a XXX-bit field.
  14872. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  14873. * htt_tx_frag_desc64_bank_cfg_t structs.
  14874. */
  14875. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  14876. _paddr_bits_, \
  14877. _paddr__bank_base_address_) \
  14878. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  14879. /** word 0 \
  14880. * msg_type: 8, \
  14881. * pdev_id: 2, \
  14882. * swap: 1, \
  14883. * reserved0: 5, \
  14884. * num_banks: 8, \
  14885. * desc_size: 8; \
  14886. */ \
  14887. A_UINT32 word0; \
  14888. /* \
  14889. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  14890. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  14891. * the second A_UINT32). \
  14892. */ \
  14893. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14894. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14895. } POSTPACK
  14896. /* define htt_tx_frag_desc32_bank_cfg_t */
  14897. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  14898. /* define htt_tx_frag_desc64_bank_cfg_t */
  14899. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  14900. /*
  14901. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  14902. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  14903. */
  14904. #if HTT_PADDR64
  14905. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  14906. #else
  14907. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  14908. #endif
  14909. /**
  14910. * @brief target -> host HTT TX Credit total count update message definition
  14911. *
  14912. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  14913. *
  14914. *|31 16|15|14 9| 8 |7 0 |
  14915. *|---------------------+--+----------+-------+----------|
  14916. *|cur htt credit delta | Q| reserved | sign | msg type |
  14917. *|------------------------------------------------------|
  14918. *
  14919. * Header fields:
  14920. * - MSG_TYPE
  14921. * Bits 7:0
  14922. * Purpose: identifies this as a htt tx credit delta update message
  14923. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14924. * - SIGN
  14925. * Bits 8
  14926. * identifies whether credit delta is positive or negative
  14927. * Value:
  14928. * - 0x0: credit delta is positive, rebalance in some buffers
  14929. * - 0x1: credit delta is negative, rebalance out some buffers
  14930. * - reserved
  14931. * Bits 14:9
  14932. * Value: 0x0
  14933. * - TXQ_GRP
  14934. * Bit 15
  14935. * Purpose: indicates whether any tx queue group information elements
  14936. * are appended to the tx credit update message
  14937. * Value: 0 -> no tx queue group information element is present
  14938. * 1 -> a tx queue group information element immediately follows
  14939. * - DELTA_COUNT
  14940. * Bits 31:16
  14941. * Purpose: Specify current htt credit delta absolute count
  14942. */
  14943. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14944. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14945. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14946. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14947. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14948. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14949. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14950. do { \
  14951. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14952. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14953. } while (0)
  14954. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14955. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14956. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14957. do { \
  14958. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14959. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14960. } while (0)
  14961. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14962. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14963. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14964. do { \
  14965. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14966. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14967. } while (0)
  14968. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14969. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14970. #define HTT_TX_CREDIT_MSG_BYTES 4
  14971. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14972. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14973. /**
  14974. * @brief HTT WDI_IPA Operation Response Message
  14975. *
  14976. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14977. *
  14978. * @details
  14979. * HTT WDI_IPA Operation Response message is sent by target
  14980. * to host confirming suspend or resume operation.
  14981. * |31 24|23 16|15 8|7 0|
  14982. * |----------------+----------------+----------------+----------------|
  14983. * | op_code | Rsvd | msg_type |
  14984. * |-------------------------------------------------------------------|
  14985. * | Rsvd | Response len |
  14986. * |-------------------------------------------------------------------|
  14987. * | |
  14988. * | Response-type specific info |
  14989. * | |
  14990. * | |
  14991. * |-------------------------------------------------------------------|
  14992. * Header fields:
  14993. * - MSG_TYPE
  14994. * Bits 7:0
  14995. * Purpose: Identifies this as WDI_IPA Operation Response message
  14996. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14997. * - OP_CODE
  14998. * Bits 31:16
  14999. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  15000. * value: = enum htt_wdi_ipa_op_code
  15001. * - RSP_LEN
  15002. * Bits 16:0
  15003. * Purpose: length for the response-type specific info
  15004. * value: = length in bytes for response-type specific info
  15005. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  15006. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  15007. */
  15008. PREPACK struct htt_wdi_ipa_op_response_t
  15009. {
  15010. /* DWORD 0: flags and meta-data */
  15011. A_UINT32
  15012. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15013. reserved1: 8,
  15014. op_code: 16;
  15015. A_UINT32
  15016. rsp_len: 16,
  15017. reserved2: 16;
  15018. } POSTPACK;
  15019. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  15020. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  15021. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  15022. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  15023. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  15024. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  15025. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  15026. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  15027. do { \
  15028. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  15029. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  15030. } while (0)
  15031. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  15032. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  15033. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  15034. do { \
  15035. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  15036. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  15037. } while (0)
  15038. enum htt_phy_mode {
  15039. htt_phy_mode_11a = 0,
  15040. htt_phy_mode_11g = 1,
  15041. htt_phy_mode_11b = 2,
  15042. htt_phy_mode_11g_only = 3,
  15043. htt_phy_mode_11na_ht20 = 4,
  15044. htt_phy_mode_11ng_ht20 = 5,
  15045. htt_phy_mode_11na_ht40 = 6,
  15046. htt_phy_mode_11ng_ht40 = 7,
  15047. htt_phy_mode_11ac_vht20 = 8,
  15048. htt_phy_mode_11ac_vht40 = 9,
  15049. htt_phy_mode_11ac_vht80 = 10,
  15050. htt_phy_mode_11ac_vht20_2g = 11,
  15051. htt_phy_mode_11ac_vht40_2g = 12,
  15052. htt_phy_mode_11ac_vht80_2g = 13,
  15053. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  15054. htt_phy_mode_11ac_vht160 = 15,
  15055. htt_phy_mode_max,
  15056. };
  15057. /**
  15058. * @brief target -> host HTT channel change indication
  15059. *
  15060. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  15061. *
  15062. * @details
  15063. * Specify when a channel change occurs.
  15064. * This allows the host to precisely determine which rx frames arrived
  15065. * on the old channel and which rx frames arrived on the new channel.
  15066. *
  15067. *|31 |7 0 |
  15068. *|-------------------------------------------+----------|
  15069. *| reserved | msg type |
  15070. *|------------------------------------------------------|
  15071. *| primary_chan_center_freq_mhz |
  15072. *|------------------------------------------------------|
  15073. *| contiguous_chan1_center_freq_mhz |
  15074. *|------------------------------------------------------|
  15075. *| contiguous_chan2_center_freq_mhz |
  15076. *|------------------------------------------------------|
  15077. *| phy_mode |
  15078. *|------------------------------------------------------|
  15079. *
  15080. * Header fields:
  15081. * - MSG_TYPE
  15082. * Bits 7:0
  15083. * Purpose: identifies this as a htt channel change indication message
  15084. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  15085. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  15086. * Bits 31:0
  15087. * Purpose: identify the (center of the) new 20 MHz primary channel
  15088. * Value: center frequency of the 20 MHz primary channel, in MHz units
  15089. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  15090. * Bits 31:0
  15091. * Purpose: identify the (center of the) contiguous frequency range
  15092. * comprising the new channel.
  15093. * For example, if the new channel is a 80 MHz channel extending
  15094. * 60 MHz beyond the primary channel, this field would be 30 larger
  15095. * than the primary channel center frequency field.
  15096. * Value: center frequency of the contiguous frequency range comprising
  15097. * the full channel in MHz units
  15098. * (80+80 channels also use the CONTIG_CHAN2 field)
  15099. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  15100. * Bits 31:0
  15101. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  15102. * within a VHT 80+80 channel.
  15103. * This field is only relevant for VHT 80+80 channels.
  15104. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  15105. * channel (arbitrary value for cases besides VHT 80+80)
  15106. * - PHY_MODE
  15107. * Bits 31:0
  15108. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  15109. * and band
  15110. * Value: htt_phy_mode enum value
  15111. */
  15112. PREPACK struct htt_chan_change_t
  15113. {
  15114. /* DWORD 0: flags and meta-data */
  15115. A_UINT32
  15116. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15117. reserved1: 24;
  15118. A_UINT32 primary_chan_center_freq_mhz;
  15119. A_UINT32 contig_chan1_center_freq_mhz;
  15120. A_UINT32 contig_chan2_center_freq_mhz;
  15121. A_UINT32 phy_mode;
  15122. } POSTPACK;
  15123. /*
  15124. * Due to historical / backwards-compatibility reasons, maintain the
  15125. * below htt_chan_change_msg struct definition, which needs to be
  15126. * consistent with the above htt_chan_change_t struct definition
  15127. * (aside from the htt_chan_change_t definition including the msg_type
  15128. * dword within the message, and the htt_chan_change_msg only containing
  15129. * the payload of the message that follows the msg_type dword).
  15130. */
  15131. PREPACK struct htt_chan_change_msg {
  15132. A_UINT32 chan_mhz; /* frequency in mhz */
  15133. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  15134. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  15135. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  15136. } POSTPACK;
  15137. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  15138. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  15139. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  15140. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  15141. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  15142. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  15143. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  15144. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  15145. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  15146. do { \
  15147. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  15148. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  15149. } while (0)
  15150. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  15151. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  15152. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  15153. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  15154. do { \
  15155. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  15156. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  15157. } while (0)
  15158. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  15159. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  15160. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  15161. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  15162. do { \
  15163. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  15164. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  15165. } while (0)
  15166. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  15167. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  15168. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  15169. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  15170. do { \
  15171. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  15172. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  15173. } while (0)
  15174. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  15175. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  15176. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  15177. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  15178. /**
  15179. * @brief rx offload packet error message
  15180. *
  15181. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  15182. *
  15183. * @details
  15184. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  15185. * of target payload like mic err.
  15186. *
  15187. * |31 24|23 16|15 8|7 0|
  15188. * |----------------+----------------+----------------+----------------|
  15189. * | tid | vdev_id | msg_sub_type | msg_type |
  15190. * |-------------------------------------------------------------------|
  15191. * : (sub-type dependent content) :
  15192. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15193. * Header fields:
  15194. * - msg_type
  15195. * Bits 7:0
  15196. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  15197. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  15198. * - msg_sub_type
  15199. * Bits 15:8
  15200. * Purpose: Identifies which type of rx error is reported by this message
  15201. * value: htt_rx_ofld_pkt_err_type
  15202. * - vdev_id
  15203. * Bits 23:16
  15204. * Purpose: Identifies which vdev received the erroneous rx frame
  15205. * value:
  15206. * - tid
  15207. * Bits 31:24
  15208. * Purpose: Identifies the traffic type of the rx frame
  15209. * value:
  15210. *
  15211. * - The payload fields used if the sub-type == MIC error are shown below.
  15212. * Note - MIC err is per MSDU, while PN is per MPDU.
  15213. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  15214. * with MIC err in A-MSDU case, so FW will send only one HTT message
  15215. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  15216. * instead of sending separate HTT messages for each wrong MSDU within
  15217. * the MPDU.
  15218. *
  15219. * |31 24|23 16|15 8|7 0|
  15220. * |----------------+----------------+----------------+----------------|
  15221. * | Rsvd | key_id | peer_id |
  15222. * |-------------------------------------------------------------------|
  15223. * | receiver MAC addr 31:0 |
  15224. * |-------------------------------------------------------------------|
  15225. * | Rsvd | receiver MAC addr 47:32 |
  15226. * |-------------------------------------------------------------------|
  15227. * | transmitter MAC addr 31:0 |
  15228. * |-------------------------------------------------------------------|
  15229. * | Rsvd | transmitter MAC addr 47:32 |
  15230. * |-------------------------------------------------------------------|
  15231. * | PN 31:0 |
  15232. * |-------------------------------------------------------------------|
  15233. * | Rsvd | PN 47:32 |
  15234. * |-------------------------------------------------------------------|
  15235. * - peer_id
  15236. * Bits 15:0
  15237. * Purpose: identifies which peer is frame is from
  15238. * value:
  15239. * - key_id
  15240. * Bits 23:16
  15241. * Purpose: identifies key_id of rx frame
  15242. * value:
  15243. * - RA_31_0 (receiver MAC addr 31:0)
  15244. * Bits 31:0
  15245. * Purpose: identifies by MAC address which vdev received the frame
  15246. * value: MAC address lower 4 bytes
  15247. * - RA_47_32 (receiver MAC addr 47:32)
  15248. * Bits 15:0
  15249. * Purpose: identifies by MAC address which vdev received the frame
  15250. * value: MAC address upper 2 bytes
  15251. * - TA_31_0 (transmitter MAC addr 31:0)
  15252. * Bits 31:0
  15253. * Purpose: identifies by MAC address which peer transmitted the frame
  15254. * value: MAC address lower 4 bytes
  15255. * - TA_47_32 (transmitter MAC addr 47:32)
  15256. * Bits 15:0
  15257. * Purpose: identifies by MAC address which peer transmitted the frame
  15258. * value: MAC address upper 2 bytes
  15259. * - PN_31_0
  15260. * Bits 31:0
  15261. * Purpose: Identifies pn of rx frame
  15262. * value: PN lower 4 bytes
  15263. * - PN_47_32
  15264. * Bits 15:0
  15265. * Purpose: Identifies pn of rx frame
  15266. * value:
  15267. * TKIP or CCMP: PN upper 2 bytes
  15268. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  15269. */
  15270. enum htt_rx_ofld_pkt_err_type {
  15271. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  15272. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  15273. };
  15274. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  15275. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  15276. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  15277. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  15278. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  15279. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  15280. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  15281. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  15282. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  15283. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  15284. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  15285. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  15286. do { \
  15287. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  15288. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  15289. } while (0)
  15290. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  15291. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  15292. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  15293. do { \
  15294. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  15295. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  15296. } while (0)
  15297. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  15298. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  15299. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  15300. do { \
  15301. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  15302. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  15303. } while (0)
  15304. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  15305. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  15306. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  15307. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  15308. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  15309. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  15310. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  15311. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  15312. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  15313. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  15314. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  15315. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  15316. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  15317. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  15318. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  15319. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  15320. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  15321. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  15322. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  15323. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  15324. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  15325. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  15326. do { \
  15327. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  15328. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  15329. } while (0)
  15330. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  15331. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  15332. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  15333. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  15334. do { \
  15335. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  15336. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  15337. } while (0)
  15338. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  15339. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  15340. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  15341. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  15342. do { \
  15343. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  15344. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  15345. } while (0)
  15346. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  15347. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  15348. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  15349. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  15350. do { \
  15351. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  15352. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  15353. } while (0)
  15354. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  15355. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  15356. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  15357. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  15358. do { \
  15359. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  15360. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  15361. } while (0)
  15362. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  15363. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  15364. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  15365. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  15366. do { \
  15367. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  15368. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  15369. } while (0)
  15370. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  15371. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  15372. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  15373. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  15374. do { \
  15375. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  15376. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  15377. } while (0)
  15378. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  15379. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  15380. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  15381. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  15382. do { \
  15383. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  15384. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  15385. } while (0)
  15386. /**
  15387. * @brief target -> host peer rate report message
  15388. *
  15389. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  15390. *
  15391. * @details
  15392. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  15393. * justified rate of all the peers.
  15394. *
  15395. * |31 24|23 16|15 8|7 0|
  15396. * |----------------+----------------+----------------+----------------|
  15397. * | peer_count | | msg_type |
  15398. * |-------------------------------------------------------------------|
  15399. * : Payload (variant number of peer rate report) :
  15400. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15401. * Header fields:
  15402. * - msg_type
  15403. * Bits 7:0
  15404. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  15405. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  15406. * - reserved
  15407. * Bits 15:8
  15408. * Purpose:
  15409. * value:
  15410. * - peer_count
  15411. * Bits 31:16
  15412. * Purpose: Specify how many peer rate report elements are present in the payload.
  15413. * value:
  15414. *
  15415. * Payload:
  15416. * There are variant number of peer rate report follow the first 32 bits.
  15417. * The peer rate report is defined as follows.
  15418. *
  15419. * |31 20|19 16|15 0|
  15420. * |-----------------------+---------+---------------------------------|-
  15421. * | reserved | phy | peer_id | \
  15422. * |-------------------------------------------------------------------| -> report #0
  15423. * | rate | /
  15424. * |-----------------------+---------+---------------------------------|-
  15425. * | reserved | phy | peer_id | \
  15426. * |-------------------------------------------------------------------| -> report #1
  15427. * | rate | /
  15428. * |-----------------------+---------+---------------------------------|-
  15429. * | reserved | phy | peer_id | \
  15430. * |-------------------------------------------------------------------| -> report #2
  15431. * | rate | /
  15432. * |-------------------------------------------------------------------|-
  15433. * : :
  15434. * : :
  15435. * : :
  15436. * :-------------------------------------------------------------------:
  15437. *
  15438. * - peer_id
  15439. * Bits 15:0
  15440. * Purpose: identify the peer
  15441. * value:
  15442. * - phy
  15443. * Bits 19:16
  15444. * Purpose: identify which phy is in use
  15445. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  15446. * Please see enum htt_peer_report_phy_type for detail.
  15447. * - reserved
  15448. * Bits 31:20
  15449. * Purpose:
  15450. * value:
  15451. * - rate
  15452. * Bits 31:0
  15453. * Purpose: represent the justified rate of the peer specified by peer_id
  15454. * value:
  15455. */
  15456. enum htt_peer_rate_report_phy_type {
  15457. HTT_PEER_RATE_REPORT_11B = 0,
  15458. HTT_PEER_RATE_REPORT_11A_G,
  15459. HTT_PEER_RATE_REPORT_11N,
  15460. HTT_PEER_RATE_REPORT_11AC,
  15461. };
  15462. #define HTT_PEER_RATE_REPORT_SIZE 8
  15463. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  15464. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  15465. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  15466. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  15467. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  15468. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  15469. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  15470. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  15471. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  15472. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  15473. do { \
  15474. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  15475. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  15476. } while (0)
  15477. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  15478. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  15479. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  15480. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  15481. do { \
  15482. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  15483. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  15484. } while (0)
  15485. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  15486. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  15487. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  15488. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  15489. do { \
  15490. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  15491. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  15492. } while (0)
  15493. /**
  15494. * @brief target -> host flow pool map message
  15495. *
  15496. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  15497. *
  15498. * @details
  15499. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  15500. * a flow of descriptors.
  15501. *
  15502. * This message is in TLV format and indicates the parameters to be setup a
  15503. * flow in the host. Each entry indicates that a particular flow ID is ready to
  15504. * receive descriptors from a specified pool.
  15505. *
  15506. * The message would appear as follows:
  15507. *
  15508. * |31 24|23 16|15 8|7 0|
  15509. * |----------------+----------------+----------------+----------------|
  15510. * header | reserved | num_flows | msg_type |
  15511. * |-------------------------------------------------------------------|
  15512. * | |
  15513. * : payload :
  15514. * | |
  15515. * |-------------------------------------------------------------------|
  15516. *
  15517. * The header field is one DWORD long and is interpreted as follows:
  15518. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  15519. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  15520. * this message
  15521. * b'16-31 - reserved: These bits are reserved for future use
  15522. *
  15523. * Payload:
  15524. * The payload would contain multiple objects of the following structure. Each
  15525. * object represents a flow.
  15526. *
  15527. * |31 24|23 16|15 8|7 0|
  15528. * |----------------+----------------+----------------+----------------|
  15529. * header | reserved | num_flows | msg_type |
  15530. * |-------------------------------------------------------------------|
  15531. * payload0| flow_type |
  15532. * |-------------------------------------------------------------------|
  15533. * | flow_id |
  15534. * |-------------------------------------------------------------------|
  15535. * | reserved0 | flow_pool_id |
  15536. * |-------------------------------------------------------------------|
  15537. * | reserved1 | flow_pool_size |
  15538. * |-------------------------------------------------------------------|
  15539. * | reserved2 |
  15540. * |-------------------------------------------------------------------|
  15541. * payload1| flow_type |
  15542. * |-------------------------------------------------------------------|
  15543. * | flow_id |
  15544. * |-------------------------------------------------------------------|
  15545. * | reserved0 | flow_pool_id |
  15546. * |-------------------------------------------------------------------|
  15547. * | reserved1 | flow_pool_size |
  15548. * |-------------------------------------------------------------------|
  15549. * | reserved2 |
  15550. * |-------------------------------------------------------------------|
  15551. * | . |
  15552. * | . |
  15553. * | . |
  15554. * |-------------------------------------------------------------------|
  15555. *
  15556. * Each payload is 5 DWORDS long and is interpreted as follows:
  15557. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  15558. * this flow is associated. It can be VDEV, peer,
  15559. * or tid (AC). Based on enum htt_flow_type.
  15560. *
  15561. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15562. * object. For flow_type vdev it is set to the
  15563. * vdevid, for peer it is peerid and for tid, it is
  15564. * tid_num.
  15565. *
  15566. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  15567. * in the host for this flow
  15568. * b'16:31 - reserved0: This field in reserved for the future. In case
  15569. * we have a hierarchical implementation (HCM) of
  15570. * pools, it can be used to indicate the ID of the
  15571. * parent-pool.
  15572. *
  15573. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  15574. * Descriptors for this flow will be
  15575. * allocated from this pool in the host.
  15576. * b'16:31 - reserved1: This field in reserved for the future. In case
  15577. * we have a hierarchical implementation of pools,
  15578. * it can be used to indicate the max number of
  15579. * descriptors in the pool. The b'0:15 can be used
  15580. * to indicate min number of descriptors in the
  15581. * HCM scheme.
  15582. *
  15583. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  15584. * we have a hierarchical implementation of pools,
  15585. * b'0:15 can be used to indicate the
  15586. * priority-based borrowing (PBB) threshold of
  15587. * the flow's pool. The b'16:31 are still left
  15588. * reserved.
  15589. */
  15590. enum htt_flow_type {
  15591. FLOW_TYPE_VDEV = 0,
  15592. /* Insert new flow types above this line */
  15593. };
  15594. PREPACK struct htt_flow_pool_map_payload_t {
  15595. A_UINT32 flow_type;
  15596. A_UINT32 flow_id;
  15597. A_UINT32 flow_pool_id:16,
  15598. reserved0:16;
  15599. A_UINT32 flow_pool_size:16,
  15600. reserved1:16;
  15601. A_UINT32 reserved2;
  15602. } POSTPACK;
  15603. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  15604. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  15605. (sizeof(struct htt_flow_pool_map_payload_t))
  15606. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  15607. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  15608. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  15609. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  15610. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  15611. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  15612. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  15613. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  15614. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  15615. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  15616. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  15617. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  15618. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  15619. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  15620. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  15621. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  15622. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  15623. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  15624. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  15625. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  15626. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  15627. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  15628. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  15629. do { \
  15630. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  15631. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  15632. } while (0)
  15633. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  15634. do { \
  15635. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  15636. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  15637. } while (0)
  15638. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  15639. do { \
  15640. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  15641. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  15642. } while (0)
  15643. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  15644. do { \
  15645. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  15646. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  15647. } while (0)
  15648. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  15649. do { \
  15650. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  15651. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  15652. } while (0)
  15653. /**
  15654. * @brief target -> host flow pool unmap message
  15655. *
  15656. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  15657. *
  15658. * @details
  15659. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  15660. * down a flow of descriptors.
  15661. * This message indicates that for the flow (whose ID is provided) is wanting
  15662. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  15663. * pool of descriptors from where descriptors are being allocated for this
  15664. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  15665. * be unmapped by the host.
  15666. *
  15667. * The message would appear as follows:
  15668. *
  15669. * |31 24|23 16|15 8|7 0|
  15670. * |----------------+----------------+----------------+----------------|
  15671. * | reserved0 | msg_type |
  15672. * |-------------------------------------------------------------------|
  15673. * | flow_type |
  15674. * |-------------------------------------------------------------------|
  15675. * | flow_id |
  15676. * |-------------------------------------------------------------------|
  15677. * | reserved1 | flow_pool_id |
  15678. * |-------------------------------------------------------------------|
  15679. *
  15680. * The message is interpreted as follows:
  15681. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  15682. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  15683. * b'8:31 - reserved0: Reserved for future use
  15684. *
  15685. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  15686. * this flow is associated. It can be VDEV, peer,
  15687. * or tid (AC). Based on enum htt_flow_type.
  15688. *
  15689. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15690. * object. For flow_type vdev it is set to the
  15691. * vdevid, for peer it is peerid and for tid, it is
  15692. * tid_num.
  15693. *
  15694. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  15695. * used in the host for this flow
  15696. * b'16:31 - reserved0: This field in reserved for the future.
  15697. *
  15698. */
  15699. PREPACK struct htt_flow_pool_unmap_t {
  15700. A_UINT32 msg_type:8,
  15701. reserved0:24;
  15702. A_UINT32 flow_type;
  15703. A_UINT32 flow_id;
  15704. A_UINT32 flow_pool_id:16,
  15705. reserved1:16;
  15706. } POSTPACK;
  15707. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  15708. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  15709. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  15710. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  15711. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  15712. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  15713. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  15714. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  15715. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  15716. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  15717. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  15718. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  15719. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  15720. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  15721. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  15722. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  15723. do { \
  15724. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  15725. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  15726. } while (0)
  15727. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  15728. do { \
  15729. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  15730. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  15731. } while (0)
  15732. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  15733. do { \
  15734. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  15735. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  15736. } while (0)
  15737. /**
  15738. * @brief target -> host SRING setup done message
  15739. *
  15740. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  15741. *
  15742. * @details
  15743. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  15744. * SRNG ring setup is done
  15745. *
  15746. * This message indicates whether the last setup operation is successful.
  15747. * It will be sent to host when host set respose_required bit in
  15748. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  15749. * The message would appear as follows:
  15750. *
  15751. * |31 24|23 16|15 8|7 0|
  15752. * |--------------- +----------------+----------------+----------------|
  15753. * | setup_status | ring_id | pdev_id | msg_type |
  15754. * |-------------------------------------------------------------------|
  15755. *
  15756. * The message is interpreted as follows:
  15757. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  15758. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  15759. * b'8:15 - pdev_id:
  15760. * 0 (for rings at SOC/UMAC level),
  15761. * 1/2/3 mac id (for rings at LMAC level)
  15762. * b'16:23 - ring_id: Identify the ring which is set up
  15763. * More details can be got from enum htt_srng_ring_id
  15764. * b'24:31 - setup_status: Indicate status of setup operation
  15765. * Refer to htt_ring_setup_status
  15766. */
  15767. PREPACK struct htt_sring_setup_done_t {
  15768. A_UINT32 msg_type: 8,
  15769. pdev_id: 8,
  15770. ring_id: 8,
  15771. setup_status: 8;
  15772. } POSTPACK;
  15773. enum htt_ring_setup_status {
  15774. htt_ring_setup_status_ok = 0,
  15775. htt_ring_setup_status_error,
  15776. };
  15777. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  15778. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  15779. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  15780. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  15781. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  15782. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  15783. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  15784. do { \
  15785. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  15786. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15787. } while (0)
  15788. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  15789. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  15790. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  15791. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  15792. HTT_SRING_SETUP_DONE_RING_ID_S)
  15793. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  15794. do { \
  15795. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  15796. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  15797. } while (0)
  15798. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  15799. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  15800. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  15801. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  15802. HTT_SRING_SETUP_DONE_STATUS_S)
  15803. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  15804. do { \
  15805. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  15806. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  15807. } while (0)
  15808. /**
  15809. * @brief target -> flow map flow info
  15810. *
  15811. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  15812. *
  15813. * @details
  15814. * HTT TX map flow entry with tqm flow pointer
  15815. * Sent from firmware to host to add tqm flow pointer in corresponding
  15816. * flow search entry. Flow metadata is replayed back to host as part of this
  15817. * struct to enable host to find the specific flow search entry
  15818. *
  15819. * The message would appear as follows:
  15820. *
  15821. * |31 28|27 18|17 14|13 8|7 0|
  15822. * |-------+------------------------------------------+----------------|
  15823. * | rsvd0 | fse_hsh_idx | msg_type |
  15824. * |-------------------------------------------------------------------|
  15825. * | rsvd1 | tid | peer_id |
  15826. * |-------------------------------------------------------------------|
  15827. * | tqm_flow_pntr_lo |
  15828. * |-------------------------------------------------------------------|
  15829. * | tqm_flow_pntr_hi |
  15830. * |-------------------------------------------------------------------|
  15831. * | fse_meta_data |
  15832. * |-------------------------------------------------------------------|
  15833. *
  15834. * The message is interpreted as follows:
  15835. *
  15836. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  15837. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  15838. *
  15839. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  15840. * for this flow entry
  15841. *
  15842. * dword0 - b'28:31 - rsvd0: Reserved for future use
  15843. *
  15844. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  15845. *
  15846. * dword1 - b'14:17 - tid
  15847. *
  15848. * dword1 - b'18:31 - rsvd1: Reserved for future use
  15849. *
  15850. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  15851. *
  15852. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  15853. *
  15854. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  15855. * given by host
  15856. */
  15857. PREPACK struct htt_tx_map_flow_info {
  15858. A_UINT32
  15859. msg_type: 8,
  15860. fse_hsh_idx: 20,
  15861. rsvd0: 4;
  15862. A_UINT32
  15863. peer_id: 14,
  15864. tid: 4,
  15865. rsvd1: 14;
  15866. A_UINT32 tqm_flow_pntr_lo;
  15867. A_UINT32 tqm_flow_pntr_hi;
  15868. struct htt_tx_flow_metadata fse_meta_data;
  15869. } POSTPACK;
  15870. /* DWORD 0 */
  15871. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  15872. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  15873. /* DWORD 1 */
  15874. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  15875. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  15876. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  15877. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  15878. /* DWORD 0 */
  15879. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  15880. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  15881. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  15882. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  15883. do { \
  15884. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  15885. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  15886. } while (0)
  15887. /* DWORD 1 */
  15888. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  15889. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  15890. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  15891. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  15892. do { \
  15893. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  15894. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  15895. } while (0)
  15896. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  15897. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  15898. HTT_TX_MAP_FLOW_INFO_TID_S)
  15899. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  15900. do { \
  15901. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  15902. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  15903. } while (0)
  15904. /*
  15905. * htt_dbg_ext_stats_status -
  15906. * present - The requested stats have been delivered in full.
  15907. * This indicates that either the stats information was contained
  15908. * in its entirety within this message, or else this message
  15909. * completes the delivery of the requested stats info that was
  15910. * partially delivered through earlier STATS_CONF messages.
  15911. * partial - The requested stats have been delivered in part.
  15912. * One or more subsequent STATS_CONF messages with the same
  15913. * cookie value will be sent to deliver the remainder of the
  15914. * information.
  15915. * error - The requested stats could not be delivered, for example due
  15916. * to a shortage of memory to construct a message holding the
  15917. * requested stats.
  15918. * invalid - The requested stat type is either not recognized, or the
  15919. * target is configured to not gather the stats type in question.
  15920. */
  15921. enum htt_dbg_ext_stats_status {
  15922. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15923. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15924. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15925. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15926. };
  15927. /**
  15928. * @brief target -> host ppdu stats upload
  15929. *
  15930. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15931. *
  15932. * @details
  15933. * The following field definitions describe the format of the HTT target
  15934. * to host ppdu stats indication message.
  15935. *
  15936. *
  15937. * |31 16|15 12|11 10|9 8|7 0 |
  15938. * |----------------------------------------------------------------------|
  15939. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15940. * |----------------------------------------------------------------------|
  15941. * | ppdu_id |
  15942. * |----------------------------------------------------------------------|
  15943. * | Timestamp in us |
  15944. * |----------------------------------------------------------------------|
  15945. * | reserved |
  15946. * |----------------------------------------------------------------------|
  15947. * | type-specific stats info |
  15948. * | (see htt_ppdu_stats.h) |
  15949. * |----------------------------------------------------------------------|
  15950. * Header fields:
  15951. * - MSG_TYPE
  15952. * Bits 7:0
  15953. * Purpose: Identifies this is a PPDU STATS indication
  15954. * message.
  15955. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15956. * - mac_id
  15957. * Bits 9:8
  15958. * Purpose: mac_id of this ppdu_id
  15959. * Value: 0-3
  15960. * - pdev_id
  15961. * Bits 11:10
  15962. * Purpose: pdev_id of this ppdu_id
  15963. * Value: 0-3
  15964. * 0 (for rings at SOC level),
  15965. * 1/2/3 PDEV -> 0/1/2
  15966. * - payload_size
  15967. * Bits 31:16
  15968. * Purpose: total tlv size
  15969. * Value: payload_size in bytes
  15970. */
  15971. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15972. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15973. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15974. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15975. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15976. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15977. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15978. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15979. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15980. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15981. do { \
  15982. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15983. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15984. } while (0)
  15985. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15986. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15987. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15988. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15989. do { \
  15990. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15991. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15992. } while (0)
  15993. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15994. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15995. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15996. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15997. do { \
  15998. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  15999. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  16000. } while (0)
  16001. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  16002. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  16003. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  16004. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  16005. do { \
  16006. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  16007. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  16008. } while (0)
  16009. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  16010. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  16011. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  16012. /* htt_t2h_ppdu_stats_ind_hdr_t
  16013. * This struct contains the fields within the header of the
  16014. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  16015. * stats info.
  16016. * This struct assumes little-endian layout, and thus is only
  16017. * suitable for use within processors known to be little-endian
  16018. * (such as the target).
  16019. * In contrast, the above macros provide endian-portable methods
  16020. * to get and set the bitfields within this PPDU_STATS_IND header.
  16021. */
  16022. typedef struct {
  16023. A_UINT32 msg_type: 8, /* bits 7:0 */
  16024. mac_id: 2, /* bits 9:8 */
  16025. pdev_id: 2, /* bits 11:10 */
  16026. reserved1: 4, /* bits 15:12 */
  16027. payload_size: 16; /* bits 31:16 */
  16028. A_UINT32 ppdu_id;
  16029. A_UINT32 timestamp_us;
  16030. A_UINT32 reserved2;
  16031. } htt_t2h_ppdu_stats_ind_hdr_t;
  16032. /**
  16033. * @brief target -> host extended statistics upload
  16034. *
  16035. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  16036. *
  16037. * @details
  16038. * The following field definitions describe the format of the HTT target
  16039. * to host stats upload confirmation message.
  16040. * The message contains a cookie echoed from the HTT host->target stats
  16041. * upload request, which identifies which request the confirmation is
  16042. * for, and a single stats can span over multiple HTT stats indication
  16043. * due to the HTT message size limitation so every HTT ext stats indication
  16044. * will have tag-length-value stats information elements.
  16045. * The tag-length header for each HTT stats IND message also includes a
  16046. * status field, to indicate whether the request for the stat type in
  16047. * question was fully met, partially met, unable to be met, or invalid
  16048. * (if the stat type in question is disabled in the target).
  16049. * A Done bit 1's indicate the end of the of stats info elements.
  16050. *
  16051. *
  16052. * |31 16|15 12|11|10 8|7 5|4 0|
  16053. * |--------------------------------------------------------------|
  16054. * | reserved | msg type |
  16055. * |--------------------------------------------------------------|
  16056. * | cookie LSBs |
  16057. * |--------------------------------------------------------------|
  16058. * | cookie MSBs |
  16059. * |--------------------------------------------------------------|
  16060. * | stats entry length | rsvd | D| S | stat type |
  16061. * |--------------------------------------------------------------|
  16062. * | type-specific stats info |
  16063. * | (see htt_stats.h) |
  16064. * |--------------------------------------------------------------|
  16065. * Header fields:
  16066. * - MSG_TYPE
  16067. * Bits 7:0
  16068. * Purpose: Identifies this is a extended statistics upload confirmation
  16069. * message.
  16070. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  16071. * - COOKIE_LSBS
  16072. * Bits 31:0
  16073. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16074. * message with its preceding host->target stats request message.
  16075. * Value: LSBs of the opaque cookie specified by the host-side requestor
  16076. * - COOKIE_MSBS
  16077. * Bits 31:0
  16078. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16079. * message with its preceding host->target stats request message.
  16080. * Value: MSBs of the opaque cookie specified by the host-side requestor
  16081. *
  16082. * Stats Information Element tag-length header fields:
  16083. * - STAT_TYPE
  16084. * Bits 7:0
  16085. * Purpose: identifies the type of statistics info held in the
  16086. * following information element
  16087. * Value: htt_dbg_ext_stats_type
  16088. * - STATUS
  16089. * Bits 10:8
  16090. * Purpose: indicate whether the requested stats are present
  16091. * Value: htt_dbg_ext_stats_status
  16092. * - DONE
  16093. * Bits 11
  16094. * Purpose:
  16095. * Indicates the completion of the stats entry, this will be the last
  16096. * stats conf HTT segment for the requested stats type.
  16097. * Value:
  16098. * 0 -> the stats retrieval is ongoing
  16099. * 1 -> the stats retrieval is complete
  16100. * - LENGTH
  16101. * Bits 31:16
  16102. * Purpose: indicate the stats information size
  16103. * Value: This field specifies the number of bytes of stats information
  16104. * that follows the element tag-length header.
  16105. * It is expected but not required that this length is a multiple of
  16106. * 4 bytes.
  16107. */
  16108. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  16109. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  16110. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  16111. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  16112. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  16113. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  16114. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  16115. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  16116. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  16117. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  16118. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  16119. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  16120. do { \
  16121. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  16122. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  16123. } while (0)
  16124. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  16125. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  16126. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  16127. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  16128. do { \
  16129. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  16130. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  16131. } while (0)
  16132. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  16133. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  16134. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  16135. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  16136. do { \
  16137. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  16138. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  16139. } while (0)
  16140. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  16141. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  16142. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  16143. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  16144. do { \
  16145. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  16146. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  16147. } while (0)
  16148. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  16149. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  16150. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  16151. /**
  16152. * @brief target -> host streaming statistics upload
  16153. *
  16154. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  16155. *
  16156. * @details
  16157. * The following field definitions describe the format of the HTT target
  16158. * to host streaming stats upload indication message.
  16159. * The host can use a STREAMING_STATS_REQ message to enable the target to
  16160. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  16161. * use the STREAMING_STATS_REQ message to halt the target's production of
  16162. * STREAMING_STATS_IND messages.
  16163. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  16164. * the stats enabled by the host's STREAMING_STATS_REQ message.
  16165. *
  16166. * |31 8|7 0|
  16167. * |--------------------------------------------------------------|
  16168. * | reserved | msg type |
  16169. * |--------------------------------------------------------------|
  16170. * | type-specific stats info |
  16171. * | (see htt_stats.h) |
  16172. * |--------------------------------------------------------------|
  16173. * Header fields:
  16174. * - MSG_TYPE
  16175. * Bits 7:0
  16176. * Purpose: Identifies this as a streaming statistics upload indication
  16177. * message.
  16178. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  16179. */
  16180. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  16181. typedef enum {
  16182. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  16183. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  16184. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  16185. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  16186. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  16187. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  16188. /* Reserved from 128 - 255 for target internal use.*/
  16189. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  16190. } HTT_PEER_TYPE;
  16191. /** macro to convert MAC address from char array to HTT word format */
  16192. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  16193. (phtt_mac_addr)->mac_addr31to0 = \
  16194. (((c_macaddr)[0] << 0) | \
  16195. ((c_macaddr)[1] << 8) | \
  16196. ((c_macaddr)[2] << 16) | \
  16197. ((c_macaddr)[3] << 24)); \
  16198. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  16199. } while (0)
  16200. /**
  16201. * @brief target -> host monitor mac header indication message
  16202. *
  16203. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  16204. *
  16205. * @details
  16206. * The following diagram shows the format of the monitor mac header message
  16207. * sent from the target to the host.
  16208. * This message is primarily sent when promiscuous rx mode is enabled.
  16209. * One message is sent per rx PPDU.
  16210. *
  16211. * |31 24|23 16|15 8|7 0|
  16212. * |-------------------------------------------------------------|
  16213. * | peer_id | reserved0 | msg_type |
  16214. * |-------------------------------------------------------------|
  16215. * | reserved1 | num_mpdu |
  16216. * |-------------------------------------------------------------|
  16217. * | struct hw_rx_desc |
  16218. * | (see wal_rx_desc.h) |
  16219. * |-------------------------------------------------------------|
  16220. * | struct ieee80211_frame_addr4 |
  16221. * | (see ieee80211_defs.h) |
  16222. * |-------------------------------------------------------------|
  16223. * | struct ieee80211_frame_addr4 |
  16224. * | (see ieee80211_defs.h) |
  16225. * |-------------------------------------------------------------|
  16226. * | ...... |
  16227. * |-------------------------------------------------------------|
  16228. *
  16229. * Header fields:
  16230. * - msg_type
  16231. * Bits 7:0
  16232. * Purpose: Identifies this is a monitor mac header indication message.
  16233. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  16234. * - peer_id
  16235. * Bits 31:16
  16236. * Purpose: Software peer id given by host during association,
  16237. * During promiscuous mode, the peer ID will be invalid (0xFF)
  16238. * for rx PPDUs received from unassociated peers.
  16239. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  16240. * - num_mpdu
  16241. * Bits 15:0
  16242. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  16243. * delivered within the message.
  16244. * Value: 1 to 32
  16245. * num_mpdu is limited to a maximum value of 32, due to buffer
  16246. * size limits. For PPDUs with more than 32 MPDUs, only the
  16247. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  16248. * the PPDU will be provided.
  16249. */
  16250. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  16251. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  16252. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  16253. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  16254. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  16255. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  16256. do { \
  16257. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  16258. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  16259. } while (0)
  16260. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  16261. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  16262. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  16263. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  16264. do { \
  16265. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  16266. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  16267. } while (0)
  16268. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  16269. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  16270. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  16271. /**
  16272. * @brief target -> host flow pool resize Message
  16273. *
  16274. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  16275. *
  16276. * @details
  16277. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  16278. * the flow pool associated with the specified ID is resized
  16279. *
  16280. * The message would appear as follows:
  16281. *
  16282. * |31 16|15 8|7 0|
  16283. * |---------------------------------+----------------+----------------|
  16284. * | reserved0 | Msg type |
  16285. * |-------------------------------------------------------------------|
  16286. * | flow pool new size | flow pool ID |
  16287. * |-------------------------------------------------------------------|
  16288. *
  16289. * The message is interpreted as follows:
  16290. * b'0:7 - msg_type: This will be set to 0x21
  16291. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  16292. *
  16293. * b'0:15 - flow pool ID: Existing flow pool ID
  16294. *
  16295. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  16296. *
  16297. */
  16298. PREPACK struct htt_flow_pool_resize_t {
  16299. A_UINT32 msg_type:8,
  16300. reserved0:24;
  16301. A_UINT32 flow_pool_id:16,
  16302. flow_pool_new_size:16;
  16303. } POSTPACK;
  16304. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  16305. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  16306. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  16307. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  16308. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  16309. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  16310. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  16311. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  16312. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  16313. do { \
  16314. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  16315. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  16316. } while (0)
  16317. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  16318. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  16319. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  16320. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  16321. do { \
  16322. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  16323. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  16324. } while (0)
  16325. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  16326. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  16327. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  16328. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  16329. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  16330. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  16331. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  16332. /*
  16333. * The read and write indices point to the data within the host buffer.
  16334. * Because the first 4 bytes of the host buffer is used for the read index and
  16335. * the next 4 bytes for the write index, the data itself starts at offset 8.
  16336. * The read index and write index are the byte offsets from the base of the
  16337. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  16338. * Refer the ASCII text picture below.
  16339. */
  16340. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  16341. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  16342. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  16343. /*
  16344. ***************************************************************************
  16345. *
  16346. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16347. *
  16348. ***************************************************************************
  16349. *
  16350. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  16351. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  16352. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  16353. * written into the Host memory region mentioned below.
  16354. *
  16355. * Read index is updated by the Host. At any point of time, the read index will
  16356. * indicate the index that will next be read by the Host. The read index is
  16357. * in units of bytes offset from the base of the meta-data buffer.
  16358. *
  16359. * Write index is updated by the FW. At any point of time, the write index will
  16360. * indicate from where the FW can start writing any new data. The write index is
  16361. * in units of bytes offset from the base of the meta-data buffer.
  16362. *
  16363. * If the Host is not fast enough in reading the CFR data, any new capture data
  16364. * would be dropped if there is no space left to write the new captures.
  16365. *
  16366. * The last 4 bytes of the memory region will have the magic pattern
  16367. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  16368. * not overrun the host buffer.
  16369. *
  16370. * ,--------------------. read and write indices store the
  16371. * | | byte offset from the base of the
  16372. * | ,--------+--------. meta-data buffer to the next
  16373. * | | | | location within the data buffer
  16374. * | | v v that will be read / written
  16375. * ************************************************************************
  16376. * * Read * Write * * Magic *
  16377. * * index * index * CFR data1 ...... CFR data N * pattern *
  16378. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  16379. * ************************************************************************
  16380. * |<---------- data buffer ---------->|
  16381. *
  16382. * |<----------------- meta-data buffer allocated in Host ----------------|
  16383. *
  16384. * Note:
  16385. * - Considering the 4 bytes needed to store the Read index (R) and the
  16386. * Write index (W), the initial value is as follows:
  16387. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  16388. * - Buffer empty condition:
  16389. * R = W
  16390. *
  16391. * Regarding CFR data format:
  16392. * --------------------------
  16393. *
  16394. * Each CFR tone is stored in HW as 16-bits with the following format:
  16395. * {bits[15:12], bits[11:6], bits[5:0]} =
  16396. * {unsigned exponent (4 bits),
  16397. * signed mantissa_real (6 bits),
  16398. * signed mantissa_imag (6 bits)}
  16399. *
  16400. * CFR_real = mantissa_real * 2^(exponent-5)
  16401. * CFR_imag = mantissa_imag * 2^(exponent-5)
  16402. *
  16403. *
  16404. * The CFR data is written to the 16-bit unsigned output array (buff) in
  16405. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  16406. *
  16407. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  16408. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  16409. * .
  16410. * .
  16411. * .
  16412. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  16413. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  16414. */
  16415. /* Bandwidth of peer CFR captures */
  16416. typedef enum {
  16417. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  16418. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  16419. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  16420. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  16421. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  16422. HTT_PEER_CFR_CAPTURE_BW_MAX,
  16423. } HTT_PEER_CFR_CAPTURE_BW;
  16424. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  16425. * was captured
  16426. */
  16427. typedef enum {
  16428. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  16429. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  16430. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  16431. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  16432. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  16433. } HTT_PEER_CFR_CAPTURE_MODE;
  16434. typedef enum {
  16435. /* This message type is currently used for the below purpose:
  16436. *
  16437. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  16438. * wmi_peer_cfr_capture_cmd.
  16439. * If payload_present bit is set to 0 then the associated memory region
  16440. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  16441. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  16442. * message; the CFR dump will be present at the end of the message,
  16443. * after the chan_phy_mode.
  16444. */
  16445. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  16446. /* Always keep this last */
  16447. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  16448. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  16449. /**
  16450. * @brief target -> host CFR dump completion indication message definition
  16451. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  16452. *
  16453. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  16454. *
  16455. * @details
  16456. * The following diagram shows the format of the Channel Frequency Response
  16457. * (CFR) dump completion indication. This inidcation is sent to the Host when
  16458. * the channel capture of a peer is copied by Firmware into the Host memory
  16459. *
  16460. * **************************************************************************
  16461. *
  16462. * Message format when the CFR capture message type is
  16463. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16464. *
  16465. * **************************************************************************
  16466. *
  16467. * |31 16|15 |8|7 0|
  16468. * |----------------------------------------------------------------|
  16469. * header: | reserved |P| msg_type |
  16470. * word 0 | | | |
  16471. * |----------------------------------------------------------------|
  16472. * payload: | cfr_capture_msg_type |
  16473. * word 1 | |
  16474. * |----------------------------------------------------------------|
  16475. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  16476. * word 2 | | | | | | | | |
  16477. * |----------------------------------------------------------------|
  16478. * | mac_addr31to0 |
  16479. * word 3 | |
  16480. * |----------------------------------------------------------------|
  16481. * | unused / reserved | mac_addr47to32 |
  16482. * word 4 | | |
  16483. * |----------------------------------------------------------------|
  16484. * | index |
  16485. * word 5 | |
  16486. * |----------------------------------------------------------------|
  16487. * | length |
  16488. * word 6 | |
  16489. * |----------------------------------------------------------------|
  16490. * | timestamp |
  16491. * word 7 | |
  16492. * |----------------------------------------------------------------|
  16493. * | counter |
  16494. * word 8 | |
  16495. * |----------------------------------------------------------------|
  16496. * | chan_mhz |
  16497. * word 9 | |
  16498. * |----------------------------------------------------------------|
  16499. * | band_center_freq1 |
  16500. * word 10 | |
  16501. * |----------------------------------------------------------------|
  16502. * | band_center_freq2 |
  16503. * word 11 | |
  16504. * |----------------------------------------------------------------|
  16505. * | chan_phy_mode |
  16506. * word 12 | |
  16507. * |----------------------------------------------------------------|
  16508. * where,
  16509. * P - payload present bit (payload_present explained below)
  16510. * req_id - memory request id (mem_req_id explained below)
  16511. * S - status field (status explained below)
  16512. * capbw - capture bandwidth (capture_bw explained below)
  16513. * mode - mode of capture (mode explained below)
  16514. * sts - space time streams (sts_count explained below)
  16515. * chbw - channel bandwidth (channel_bw explained below)
  16516. * captype - capture type (cap_type explained below)
  16517. *
  16518. * The following field definitions describe the format of the CFR dump
  16519. * completion indication sent from the target to the host
  16520. *
  16521. * Header fields:
  16522. *
  16523. * Word 0
  16524. * - msg_type
  16525. * Bits 7:0
  16526. * Purpose: Identifies this as CFR TX completion indication
  16527. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  16528. * - payload_present
  16529. * Bit 8
  16530. * Purpose: Identifies how CFR data is sent to host
  16531. * Value: 0 - If CFR Payload is written to host memory
  16532. * 1 - If CFR Payload is sent as part of HTT message
  16533. * (This is the requirement for SDIO/USB where it is
  16534. * not possible to write CFR data to host memory)
  16535. * - reserved
  16536. * Bits 31:9
  16537. * Purpose: Reserved
  16538. * Value: 0
  16539. *
  16540. * Payload fields:
  16541. *
  16542. * Word 1
  16543. * - cfr_capture_msg_type
  16544. * Bits 31:0
  16545. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  16546. * to specify the format used for the remainder of the message
  16547. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16548. * (currently only MSG_TYPE_1 is defined)
  16549. *
  16550. * Word 2
  16551. * - mem_req_id
  16552. * Bits 6:0
  16553. * Purpose: Contain the mem request id of the region where the CFR capture
  16554. * has been stored - of type WMI_HOST_MEM_REQ_ID
  16555. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  16556. this value is invalid)
  16557. * - status
  16558. * Bit 7
  16559. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  16560. * Value: 1 (True) - Successful; 0 (False) - Not successful
  16561. * - capture_bw
  16562. * Bits 10:8
  16563. * Purpose: Carry the bandwidth of the CFR capture
  16564. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  16565. * - mode
  16566. * Bits 13:11
  16567. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  16568. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  16569. * - sts_count
  16570. * Bits 16:14
  16571. * Purpose: Carry the number of space time streams
  16572. * Value: Number of space time streams
  16573. * - channel_bw
  16574. * Bits 19:17
  16575. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  16576. * measurement
  16577. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  16578. * - cap_type
  16579. * Bits 23:20
  16580. * Purpose: Carry the type of the capture
  16581. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  16582. * - vdev_id
  16583. * Bits 31:24
  16584. * Purpose: Carry the virtual device id
  16585. * Value: vdev ID
  16586. *
  16587. * Word 3
  16588. * - mac_addr31to0
  16589. * Bits 31:0
  16590. * Purpose: Contain the bits 31:0 of the peer MAC address
  16591. * Value: Bits 31:0 of the peer MAC address
  16592. *
  16593. * Word 4
  16594. * - mac_addr47to32
  16595. * Bits 15:0
  16596. * Purpose: Contain the bits 47:32 of the peer MAC address
  16597. * Value: Bits 47:32 of the peer MAC address
  16598. *
  16599. * Word 5
  16600. * - index
  16601. * Bits 31:0
  16602. * Purpose: Contain the index at which this CFR dump was written in the Host
  16603. * allocated memory. This index is the number of bytes from the base address.
  16604. * Value: Index position
  16605. *
  16606. * Word 6
  16607. * - length
  16608. * Bits 31:0
  16609. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  16610. * Value: Length of the CFR capture of the peer
  16611. *
  16612. * Word 7
  16613. * - timestamp
  16614. * Bits 31:0
  16615. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  16616. * clock used for this timestamp is private to the target and not visible to
  16617. * the host i.e., Host can interpret only the relative timestamp deltas from
  16618. * one message to the next, but can't interpret the absolute timestamp from a
  16619. * single message.
  16620. * Value: Timestamp in microseconds
  16621. *
  16622. * Word 8
  16623. * - counter
  16624. * Bits 31:0
  16625. * Purpose: Carry the count of the current CFR capture from FW. This is
  16626. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  16627. * in host memory)
  16628. * Value: Count of the current CFR capture
  16629. *
  16630. * Word 9
  16631. * - chan_mhz
  16632. * Bits 31:0
  16633. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  16634. * Value: Primary 20 channel frequency
  16635. *
  16636. * Word 10
  16637. * - band_center_freq1
  16638. * Bits 31:0
  16639. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  16640. * Value: Center frequency 1 in MHz
  16641. *
  16642. * Word 11
  16643. * - band_center_freq2
  16644. * Bits 31:0
  16645. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  16646. * the VDEV
  16647. * 80plus80 mode
  16648. * Value: Center frequency 2 in MHz
  16649. *
  16650. * Word 12
  16651. * - chan_phy_mode
  16652. * Bits 31:0
  16653. * Purpose: Carry the phy mode of the channel, of the VDEV
  16654. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  16655. */
  16656. PREPACK struct htt_cfr_dump_ind_type_1 {
  16657. A_UINT32 mem_req_id:7,
  16658. status:1,
  16659. capture_bw:3,
  16660. mode:3,
  16661. sts_count:3,
  16662. channel_bw:3,
  16663. cap_type:4,
  16664. vdev_id:8;
  16665. htt_mac_addr addr;
  16666. A_UINT32 index;
  16667. A_UINT32 length;
  16668. A_UINT32 timestamp;
  16669. A_UINT32 counter;
  16670. struct htt_chan_change_msg chan;
  16671. } POSTPACK;
  16672. PREPACK struct htt_cfr_dump_compl_ind {
  16673. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  16674. union {
  16675. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  16676. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  16677. /* If there is a need to change the memory layout and its associated
  16678. * HTT indication format, a new CFR capture message type can be
  16679. * introduced and added into this union.
  16680. */
  16681. };
  16682. } POSTPACK;
  16683. /*
  16684. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  16685. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16686. */
  16687. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  16688. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  16689. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  16690. do { \
  16691. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  16692. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  16693. } while(0)
  16694. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  16695. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  16696. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  16697. /*
  16698. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  16699. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16700. */
  16701. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  16702. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  16703. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  16704. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  16705. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  16706. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  16707. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  16708. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  16709. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  16710. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  16711. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  16712. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  16713. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  16714. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  16715. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  16716. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  16717. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  16718. do { \
  16719. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  16720. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  16721. } while (0)
  16722. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  16723. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  16724. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  16725. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  16726. do { \
  16727. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  16728. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  16729. } while (0)
  16730. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  16731. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  16732. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  16733. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  16734. do { \
  16735. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  16736. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  16737. } while (0)
  16738. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  16739. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  16740. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  16741. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  16742. do { \
  16743. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  16744. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  16745. } while (0)
  16746. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  16747. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  16748. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  16749. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  16750. do { \
  16751. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  16752. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  16753. } while (0)
  16754. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  16755. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  16756. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  16757. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  16758. do { \
  16759. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  16760. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  16761. } while (0)
  16762. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  16763. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  16764. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  16765. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  16766. do { \
  16767. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  16768. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  16769. } while (0)
  16770. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  16771. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  16772. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  16773. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  16774. do { \
  16775. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  16776. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  16777. } while (0)
  16778. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  16779. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  16780. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  16781. /**
  16782. * @brief target -> host peer (PPDU) stats message
  16783. *
  16784. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  16785. *
  16786. * @details
  16787. * This message is generated by FW when FW is sending stats to host
  16788. * about one or more PPDUs that the FW has transmitted to one or more peers.
  16789. * This message is sent autonomously by the target rather than upon request
  16790. * by the host.
  16791. * The following field definitions describe the format of the HTT target
  16792. * to host peer stats indication message.
  16793. *
  16794. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  16795. * or more PPDU stats records.
  16796. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  16797. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  16798. * then the message would start with the
  16799. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  16800. * below.
  16801. *
  16802. * |31 16|15|14|13 11|10 9|8|7 0|
  16803. * |-------------------------------------------------------------|
  16804. * | reserved |MSG_TYPE |
  16805. * |-------------------------------------------------------------|
  16806. * rec 0 | TLV header |
  16807. * rec 0 |-------------------------------------------------------------|
  16808. * rec 0 | ppdu successful bytes |
  16809. * rec 0 |-------------------------------------------------------------|
  16810. * rec 0 | ppdu retry bytes |
  16811. * rec 0 |-------------------------------------------------------------|
  16812. * rec 0 | ppdu failed bytes |
  16813. * rec 0 |-------------------------------------------------------------|
  16814. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  16815. * rec 0 |-------------------------------------------------------------|
  16816. * rec 0 | retried MSDUs | successful MSDUs |
  16817. * rec 0 |-------------------------------------------------------------|
  16818. * rec 0 | TX duration | failed MSDUs |
  16819. * rec 0 |-------------------------------------------------------------|
  16820. * ...
  16821. * |-------------------------------------------------------------|
  16822. * rec N | TLV header |
  16823. * rec N |-------------------------------------------------------------|
  16824. * rec N | ppdu successful bytes |
  16825. * rec N |-------------------------------------------------------------|
  16826. * rec N | ppdu retry bytes |
  16827. * rec N |-------------------------------------------------------------|
  16828. * rec N | ppdu failed bytes |
  16829. * rec N |-------------------------------------------------------------|
  16830. * rec N | peer id | S|SG| BW | BA |A|rate code|
  16831. * rec N |-------------------------------------------------------------|
  16832. * rec N | retried MSDUs | successful MSDUs |
  16833. * rec N |-------------------------------------------------------------|
  16834. * rec N | TX duration | failed MSDUs |
  16835. * rec N |-------------------------------------------------------------|
  16836. *
  16837. * where:
  16838. * A = is A-MPDU flag
  16839. * BA = block-ack failure flags
  16840. * BW = bandwidth spec
  16841. * SG = SGI enabled spec
  16842. * S = skipped rate ctrl
  16843. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  16844. *
  16845. * Header
  16846. * ------
  16847. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  16848. * dword0 - b'8:31 - reserved : Reserved for future use
  16849. *
  16850. * payload include below peer_stats information
  16851. * --------------------------------------------
  16852. * @TLV : HTT_PPDU_STATS_INFO_TLV
  16853. * @tx_success_bytes : total successful bytes in the PPDU.
  16854. * @tx_retry_bytes : total retried bytes in the PPDU.
  16855. * @tx_failed_bytes : total failed bytes in the PPDU.
  16856. * @tx_ratecode : rate code used for the PPDU.
  16857. * @is_ampdu : Indicates PPDU is AMPDU or not.
  16858. * @ba_ack_failed : BA/ACK failed for this PPDU
  16859. * b00 -> BA received
  16860. * b01 -> BA failed once
  16861. * b10 -> BA failed twice, when HW retry is enabled.
  16862. * @bw : BW
  16863. * b00 -> 20 MHz
  16864. * b01 -> 40 MHz
  16865. * b10 -> 80 MHz
  16866. * b11 -> 160 MHz (or 80+80)
  16867. * @sg : SGI enabled
  16868. * @s : skipped ratectrl
  16869. * @peer_id : peer id
  16870. * @tx_success_msdus : successful MSDUs
  16871. * @tx_retry_msdus : retried MSDUs
  16872. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  16873. * @tx_duration : Tx duration for the PPDU (microsecond units)
  16874. */
  16875. /**
  16876. * @brief target -> host backpressure event
  16877. *
  16878. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  16879. *
  16880. * @details
  16881. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  16882. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  16883. * This message will only be sent if the backpressure condition has existed
  16884. * continuously for an initial period (100 ms).
  16885. * Repeat messages with updated information will be sent after each
  16886. * subsequent period (100 ms) as long as the backpressure remains unabated.
  16887. * This message indicates the ring id along with current head and tail index
  16888. * locations (i.e. write and read indices).
  16889. * The backpressure time indicates the time in ms for which continuous
  16890. * backpressure has been observed in the ring.
  16891. *
  16892. * The message format is as follows:
  16893. *
  16894. * |31 24|23 16|15 8|7 0|
  16895. * |----------------+----------------+----------------+----------------|
  16896. * | ring_id | ring_type | pdev_id | msg_type |
  16897. * |-------------------------------------------------------------------|
  16898. * | tail_idx | head_idx |
  16899. * |-------------------------------------------------------------------|
  16900. * | backpressure_time_ms |
  16901. * |-------------------------------------------------------------------|
  16902. *
  16903. * The message is interpreted as follows:
  16904. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  16905. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  16906. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  16907. * 1, 2, 3 indicates pdev_id 0,1,2 and
  16908. * the msg is for LMAC ring.
  16909. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  16910. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  16911. * htt_backpressure_lmac_ring_id. This represents
  16912. * the ring id for which continuous backpressure
  16913. * is seen
  16914. *
  16915. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  16916. * the ring indicated by the ring_id
  16917. *
  16918. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16919. * the ring indicated by the ring id
  16920. *
  16921. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16922. * backpressure has been seen in the ring
  16923. * indicated by the ring_id.
  16924. * Units = milliseconds
  16925. */
  16926. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16927. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16928. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16929. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16930. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16931. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16932. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16933. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16934. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16935. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16936. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16937. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16938. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16939. do { \
  16940. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16941. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16942. } while (0)
  16943. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16944. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16945. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16946. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16947. do { \
  16948. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16949. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16950. } while (0)
  16951. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16952. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16953. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16954. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16955. do { \
  16956. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16957. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16958. } while (0)
  16959. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16960. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16961. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16962. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16963. do { \
  16964. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16965. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16966. } while (0)
  16967. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16968. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16969. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16970. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16971. do { \
  16972. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16973. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16974. } while (0)
  16975. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16976. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16977. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16978. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16979. do { \
  16980. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16981. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16982. } while (0)
  16983. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16984. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16985. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16986. enum htt_backpressure_ring_type {
  16987. HTT_SW_RING_TYPE_UMAC,
  16988. HTT_SW_RING_TYPE_LMAC,
  16989. HTT_SW_RING_TYPE_MAX,
  16990. };
  16991. /* Ring id for which the message is sent to host */
  16992. enum htt_backpressure_umac_ringid {
  16993. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16994. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16995. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16996. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16997. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16998. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  16999. HTT_SW_RING_IDX_REO_REO2FW_RING,
  17000. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  17001. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  17002. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  17003. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  17004. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  17005. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  17006. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  17007. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  17008. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  17009. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  17010. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  17011. HTT_SW_UMAC_RING_IDX_MAX,
  17012. };
  17013. enum htt_backpressure_lmac_ringid {
  17014. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  17015. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  17016. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  17017. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  17018. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  17019. HTT_SW_RING_IDX_RXDMA2FW_RING,
  17020. HTT_SW_RING_IDX_RXDMA2SW_RING,
  17021. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  17022. HTT_SW_RING_IDX_RXDMA2REO_RING,
  17023. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  17024. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  17025. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  17026. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  17027. HTT_SW_LMAC_RING_IDX_MAX,
  17028. };
  17029. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  17030. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  17031. pdev_id: 8,
  17032. ring_type: 8, /* htt_backpressure_ring_type */
  17033. /*
  17034. * ring_id holds an enum value from either
  17035. * htt_backpressure_umac_ringid or
  17036. * htt_backpressure_lmac_ringid, based on
  17037. * the ring_type setting.
  17038. */
  17039. ring_id: 8;
  17040. A_UINT16 head_idx;
  17041. A_UINT16 tail_idx;
  17042. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  17043. } POSTPACK;
  17044. /*
  17045. * Defines two 32 bit words that can be used by the target to indicate a per
  17046. * user RU allocation and rate information.
  17047. *
  17048. * This information is currently provided in the "sw_response_reference_ptr"
  17049. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  17050. * "rx_ppdu_end_user_stats" TLV.
  17051. *
  17052. * VALID:
  17053. * The consumer of these words must explicitly check the valid bit,
  17054. * and only attempt interpretation of any of the remaining fields if
  17055. * the valid bit is set to 1.
  17056. *
  17057. * VERSION:
  17058. * The consumer of these words must also explicitly check the version bit,
  17059. * and only use the V0 definition if the VERSION field is set to 0.
  17060. *
  17061. * Version 1 is currently undefined, with the exception of the VALID and
  17062. * VERSION fields.
  17063. *
  17064. * Version 0:
  17065. *
  17066. * The fields below are duplicated per BW.
  17067. *
  17068. * The consumer must determine which BW field to use, based on the UL OFDMA
  17069. * PPDU BW indicated by HW.
  17070. *
  17071. * RU_START: RU26 start index for the user.
  17072. * Note that this is always using the RU26 index, regardless
  17073. * of the actual RU assigned to the user
  17074. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  17075. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  17076. *
  17077. * For example, 20MHz (the value in the top row is RU_START)
  17078. *
  17079. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  17080. * RU Size 1 (52): | | | | | |
  17081. * RU Size 2 (106): | | | |
  17082. * RU Size 3 (242): | |
  17083. *
  17084. * RU_SIZE: Indicates the RU size, as defined by enum
  17085. * htt_ul_ofdma_user_info_ru_size.
  17086. *
  17087. * LDPC: LDPC enabled (if 0, BCC is used)
  17088. *
  17089. * DCM: DCM enabled
  17090. *
  17091. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  17092. * |---------------------------------+--------------------------------|
  17093. * |Ver|Valid| FW internal |
  17094. * |---------------------------------+--------------------------------|
  17095. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  17096. * |---------------------------------+--------------------------------|
  17097. */
  17098. enum htt_ul_ofdma_user_info_ru_size {
  17099. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  17100. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  17101. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  17102. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  17103. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  17104. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  17105. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  17106. };
  17107. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  17108. struct htt_ul_ofdma_user_info_v0 {
  17109. A_UINT32 word0;
  17110. A_UINT32 word1;
  17111. };
  17112. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  17113. A_UINT32 w0_fw_rsvd:30; \
  17114. A_UINT32 w0_valid:1; \
  17115. A_UINT32 w0_version:1;
  17116. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  17117. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17118. };
  17119. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  17120. A_UINT32 w1_nss:3; \
  17121. A_UINT32 w1_mcs:4; \
  17122. A_UINT32 w1_ldpc:1; \
  17123. A_UINT32 w1_dcm:1; \
  17124. A_UINT32 w1_ru_start:7; \
  17125. A_UINT32 w1_ru_size:3; \
  17126. A_UINT32 w1_trig_type:4; \
  17127. A_UINT32 w1_unused:9;
  17128. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  17129. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17130. };
  17131. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  17132. A_UINT32 w0_fw_rsvd:27; \
  17133. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  17134. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  17135. 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) */
  17136. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  17137. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17138. };
  17139. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  17140. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  17141. A_UINT32 w1_trig_type:4; \
  17142. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  17143. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  17144. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17145. };
  17146. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  17147. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  17148. union {
  17149. A_UINT32 word0;
  17150. struct {
  17151. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17152. };
  17153. };
  17154. union {
  17155. A_UINT32 word1;
  17156. struct {
  17157. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17158. };
  17159. };
  17160. } POSTPACK;
  17161. /*
  17162. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  17163. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  17164. * this should be picked.
  17165. */
  17166. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  17167. union {
  17168. A_UINT32 word0;
  17169. struct {
  17170. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17171. };
  17172. };
  17173. union {
  17174. A_UINT32 word1;
  17175. struct {
  17176. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17177. };
  17178. };
  17179. } POSTPACK;
  17180. enum HTT_UL_OFDMA_TRIG_TYPE {
  17181. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  17182. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  17183. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  17184. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  17185. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  17186. };
  17187. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  17188. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  17189. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  17190. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  17191. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  17192. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  17193. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  17194. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  17195. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  17196. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  17197. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  17198. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  17199. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  17200. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  17201. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  17202. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  17203. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  17204. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  17205. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  17206. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  17207. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  17208. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  17209. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  17210. /*--- word 0 ---*/
  17211. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  17212. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  17213. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  17214. do { \
  17215. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  17216. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  17217. } while (0)
  17218. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  17219. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  17220. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  17221. do { \
  17222. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  17223. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  17224. } while (0)
  17225. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  17226. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  17227. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  17228. do { \
  17229. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  17230. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  17231. } while (0)
  17232. /*--- word 1 ---*/
  17233. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  17234. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  17235. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  17236. do { \
  17237. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  17238. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  17239. } while (0)
  17240. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  17241. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  17242. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  17243. do { \
  17244. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  17245. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  17246. } while (0)
  17247. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  17248. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  17249. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  17250. do { \
  17251. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  17252. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  17253. } while (0)
  17254. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  17255. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  17256. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  17257. do { \
  17258. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  17259. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  17260. } while (0)
  17261. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  17262. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  17263. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  17264. do { \
  17265. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  17266. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  17267. } while (0)
  17268. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  17269. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  17270. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  17271. do { \
  17272. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  17273. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  17274. } while (0)
  17275. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  17276. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  17277. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  17278. do { \
  17279. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  17280. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  17281. } while (0)
  17282. /**
  17283. * @brief target -> host channel calibration data message
  17284. *
  17285. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  17286. *
  17287. * @brief host -> target channel calibration data message
  17288. *
  17289. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  17290. *
  17291. * @details
  17292. * The following field definitions describe the format of the channel
  17293. * calibration data message sent from the target to the host when
  17294. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  17295. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  17296. * The message is defined as htt_chan_caldata_msg followed by a variable
  17297. * number of 32-bit character values.
  17298. *
  17299. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  17300. * |------------------------------------------------------------------|
  17301. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  17302. * |------------------------------------------------------------------|
  17303. * | payload size | mhz |
  17304. * |------------------------------------------------------------------|
  17305. * | center frequency 2 | center frequency 1 |
  17306. * |------------------------------------------------------------------|
  17307. * | check sum |
  17308. * |------------------------------------------------------------------|
  17309. * | payload |
  17310. * |------------------------------------------------------------------|
  17311. * message info field:
  17312. * - MSG_TYPE
  17313. * Bits 7:0
  17314. * Purpose: identifies this as a channel calibration data message
  17315. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  17316. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  17317. * - SUB_TYPE
  17318. * Bits 11:8
  17319. * Purpose: T2H: indicates whether target is providing chan cal data
  17320. * to the host to store, or requesting that the host
  17321. * download previously-stored data.
  17322. * H2T: indicates whether the host is providing the requested
  17323. * channel cal data, or if it is rejecting the data
  17324. * request because it does not have the requested data.
  17325. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  17326. * - CHKSUM_VALID
  17327. * Bit 12
  17328. * Purpose: indicates if the checksum field is valid
  17329. * value:
  17330. * - FRAG
  17331. * Bit 19:16
  17332. * Purpose: indicates the fragment index for message
  17333. * value: 0 for first fragment, 1 for second fragment, ...
  17334. * - APPEND
  17335. * Bit 20
  17336. * Purpose: indicates if this is the last fragment
  17337. * value: 0 = final fragment, 1 = more fragments will be appended
  17338. *
  17339. * channel and payload size field
  17340. * - MHZ
  17341. * Bits 15:0
  17342. * Purpose: indicates the channel primary frequency
  17343. * Value:
  17344. * - PAYLOAD_SIZE
  17345. * Bits 31:16
  17346. * Purpose: indicates the bytes of calibration data in payload
  17347. * Value:
  17348. *
  17349. * center frequency field
  17350. * - CENTER FREQUENCY 1
  17351. * Bits 15:0
  17352. * Purpose: indicates the channel center frequency
  17353. * Value: channel center frequency, in MHz units
  17354. * - CENTER FREQUENCY 2
  17355. * Bits 31:16
  17356. * Purpose: indicates the secondary channel center frequency,
  17357. * only for 11acvht 80plus80 mode
  17358. * Value: secondary channel center frequency, in MHz units, if applicable
  17359. *
  17360. * checksum field
  17361. * - CHECK_SUM
  17362. * Bits 31:0
  17363. * Purpose: check the payload data, it is just for this fragment.
  17364. * This is intended for the target to check that the channel
  17365. * calibration data returned by the host is the unmodified data
  17366. * that was previously provided to the host by the target.
  17367. * value: checksum of fragment payload
  17368. */
  17369. PREPACK struct htt_chan_caldata_msg {
  17370. /* DWORD 0: message info */
  17371. A_UINT32
  17372. msg_type: 8,
  17373. sub_type: 4 ,
  17374. chksum_valid: 1, /** 1:valid, 0:invalid */
  17375. reserved1: 3,
  17376. frag_idx: 4, /** fragment index for calibration data */
  17377. appending: 1, /** 0: no fragment appending,
  17378. * 1: extra fragment appending */
  17379. reserved2: 11;
  17380. /* DWORD 1: channel and payload size */
  17381. A_UINT32
  17382. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  17383. payload_size: 16; /** unit: bytes */
  17384. /* DWORD 2: center frequency */
  17385. A_UINT32
  17386. band_center_freq1: 16, /** Center frequency 1 in MHz */
  17387. band_center_freq2: 16; /** Center frequency 2 in MHz,
  17388. * valid only for 11acvht 80plus80 mode */
  17389. /* DWORD 3: check sum */
  17390. A_UINT32 chksum;
  17391. /* variable length for calibration data */
  17392. A_UINT32 payload[1/* or more */];
  17393. } POSTPACK;
  17394. /* T2H SUBTYPE */
  17395. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  17396. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  17397. /* H2T SUBTYPE */
  17398. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  17399. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  17400. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  17401. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  17402. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  17403. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  17404. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  17405. do { \
  17406. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  17407. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  17408. } while (0)
  17409. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  17410. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  17411. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  17412. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  17413. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  17414. do { \
  17415. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  17416. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  17417. } while (0)
  17418. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  17419. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  17420. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  17421. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  17422. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  17423. do { \
  17424. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  17425. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  17426. } while (0)
  17427. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  17428. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  17429. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  17430. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  17431. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  17432. do { \
  17433. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  17434. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  17435. } while (0)
  17436. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  17437. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  17438. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  17439. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  17440. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  17441. do { \
  17442. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  17443. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  17444. } while (0)
  17445. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  17446. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  17447. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  17448. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  17449. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  17450. do { \
  17451. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  17452. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  17453. } while (0)
  17454. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  17455. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  17456. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  17457. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  17458. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  17459. do { \
  17460. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  17461. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  17462. } while (0)
  17463. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  17464. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  17465. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  17466. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  17467. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  17468. do { \
  17469. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  17470. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  17471. } while (0)
  17472. /**
  17473. * @brief target -> host FSE CMEM based send
  17474. *
  17475. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  17476. *
  17477. * @details
  17478. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  17479. * FSE placement in CMEM is enabled.
  17480. *
  17481. * This message sends the non-secure CMEM base address.
  17482. * It will be sent to host in response to message
  17483. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  17484. * The message would appear as follows:
  17485. *
  17486. * |31 24|23 16|15 8|7 0|
  17487. * |----------------+----------------+----------------+----------------|
  17488. * | reserved | num_entries | msg_type |
  17489. * |----------------+----------------+----------------+----------------|
  17490. * | base_address_lo |
  17491. * |----------------+----------------+----------------+----------------|
  17492. * | base_address_hi |
  17493. * |-------------------------------------------------------------------|
  17494. *
  17495. * The message is interpreted as follows:
  17496. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  17497. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  17498. * b'8:15 - number_entries: Indicated the number of entries
  17499. * programmed.
  17500. * b'16:31 - reserved.
  17501. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  17502. * CMEM base address
  17503. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  17504. * CMEM base address
  17505. */
  17506. PREPACK struct htt_cmem_base_send_t {
  17507. A_UINT32 msg_type: 8,
  17508. num_entries: 8,
  17509. reserved: 16;
  17510. A_UINT32 base_address_lo;
  17511. A_UINT32 base_address_hi;
  17512. } POSTPACK;
  17513. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  17514. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  17515. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  17516. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  17517. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  17518. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  17519. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  17520. do { \
  17521. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  17522. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  17523. } while (0)
  17524. /**
  17525. * @brief - HTT PPDU ID format
  17526. *
  17527. * @details
  17528. * The following field definitions describe the format of the PPDU ID.
  17529. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  17530. *
  17531. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  17532. * +--------------------------------------------------------------------------
  17533. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  17534. * +--------------------------------------------------------------------------
  17535. *
  17536. * sch id :Schedule command id
  17537. * Bits [11 : 0] : monotonically increasing counter to track the
  17538. * PPDU posted to a specific transmit queue.
  17539. *
  17540. * hwq_id: Hardware Queue ID.
  17541. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  17542. *
  17543. * mac_id: MAC ID
  17544. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  17545. *
  17546. * seq_idx: Sequence index.
  17547. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  17548. * a particular TXOP.
  17549. *
  17550. * tqm_cmd: HWSCH/TQM flag.
  17551. * Bit [23] : Always set to 0.
  17552. *
  17553. * seq_cmd_type: Sequence command type.
  17554. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  17555. * Refer to enum HTT_STATS_FTYPE for values.
  17556. */
  17557. PREPACK struct htt_ppdu_id {
  17558. A_UINT32
  17559. sch_id: 12,
  17560. hwq_id: 5,
  17561. mac_id: 2,
  17562. seq_idx: 2,
  17563. reserved1: 2,
  17564. tqm_cmd: 1,
  17565. seq_cmd_type: 6,
  17566. reserved2: 2;
  17567. } POSTPACK;
  17568. #define HTT_PPDU_ID_SCH_ID_S 0
  17569. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  17570. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  17571. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  17572. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  17573. do { \
  17574. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  17575. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  17576. } while (0)
  17577. #define HTT_PPDU_ID_HWQ_ID_S 12
  17578. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  17579. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  17580. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  17581. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  17582. do { \
  17583. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  17584. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  17585. } while (0)
  17586. #define HTT_PPDU_ID_MAC_ID_S 17
  17587. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  17588. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  17589. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  17590. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  17591. do { \
  17592. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  17593. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  17594. } while (0)
  17595. #define HTT_PPDU_ID_SEQ_IDX_S 19
  17596. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  17597. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  17598. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  17599. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  17600. do { \
  17601. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  17602. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  17603. } while (0)
  17604. #define HTT_PPDU_ID_TQM_CMD_S 23
  17605. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  17606. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  17607. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  17608. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  17609. do { \
  17610. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  17611. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  17612. } while (0)
  17613. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  17614. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  17615. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  17616. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  17617. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  17618. do { \
  17619. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  17620. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  17621. } while (0)
  17622. /**
  17623. * @brief target -> RX PEER METADATA V0 format
  17624. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17625. * message from target, and will confirm to the target which peer metadata
  17626. * version to use in the wmi_init message.
  17627. *
  17628. * The following diagram shows the format of the RX PEER METADATA.
  17629. *
  17630. * |31 24|23 16|15 8|7 0|
  17631. * |-----------------------------------------------------------------------|
  17632. * | Reserved | VDEV ID | PEER ID |
  17633. * |-----------------------------------------------------------------------|
  17634. */
  17635. PREPACK struct htt_rx_peer_metadata_v0 {
  17636. A_UINT32
  17637. peer_id: 16,
  17638. vdev_id: 8,
  17639. reserved1: 8;
  17640. } POSTPACK;
  17641. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  17642. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  17643. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  17644. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  17645. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  17646. do { \
  17647. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  17648. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  17649. } while (0)
  17650. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  17651. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  17652. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  17653. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  17654. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  17655. do { \
  17656. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  17657. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  17658. } while (0)
  17659. /**
  17660. * @brief target -> RX PEER METADATA V1 format
  17661. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17662. * message from target, and will confirm to the target which peer metadata
  17663. * version to use in the wmi_init message.
  17664. *
  17665. * The following diagram shows the format of the RX PEER METADATA V1 format.
  17666. *
  17667. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  17668. * |---------------------------------------------------------------------------|
  17669. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  17670. * |---------------------------------------------------------------------------|
  17671. */
  17672. PREPACK struct htt_rx_peer_metadata_v1 {
  17673. A_UINT32
  17674. peer_id: 13,
  17675. ml_peer_valid: 1,
  17676. logical_link_id: 2,
  17677. vdev_id: 8,
  17678. lmac_id: 2,
  17679. chip_id: 3,
  17680. reserved2: 3;
  17681. } POSTPACK;
  17682. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  17683. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  17684. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  17685. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  17686. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  17687. do { \
  17688. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  17689. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  17690. } while (0)
  17691. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  17692. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  17693. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  17694. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  17695. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  17696. do { \
  17697. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  17698. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  17699. } while (0)
  17700. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  17701. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  17702. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  17703. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  17704. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  17705. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  17706. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  17707. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  17708. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  17709. do { \
  17710. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  17711. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  17712. } while (0)
  17713. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  17714. do { \
  17715. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  17716. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  17717. } while (0)
  17718. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  17719. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  17720. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  17721. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  17722. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  17723. do { \
  17724. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  17725. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  17726. } while (0)
  17727. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  17728. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  17729. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  17730. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  17731. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  17732. do { \
  17733. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  17734. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  17735. } while (0)
  17736. /*
  17737. * In some systems, the host SW wants to specify priorities between
  17738. * different MSDU / flow queues within the same peer-TID.
  17739. * The below enums are used for the host to identify to the target
  17740. * which MSDU queue's priority it wants to adjust.
  17741. */
  17742. /*
  17743. * The MSDUQ index describe index of TCL HW, where each index is
  17744. * used for queuing particular types of MSDUs.
  17745. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  17746. */
  17747. enum HTT_MSDUQ_INDEX {
  17748. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  17749. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  17750. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  17751. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  17752. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  17753. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  17754. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  17755. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  17756. HTT_MSDUQ_MAX_INDEX,
  17757. };
  17758. /* MSDU qtype definition */
  17759. enum HTT_MSDU_QTYPE {
  17760. /*
  17761. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  17762. * relative priority. Instead, the relative priority of CRIT_0 versus
  17763. * CRIT_1 is controlled by the FW, through the configuration parameters
  17764. * it applies to the queues.
  17765. */
  17766. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  17767. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  17768. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  17769. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  17770. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  17771. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  17772. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  17773. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  17774. /* New MSDU_QTYPE should be added above this line */
  17775. /*
  17776. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  17777. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  17778. * any host/target message definitions. The QTYPE_MAX value can
  17779. * only be used internally within the host or within the target.
  17780. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  17781. * it must regard the unexpected value as a default qtype value,
  17782. * or ignore it.
  17783. */
  17784. HTT_MSDU_QTYPE_MAX,
  17785. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  17786. };
  17787. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  17788. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  17789. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  17790. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  17791. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  17792. };
  17793. /**
  17794. * @brief target -> host mlo timestamp offset indication
  17795. *
  17796. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17797. *
  17798. * @details
  17799. * The following field definitions describe the format of the HTT target
  17800. * to host mlo timestamp offset indication message.
  17801. *
  17802. *
  17803. * |31 16|15 12|11 10|9 8|7 0 |
  17804. * |----------------------------------------------------------------------|
  17805. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  17806. * |----------------------------------------------------------------------|
  17807. * | Sync time stamp lo in us |
  17808. * |----------------------------------------------------------------------|
  17809. * | Sync time stamp hi in us |
  17810. * |----------------------------------------------------------------------|
  17811. * | mlo time stamp offset lo in us |
  17812. * |----------------------------------------------------------------------|
  17813. * | mlo time stamp offset hi in us |
  17814. * |----------------------------------------------------------------------|
  17815. * | mlo time stamp offset clocks in clock ticks |
  17816. * |----------------------------------------------------------------------|
  17817. * |31 26|25 16|15 0 |
  17818. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  17819. * | | compensation in clks | |
  17820. * |----------------------------------------------------------------------|
  17821. * |31 22|21 0 |
  17822. * | rsvd 3 | mlo time stamp comp timer period |
  17823. * |----------------------------------------------------------------------|
  17824. * The message is interpreted as follows:
  17825. *
  17826. * dword0 - b'0:7 - msg_type: This will be set to
  17827. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17828. * value: 0x28
  17829. *
  17830. * dword0 - b'9:8 - pdev_id
  17831. *
  17832. * dword0 - b'11:10 - chip_id
  17833. *
  17834. * dword0 - b'15:12 - rsvd1: Reserved for future use
  17835. *
  17836. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  17837. *
  17838. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  17839. * which last sync interrupt was received
  17840. *
  17841. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  17842. * which last sync interrupt was received
  17843. *
  17844. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  17845. *
  17846. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  17847. *
  17848. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  17849. *
  17850. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  17851. *
  17852. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  17853. * for sub us resolution
  17854. *
  17855. * dword6 - b'31:26 - rsvd2: Reserved for future use
  17856. *
  17857. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  17858. * is applied, in us
  17859. *
  17860. * dword7 - b'31:22 - rsvd3: Reserved for future use
  17861. */
  17862. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  17863. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  17864. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  17865. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  17866. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  17867. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  17868. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  17869. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  17870. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  17871. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  17872. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  17873. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  17874. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  17875. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  17876. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  17877. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  17878. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  17879. do { \
  17880. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  17881. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  17882. } while (0)
  17883. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  17884. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  17885. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  17886. do { \
  17887. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  17888. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  17889. } while (0)
  17890. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  17891. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  17892. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  17893. do { \
  17894. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  17895. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  17896. } while (0)
  17897. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  17898. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  17899. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  17900. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  17901. do { \
  17902. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  17903. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  17904. } while (0)
  17905. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  17906. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  17907. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  17908. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  17909. do { \
  17910. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  17911. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  17912. } while (0)
  17913. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  17914. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  17915. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  17916. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  17917. do { \
  17918. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  17919. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  17920. } while (0)
  17921. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  17922. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  17923. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  17924. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  17925. do { \
  17926. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  17927. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  17928. } while (0)
  17929. typedef struct {
  17930. A_UINT32 msg_type: 8, /* bits 7:0 */
  17931. pdev_id: 2, /* bits 9:8 */
  17932. chip_id: 2, /* bits 11:10 */
  17933. reserved1: 4, /* bits 15:12 */
  17934. mac_clk_freq_mhz: 16; /* bits 31:16 */
  17935. A_UINT32 sync_timestamp_lo_us;
  17936. A_UINT32 sync_timestamp_hi_us;
  17937. A_UINT32 mlo_timestamp_offset_lo_us;
  17938. A_UINT32 mlo_timestamp_offset_hi_us;
  17939. A_UINT32 mlo_timestamp_offset_clks;
  17940. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  17941. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  17942. reserved2: 6; /* bits 31:26 */
  17943. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  17944. reserved3: 10; /* bits 31:22 */
  17945. } htt_t2h_mlo_offset_ind_t;
  17946. /*
  17947. * @brief target -> host VDEV TX RX STATS
  17948. *
  17949. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  17950. *
  17951. * @details
  17952. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  17953. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  17954. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  17955. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  17956. * periodically by target even in the absence of any further HTT request
  17957. * messages from host.
  17958. *
  17959. * The message is formatted as follows:
  17960. *
  17961. * |31 16|15 8|7 0|
  17962. * |---------------------------------+----------------+----------------|
  17963. * | payload_size | pdev_id | msg_type |
  17964. * |---------------------------------+----------------+----------------|
  17965. * | reserved0 |
  17966. * |-------------------------------------------------------------------|
  17967. * | reserved1 |
  17968. * |-------------------------------------------------------------------|
  17969. * | reserved2 |
  17970. * |-------------------------------------------------------------------|
  17971. * | |
  17972. * | VDEV specific Tx Rx stats info |
  17973. * | |
  17974. * |-------------------------------------------------------------------|
  17975. *
  17976. * The message is interpreted as follows:
  17977. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  17978. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  17979. * b'8:15 - pdev_id
  17980. * b'16:31 - size in bytes of the payload that follows the 16-byte
  17981. * message header fields (msg_type through reserved2)
  17982. * dword1 - b'0:31 - reserved0.
  17983. * dword2 - b'0:31 - reserved1.
  17984. * dword3 - b'0:31 - reserved2.
  17985. */
  17986. typedef struct {
  17987. A_UINT32 msg_type: 8,
  17988. pdev_id: 8,
  17989. payload_size: 16;
  17990. A_UINT32 reserved0;
  17991. A_UINT32 reserved1;
  17992. A_UINT32 reserved2;
  17993. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  17994. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  17995. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  17996. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  17997. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  17998. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  17999. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  18000. do { \
  18001. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  18002. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  18003. } while (0)
  18004. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  18005. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  18006. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  18007. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  18008. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  18009. do { \
  18010. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  18011. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  18012. } while (0)
  18013. /* SOC related stats */
  18014. typedef struct {
  18015. htt_tlv_hdr_t tlv_hdr;
  18016. /* When TQM is not able to find the peers during Tx, then it drops the packets
  18017. * This can be due to either the peer is deleted or deletion is ongoing
  18018. * */
  18019. A_UINT32 inv_peers_msdu_drop_count_lo;
  18020. A_UINT32 inv_peers_msdu_drop_count_hi;
  18021. } htt_t2h_soc_txrx_stats_common_tlv;
  18022. /* VDEV HW Tx/Rx stats */
  18023. typedef struct {
  18024. htt_tlv_hdr_t tlv_hdr;
  18025. A_UINT32 vdev_id;
  18026. /* Rx msdu byte cnt */
  18027. A_UINT32 rx_msdu_byte_cnt_lo;
  18028. A_UINT32 rx_msdu_byte_cnt_hi;
  18029. /* Rx msdu cnt */
  18030. A_UINT32 rx_msdu_cnt_lo;
  18031. A_UINT32 rx_msdu_cnt_hi;
  18032. /* tx msdu byte cnt */
  18033. A_UINT32 tx_msdu_byte_cnt_lo;
  18034. A_UINT32 tx_msdu_byte_cnt_hi;
  18035. /* tx msdu cnt */
  18036. A_UINT32 tx_msdu_cnt_lo;
  18037. A_UINT32 tx_msdu_cnt_hi;
  18038. /* tx excessive retry discarded msdu cnt */
  18039. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  18040. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  18041. /* TX congestion ctrl msdu drop cnt */
  18042. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  18043. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  18044. /* discarded tx msdus cnt coz of time to live expiry */
  18045. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  18046. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  18047. /* tx excessive retry discarded msdu byte cnt */
  18048. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  18049. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  18050. /* TX congestion ctrl msdu drop byte cnt */
  18051. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  18052. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  18053. /* discarded tx msdus byte cnt coz of time to live expiry */
  18054. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  18055. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  18056. /* TQM bypass frame cnt */
  18057. A_UINT32 tqm_bypass_frame_cnt_lo;
  18058. A_UINT32 tqm_bypass_frame_cnt_hi;
  18059. /* TQM bypass byte cnt */
  18060. A_UINT32 tqm_bypass_byte_cnt_lo;
  18061. A_UINT32 tqm_bypass_byte_cnt_hi;
  18062. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  18063. /*
  18064. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  18065. *
  18066. * @details
  18067. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  18068. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  18069. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  18070. * the default MSDU queues of each of the specified TIDs for the peer
  18071. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  18072. * If the default MSDU queues of a given TID within the peer are not linked
  18073. * to a service class, the svc_class_id field for that TID will have a
  18074. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  18075. * queues for that TID are not mapped to any service class.
  18076. *
  18077. * |31 16|15 8|7 0|
  18078. * |------------------------------+--------------+--------------|
  18079. * | peer ID | reserved | msg type |
  18080. * |------------------------------+--------------+------+-------|
  18081. * | reserved | svc class ID | TID |
  18082. * |------------------------------------------------------------|
  18083. * ...
  18084. * |------------------------------------------------------------|
  18085. * | reserved | svc class ID | TID |
  18086. * |------------------------------------------------------------|
  18087. * Header fields:
  18088. * dword0 - b'7:0 - msg_type: This will be set to
  18089. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  18090. * b'31:16 - peer ID
  18091. * dword1 - b'7:0 - TID
  18092. * b'15:8 - svc class ID
  18093. * (dword2, etc. same format as dword1)
  18094. */
  18095. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  18096. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  18097. A_UINT32 msg_type :8,
  18098. reserved0 :8,
  18099. peer_id :16;
  18100. struct {
  18101. A_UINT32 tid :8,
  18102. svc_class_id :8,
  18103. reserved1 :16;
  18104. } tid_reports[1/*or more*/];
  18105. } POSTPACK;
  18106. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  18107. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  18108. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  18109. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  18110. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  18111. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  18112. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  18113. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  18114. do { \
  18115. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  18116. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  18117. } while (0)
  18118. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  18119. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  18120. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  18121. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  18122. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  18123. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  18124. do { \
  18125. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  18126. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  18127. } while (0)
  18128. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  18129. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  18130. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  18131. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  18132. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  18133. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  18134. do { \
  18135. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  18136. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  18137. } while (0)
  18138. /*
  18139. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  18140. *
  18141. * @details
  18142. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  18143. * flow if the flow is seen the associated service class is conveyed to the
  18144. * target via TCL Data Command. Target on the other hand internally creates the
  18145. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  18146. * of the newly created MSDUQ and some other identifiers to uniquely identity
  18147. * the newly created MSDUQ
  18148. *
  18149. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  18150. * |------------------------------+------------------------+--------------|
  18151. * | peer ID | HTT qtype | msg type |
  18152. * |---------------------------------+--------------+--+---+-------+------|
  18153. * | reserved |AST list index|FO|WC | HLOS | remap|
  18154. * | | | | | TID | TID |
  18155. * |---------------------+------------------------------------------------|
  18156. * | reserved1 | tgt_opaque_id |
  18157. * |---------------------+------------------------------------------------|
  18158. *
  18159. * Header fields:
  18160. *
  18161. * dword0 - b'7:0 - msg_type: This will be set to
  18162. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  18163. * b'15:8 - HTT qtype
  18164. * b'31:16 - peer ID
  18165. *
  18166. * dword1 - b'3:0 - remap TID, as assigned in firmware
  18167. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  18168. * hlos_tid : Common to Lithium and Beryllium
  18169. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  18170. * TCL Data Command : Beryllium
  18171. * b10 - flow_override (FO), as sent by host in
  18172. * TCL Data Command: Beryllium
  18173. * b11:14 - ast_list_idx
  18174. * Array index into the list of extension AST entries
  18175. * (not the actual AST 16-bit index).
  18176. * The ast_list_idx is one-based, with the following
  18177. * range of values:
  18178. * - legacy targets supporting 16 user-defined
  18179. * MSDU queues: 1-2
  18180. * - legacy targets supporting 48 user-defined
  18181. * MSDU queues: 1-6
  18182. * - new targets: 0 (peer_id is used instead)
  18183. * Note that since ast_list_idx is one-based,
  18184. * the host will need to subtract 1 to use it as an
  18185. * index into a list of extension AST entries.
  18186. * b15:31 - reserved
  18187. *
  18188. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  18189. * unique MSDUQ id in firmware
  18190. * b'24:31 - reserved1
  18191. */
  18192. PREPACK struct htt_t2h_sawf_msduq_event {
  18193. A_UINT32 msg_type : 8,
  18194. htt_qtype : 8,
  18195. peer_id :16;
  18196. A_UINT32 remap_tid : 4,
  18197. hlos_tid : 4,
  18198. who_classify_info_sel : 2,
  18199. flow_override : 1,
  18200. ast_list_idx : 4,
  18201. reserved :17;
  18202. A_UINT32 tgt_opaque_id :24,
  18203. reserved1 : 8;
  18204. } POSTPACK;
  18205. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  18206. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  18207. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  18208. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  18209. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  18210. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  18211. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  18212. do { \
  18213. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  18214. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  18215. } while (0)
  18216. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  18217. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  18218. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  18219. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  18220. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  18221. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  18222. do { \
  18223. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  18224. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  18225. } while (0)
  18226. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  18227. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  18228. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  18229. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  18230. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  18231. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  18232. do { \
  18233. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  18234. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  18235. } while (0)
  18236. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  18237. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  18238. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  18239. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  18240. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  18241. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  18242. do { \
  18243. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  18244. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  18245. } while (0)
  18246. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  18247. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  18248. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  18249. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  18250. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  18251. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  18252. do { \
  18253. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  18254. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  18255. } while (0)
  18256. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  18257. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  18258. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  18259. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  18260. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  18261. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  18262. do { \
  18263. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  18264. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  18265. } while (0)
  18266. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  18267. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  18268. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  18269. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  18270. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  18271. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  18272. do { \
  18273. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  18274. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  18275. } while (0)
  18276. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  18277. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  18278. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  18279. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  18280. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  18281. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  18282. do { \
  18283. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  18284. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  18285. } while (0)
  18286. /**
  18287. * @brief target -> PPDU id format indication
  18288. *
  18289. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  18290. *
  18291. * @details
  18292. * The following field definitions describe the format of the HTT target
  18293. * to host PPDU ID format indication message.
  18294. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  18295. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  18296. * seq_idx :- Sequence control index of this PPDU.
  18297. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  18298. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  18299. * tqm_cmd:-
  18300. *
  18301. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  18302. * |--------------------------------------------------+------------------------|
  18303. * | rsvd0 | msg type |
  18304. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18305. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  18306. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18307. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  18308. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18309. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  18310. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18311. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  18312. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18313. * Where: OF = bit offset, NB = number of bits, V = valid
  18314. * The message is interpreted as follows:
  18315. *
  18316. * dword0 - b'7:0 - msg_type: This will be set to
  18317. * HTT_T2H_PPDU_ID_FMT_IND
  18318. * value: 0x30
  18319. *
  18320. * dword0 - b'31:8 - reserved
  18321. *
  18322. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  18323. *
  18324. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  18325. *
  18326. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  18327. *
  18328. * dword1 - b'15:11 - reserved for future use
  18329. *
  18330. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  18331. *
  18332. * dword1 - b'21:17 - number of bits in ring_id
  18333. *
  18334. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  18335. *
  18336. * dword1 - b'31:27 - reserved for future use
  18337. *
  18338. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  18339. *
  18340. * dword2 - b'5:1 - number of bits in sequence index
  18341. *
  18342. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  18343. *
  18344. * dword2 - b'15:11 - reserved for future use
  18345. *
  18346. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  18347. *
  18348. * dword2 - b'21:17 - number of bits in link_id
  18349. *
  18350. * dword2 - b'26:22 - offset of link_id (in number of bits)
  18351. *
  18352. * dword2 - b'31:27 - reserved for future use
  18353. *
  18354. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  18355. *
  18356. * dword3 - b'5:1 - number of bits in seq_cmd_type
  18357. *
  18358. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  18359. *
  18360. * dword3 - b'15:11 - reserved for future use
  18361. *
  18362. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  18363. *
  18364. * dword3 - b'21:17 - number of bits in tqm_cmd
  18365. *
  18366. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  18367. *
  18368. * dword3 - b'31:27 - reserved for future use
  18369. *
  18370. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  18371. *
  18372. * dword4 - b'5:1 - number of bits in mac_id
  18373. *
  18374. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  18375. *
  18376. * dword4 - b'15:11 - reserved for future use
  18377. *
  18378. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  18379. *
  18380. * dword4 - b'21:17 - number of bits in crc
  18381. *
  18382. * dword4 - b'26:22 - offset of crc (in number of bits)
  18383. *
  18384. * dword4 - b'31:27 - reserved for future use
  18385. *
  18386. */
  18387. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  18388. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  18389. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  18390. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  18391. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  18392. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  18393. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  18394. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  18395. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  18396. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  18397. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  18398. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  18399. /* macros for accessing lower 16 bits in dword */
  18400. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  18401. do { \
  18402. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  18403. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  18404. } while (0)
  18405. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  18406. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  18407. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  18408. do { \
  18409. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  18410. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  18411. } while (0)
  18412. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  18413. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  18414. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  18415. do { \
  18416. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  18417. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  18418. } while (0)
  18419. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  18420. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  18421. /* macros for accessing upper 16 bits in dword */
  18422. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  18423. do { \
  18424. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  18425. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  18426. } while (0)
  18427. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  18428. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  18429. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  18430. do { \
  18431. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  18432. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  18433. } while (0)
  18434. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  18435. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  18436. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  18437. do { \
  18438. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  18439. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  18440. } while (0)
  18441. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  18442. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  18443. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  18444. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18445. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  18446. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18447. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  18448. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18449. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  18450. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18451. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  18452. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18453. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  18454. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18455. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  18456. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18457. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  18458. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18459. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  18460. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18461. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  18462. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18463. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  18464. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18465. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  18466. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18467. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  18468. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18469. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  18470. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18471. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  18472. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18473. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  18474. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18475. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  18476. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18477. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  18478. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18479. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  18480. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18481. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  18482. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18483. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  18484. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18485. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  18486. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18487. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  18488. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18489. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  18490. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18491. /* offsets in number dwords */
  18492. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  18493. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  18494. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  18495. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  18496. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  18497. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  18498. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  18499. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  18500. typedef struct {
  18501. A_UINT32 msg_type: 8, /* bits 7:0 */
  18502. rsvd0: 24;/* bits 31:8 */
  18503. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  18504. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  18505. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  18506. rsvd1: 5, /* bits 15:11 */
  18507. ring_id_valid: 1, /* bits 16:16 */
  18508. ring_id_bits: 5, /* bits 21:17 */
  18509. ring_id_offset: 5, /* bits 26:22 */
  18510. rsvd2: 5; /* bits 31:27 */
  18511. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  18512. seq_idx_bits: 5, /* bits 5:1 */
  18513. seq_idx_offset: 5, /* bits 10:6 */
  18514. rsvd3: 5, /* bits 15:11 */
  18515. link_id_valid: 1, /* bits 16:16 */
  18516. link_id_bits: 5, /* bits 21:17 */
  18517. link_id_offset: 5, /* bits 26:22 */
  18518. rsvd4: 5; /* bits 31:27 */
  18519. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  18520. seq_cmd_type_bits: 5, /* bits 5:1 */
  18521. seq_cmd_type_offset: 5, /* bits 10:6 */
  18522. rsvd5: 5, /* bits 15:11 */
  18523. tqm_cmd_valid: 1, /* bits 16:16 */
  18524. tqm_cmd_bits: 5, /* bits 21:17 */
  18525. tqm_cmd_offset: 5, /* bits 26:12 */
  18526. rsvd6: 5; /* bits 31:27 */
  18527. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  18528. mac_id_bits: 5, /* bits 5:1 */
  18529. mac_id_offset: 5, /* bits 10:6 */
  18530. rsvd8: 5, /* bits 15:11 */
  18531. crc_valid: 1, /* bits 16:16 */
  18532. crc_bits: 5, /* bits 21:17 */
  18533. crc_offset: 5, /* bits 26:12 */
  18534. rsvd9: 5; /* bits 31:27 */
  18535. } htt_t2h_ppdu_id_fmt_ind_t;
  18536. /**
  18537. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  18538. *
  18539. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  18540. *
  18541. * @details
  18542. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  18543. * when RX_CCE_SUPER_RULE setup is done
  18544. *
  18545. * This message shows the configuration results after the setup operation.
  18546. * It will always be sent to host.
  18547. * The message would appear as follows:
  18548. *
  18549. * |31 24|23 16|15 8|7 0|
  18550. * |-----------------+-----------------+----------------+----------------|
  18551. * | result | response_type | vdev_id | msg_type |
  18552. * |---------------------------------------------------------------------|
  18553. *
  18554. * The message is interpreted as follows:
  18555. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  18556. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  18557. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is setup on
  18558. * b'16:23 - response_type: Indicate the response type of this setup
  18559. * done msg
  18560. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  18561. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  18562. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  18563. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  18564. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  18565. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  18566. * b'24:31 - result: Indicate result of setup operation
  18567. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  18568. * b'24 - is_rule_enough: indicate if there are
  18569. * enough free cce rule slots
  18570. * 0: not enough
  18571. * 1: enough
  18572. * b'25:31 - avail_rule_num: indicate the number of
  18573. * remaining free cce rule slots, only makes sense
  18574. * when is_rule_enough = 0
  18575. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  18576. * b'24 - cfg_result_0: indicate the config result
  18577. * of RX_CCE_SUPER_RULE_0
  18578. * 0: Install/Uninstall fails
  18579. * 1: Install/Uninstall succeeds
  18580. * b'25 - cfg_result_1: indicate the config result
  18581. * of RX_CCE_SUPER_RULE_1
  18582. * 0: Install/Uninstall fails
  18583. * 1: Install/Uninstall succeeds
  18584. * b'26:31 - reserved
  18585. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  18586. * b'24 - cfg_result_0: indicate the config result
  18587. * of RX_CCE_SUPER_RULE_0
  18588. * 0: Release fails
  18589. * 1: Release succeeds
  18590. * b'25 - cfg_result_1: indicate the config result
  18591. * of RX_CCE_SUPER_RULE_1
  18592. * 0: Release fails
  18593. * 1: Release succeeds
  18594. * b'26:31 - reserved
  18595. */
  18596. enum htt_rx_cce_super_rule_setup_done_response_type {
  18597. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  18598. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  18599. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  18600. /*All reply type should be before this*/
  18601. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  18602. };
  18603. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  18604. A_UINT8 msg_type;
  18605. A_UINT8 vdev_id;
  18606. A_UINT8 response_type;
  18607. union {
  18608. struct {
  18609. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  18610. A_UINT8 is_rule_enough: 1,
  18611. avail_rule_num: 7;
  18612. };
  18613. struct {
  18614. /*
  18615. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  18616. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  18617. */
  18618. A_UINT8 cfg_result_0: 1,
  18619. cfg_result_1: 1,
  18620. rsvd: 6;
  18621. };
  18622. } result;
  18623. } POSTPACK;
  18624. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  18625. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M 0x0000ff00
  18626. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S 8
  18627. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_GET(_var) \
  18628. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M) >> \
  18629. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)
  18630. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_SET(_var, _val) \
  18631. do { \
  18632. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID, _val); \
  18633. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)); \
  18634. } while (0)
  18635. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  18636. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  18637. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  18638. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  18639. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  18640. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  18641. do { \
  18642. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  18643. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  18644. } while (0)
  18645. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  18646. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  18647. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  18648. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  18649. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  18650. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  18651. do { \
  18652. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  18653. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  18654. } while (0)
  18655. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  18656. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  18657. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  18658. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  18659. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  18660. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  18661. do { \
  18662. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  18663. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  18664. } while (0)
  18665. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  18666. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  18667. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  18668. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  18669. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  18670. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  18671. do { \
  18672. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  18673. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  18674. } while (0)
  18675. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  18676. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  18677. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  18678. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  18679. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  18680. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  18681. do { \
  18682. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  18683. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  18684. } while (0)
  18685. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  18686. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  18687. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  18688. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  18689. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  18690. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  18691. do { \
  18692. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  18693. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  18694. } while (0)
  18695. /**
  18696. * @brief target -> host CoDel MSDU queue latencies array configuration
  18697. *
  18698. * MSG_TYPE => HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND
  18699. *
  18700. * @details
  18701. * The HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND message is used
  18702. * by the target to inform the host of the location and size of the DDR array of
  18703. * per MSDU queue latency metrics. This array is updated by the host and
  18704. * read by the target. The target uses these metric values to determine
  18705. * which MSDU queues have latencies exceeding their CoDel latency target.
  18706. *
  18707. * |31 16|15 8|7 0|
  18708. * |-------------------------------------------+----------|
  18709. * | number of array elements | reserved | MSG_TYPE |
  18710. * |-------------------------------------------+----------|
  18711. * | array physical address, low bits |
  18712. * |------------------------------------------------------|
  18713. * | array physical address, high bits |
  18714. * |------------------------------------------------------|
  18715. * Header fields:
  18716. * - MSG_TYPE
  18717. * Bits 7:0
  18718. * Purpose: Identifies this as a CoDel MSDU queue latencies
  18719. * array configuration message.
  18720. * Value: (HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND)
  18721. * - NUM_ELEM
  18722. * Bits 31:16
  18723. * Purpose: Inform the host of the length of the MSDU queue latencies array.
  18724. * Value: Specifies the number of elements in the MSDU queue latency
  18725. * metrics array. This value is the same as the maximum number of
  18726. * MSDU queues supported by the target.
  18727. * Since each array element is 16 bits, the size in bytes of the
  18728. * MSDU queue latency metrics array is twice the number of elements.
  18729. * - PADDR_LOW
  18730. * Bits 31:0
  18731. * Purpose: Inform the host of the MSDU queue latencies array's location.
  18732. * Value: Lower 32 bits of the physical address of the MSDU queue latency
  18733. * metrics array.
  18734. * - PADDR_HIGH
  18735. * Bits 31:0
  18736. * Purpose: Inform the host of the MSDU queue latencies array's location.
  18737. * Value: Upper 32 bits of the physical address of the MSDU queue latency
  18738. * metrics array.
  18739. */
  18740. typedef struct {
  18741. A_UINT32 msg_type: 8, /* bits 7:0 */
  18742. reserved: 8, /* bits 15:8 */
  18743. num_elem: 16; /* bits 31:16 */
  18744. A_UINT32 paddr_low;
  18745. A_UINT32 paddr_high;
  18746. } htt_t2h_codel_msduq_latencies_array_cfg_int_t;
  18747. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_SIZE 12 /* bytes */
  18748. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M 0xffff0000
  18749. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S 16
  18750. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_GET(_var) \
  18751. (((_var) & HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M) >> \
  18752. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)
  18753. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_SET(_var, _val) \
  18754. do { \
  18755. HTT_CHECK_SET_VAL( \
  18756. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM, _val); \
  18757. ((_var) |= ((_val) << \
  18758. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)); \
  18759. } while (0)
  18760. /*
  18761. * This CoDel MSDU queue latencies array whose location and number of
  18762. * elements are specified by this HTT_T2H message consists of 16-bit elements
  18763. * that each specify a statistical summary (min) of a MSDU queue's latency,
  18764. * using microseconds units.
  18765. */
  18766. #define HTT_CODEL_MSDUQ_LATENCIES_ARRAY_ELEM_BYTES 2
  18767. /**
  18768. * @brief target -> host rx completion indication message definition
  18769. *
  18770. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DATA_IND
  18771. *
  18772. * @details
  18773. * The following diagram shows the format of the Rx completion indication sent
  18774. * from the target to the host
  18775. *
  18776. * |31|29|28 24|23 12|11 9|8| 7|6|5|4|3|2|1|0|
  18777. * |---------------+----------------------------+----------------|
  18778. * | vdev_id | peer_id | msg_type |
  18779. * hdr: |---------------+--------------------------+-+----------------|
  18780. * | rsvd0 |F| msdu_cnt |
  18781. * pyld: |==========================================+=+================|
  18782. * MSDU 0 | buf addr lo (bits 31:0) |
  18783. * |-----+--------------------------------------+----------------|
  18784. * |rsvd1| SW buffer cookie | buf addr hi |
  18785. * |--+--+-----------------------------+--------+--+-+-+-+-+-+-+-|
  18786. * |R2| W| MSDU length | TID |MC|D|S|C|L|F|R|M|
  18787. * |-------------------------------------------------+---------+-|
  18788. * | rsvd3 | err info|E|
  18789. * |=================================================+=========+=|
  18790. * MSDU 1 | buf addr lo (bits 31:0) |
  18791. * : ... :
  18792. * | rsvd3 | err info|E|
  18793. * |-------------------------------------------------------------|
  18794. * Where:
  18795. * F = fragment
  18796. * M = MPDU retry bit
  18797. * R = raw MPDU frame
  18798. * F = first MSDU in MPDU
  18799. * L = last MSDU in MPDU
  18800. * C = MSDU continuation
  18801. * S = Souce Addr is valid
  18802. * D = Dest Addr is valid
  18803. * MC = Dest Addr is multicast / broadcast
  18804. * W = is first MSDU after WoW wakeup
  18805. * R2 = rsvd2
  18806. * E = error valid
  18807. */
  18808. /* htt_t2h_rx_data_msdu_err:
  18809. * To be filled in "htt_t2h_rx_data_msdu_info.error_info" field
  18810. * when FW forwards MSDU to host.
  18811. */
  18812. typedef enum htt_t2h_rx_data_msdu_err {
  18813. /* ERR_DECRYPT:
  18814. * FW sets this when rxdma_error_code = <enum 3 rxdma_decrypt_err>.
  18815. * host maintains error stats, recycles buffer.
  18816. */
  18817. HTT_RXDATA_ERR_DECRYPT = 0,
  18818. /* ERR_TKIP_MIC:
  18819. * FW sets this when rxdma_error_code = <enum 4 rxdma_tkip_mic_err>.
  18820. * Host maintains error stats, recycles buffer, sends notification to
  18821. * middleware.
  18822. */
  18823. HTT_RXDATA_ERR_TKIP_MIC = 1,
  18824. /* ERR_UNENCRYPTED:
  18825. * FW sets this when rxdma_error_code = <enum 5 rxdma_unecrypted_err>.
  18826. * Host maintains error stats, recycles buffer.
  18827. */
  18828. HTT_RXDATA_ERR_UNENCRYPTED = 2,
  18829. /* ERR_MSDU_LIMIT:
  18830. * FW sets this when rxdma_error_code = <enum 7 rxdma_msdu_limit_err>.
  18831. * Host maintains error stats, recycles buffer.
  18832. */
  18833. HTT_RXDATA_ERR_MSDU_LIMIT = 3,
  18834. /* ERR_FLUSH_REQUEST:
  18835. * FW sets this when rxdma_error_code = <enum 13 rxdma_flush_request>.
  18836. * Host maintains error stats, recycles buffer.
  18837. */
  18838. HTT_RXDATA_ERR_FLUSH_REQUEST = 4,
  18839. /* ERR_OOR:
  18840. * FW full reorder layer maps this error to <enum 7 regular_frame_OOR>.
  18841. * Host maintains error stats, recycles buffer mainly for low
  18842. * TCP KPI debugging.
  18843. */
  18844. HTT_RXDATA_ERR_OOR = 5,
  18845. /* ERR_2K_JUMP:
  18846. * FW full reorder layer maps this error to <enum 5 regular_frame_2k_jump>.
  18847. * Host maintains error stats, recycles buffer mainly for low
  18848. * TCP KPI debugging.
  18849. */
  18850. HTT_RXDATA_ERR_2K_JUMP = 6,
  18851. /* ERR_ZERO_LEN_MSDU:
  18852. * FW sets this error flag for a 0 length MSDU.
  18853. * Host maintains error stats, recycles buffer.
  18854. */
  18855. HTT_RXDATA_ERR_ZERO_LEN_MSDU = 7,
  18856. /* add new error codes here */
  18857. HTT_RXDATA_ERR_MAX = 32
  18858. } htt_t2h_rx_data_msdu_err_e;
  18859. struct htt_t2h_rx_data_ind_t
  18860. {
  18861. A_UINT32 /* word 0 */
  18862. /* msg_type:
  18863. * Set to Rx data indication i.e. HTT_T2H_MSG_TYPE_RX_DATA_IND.
  18864. */
  18865. msg_type: 8,
  18866. peer_id: 16, /* This will provide peer data */
  18867. vdev_id: 8; /* This will provide vdev id info */
  18868. A_UINT32 /* word 1 */
  18869. /* msdu_cnt:
  18870. * Total number of MSDUs (htt_t2h_rx_data_msdu_info items) in message.
  18871. */
  18872. msdu_cnt: 8,
  18873. frag: 1, /* this bit will be set for 802.11 frag MPDU */
  18874. rsvd0: 23;
  18875. /* NOTE:
  18876. * To preserve backwards compatibility,
  18877. * no new fields can be added in this struct.
  18878. */
  18879. };
  18880. struct htt_t2h_rx_data_msdu_info
  18881. {
  18882. A_UINT32 /* word 0 */
  18883. buffer_addr_low : 32;
  18884. A_UINT32 /* word 1 */
  18885. buffer_addr_high : 8,
  18886. sw_buffer_cookie : 21,
  18887. rsvd1 : 3;
  18888. A_UINT32 /* word 2 */
  18889. mpdu_retry_bit : 1, /* used for stats maintenance */
  18890. raw_mpdu_frame : 1, /* used for pkt drop and processing */
  18891. first_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  18892. last_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  18893. msdu_continuation : 1, /* used for MSDU scatter/gather support */
  18894. sa_is_valid : 1, /* used for HW issue check in
  18895. * is_sa_da_idx_valid() */
  18896. da_is_valid : 1, /* used for HW issue check and
  18897. * intra-BSS forwarding */
  18898. da_is_mcbc : 1,
  18899. tid_info : 8, /* used for stats maintenance */
  18900. msdu_length : 14,
  18901. is_first_pkt_after_wkp : 1, /* indicates this is the first rx MSDU
  18902. * provided by fw after WoW exit */
  18903. rsvd2 : 1;
  18904. A_UINT32 /* word 3 */
  18905. error_valid : 1, /* Set if the MSDU has any error */
  18906. error_info : 5, /* If error_valid is TRUE, then refer to
  18907. * "htt_t2h_rx_data_msdu_err_e" for
  18908. * checking error reason. */
  18909. rsvd3 : 26;
  18910. /* NOTE:
  18911. * To preserve backwards compatibility,
  18912. * no new fields can be added in this struct.
  18913. */
  18914. };
  18915. /* HTT_RX_DATA_IND_HDR_SIZE: 2 4-byte words
  18916. * This is the size of htt_t2h_rx_data_ind_t alone which is fixed overhead
  18917. * for every Rx DATA IND sent by FW to host.
  18918. */
  18919. #define HTT_RX_DATA_IND_HDR_SIZE (2*4)
  18920. /* HTT_RX_DATA_MSDU_INFO_SIZE: 4 4-bytes words
  18921. * This is the size of each MSDU detail that will be piggybacked with the
  18922. * RX IND header.
  18923. */
  18924. #define HTT_RX_DATA_MSDU_INFO_SIZE (4*4)
  18925. /* member definitions of htt_t2h_rx_data_ind_t */
  18926. #define HTT_RX_DATA_IND_PEER_ID_M 0x00ffff00
  18927. #define HTT_RX_DATA_IND_PEER_ID_S 8
  18928. #define HTT_RX_DATA_IND_PEER_ID_SET(word, value) \
  18929. do { \
  18930. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_PEER_ID, value); \
  18931. (word) |= (value) << HTT_RX_DATA_IND_PEER_ID_S; \
  18932. } while (0)
  18933. #define HTT_RX_DATA_IND_PEER_ID_GET(word) \
  18934. (((word) & HTT_RX_DATA_IND_PEER_ID_M) >> HTT_RX_DATA_IND_PEER_ID_S)
  18935. #define HTT_RX_DATA_IND_VDEV_ID_M 0xff000000
  18936. #define HTT_RX_DATA_IND_VDEV_ID_S 24
  18937. #define HTT_RX_DATA_IND_VDEV_ID_SET(word, value) \
  18938. do { \
  18939. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_VDEV_ID, value); \
  18940. (word) |= (value) << HTT_RX_DATA_IND_VDEV_ID_S; \
  18941. } while (0)
  18942. #define HTT_RX_DATA_IND_VDEV_ID_GET(word) \
  18943. (((word) & HTT_RX_DATA_IND_VDEV_ID_M) >> HTT_RX_DATA_IND_VDEV_ID_S)
  18944. #define HTT_RX_DATA_IND_MSDU_CNT_M 0x000000ff
  18945. #define HTT_RX_DATA_IND_MSDU_CNT_S 0
  18946. #define HTT_RX_DATA_IND_MSDU_CNT_SET(word, value) \
  18947. do { \
  18948. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_MSDU_CNT, value); \
  18949. (word) |= (value) << HTT_RX_DATA_IND_MSDU_CNT_S; \
  18950. } while (0)
  18951. #define HTT_RX_DATA_IND_MSDU_CNT_GET(word) \
  18952. (((word) & HTT_RX_DATA_IND_MSDU_CNT_M) >> HTT_RX_DATA_IND_MSDU_CNT_S)
  18953. #define HTT_RX_DATA_IND_FRAG_M 0x00000100
  18954. #define HTT_RX_DATA_IND_FRAG_S 8
  18955. #define HTT_RX_DATA_IND_FRAG_SET(word, value) \
  18956. do { \
  18957. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_FRAG, value); \
  18958. (word) |= (value) << HTT_RX_DATA_IND_FRAG_S; \
  18959. } while (0)
  18960. #define HTT_RX_DATA_IND_FRAG_GET(word) \
  18961. (((word) & HTT_RX_DATA_IND_FRAG_M) >> HTT_RX_DATA_IND_FRAG_S)
  18962. /* member definitions of htt_t2h_rx_data_msdu_info */
  18963. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M 0xFFFFFFFF
  18964. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S 0
  18965. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M 0x000000FF
  18966. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S 0
  18967. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_SET(word, value) \
  18968. do { \
  18969. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW, value); \
  18970. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S; \
  18971. } while (0)
  18972. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_GET(word) \
  18973. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S)
  18974. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_SET(word, value) \
  18975. do { \
  18976. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH, value); \
  18977. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S; \
  18978. } while (0)
  18979. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_GET(word) \
  18980. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S)
  18981. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M 0x1FFFFF00
  18982. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S 8
  18983. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  18984. do { \
  18985. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE, value); \
  18986. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S; \
  18987. } while (0)
  18988. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_GET(word) \
  18989. (((word) & HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M) >> HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S)
  18990. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M 0x00000001
  18991. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S 0
  18992. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_SET(word, value) \
  18993. do { \
  18994. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT, value); \
  18995. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S; \
  18996. } while (0)
  18997. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_GET(word) \
  18998. (((word) & HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M) >> HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S)
  18999. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M 0x00000002
  19000. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S 1
  19001. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_SET(word, value) \
  19002. do { \
  19003. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME, value); \
  19004. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S; \
  19005. } while (0)
  19006. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_GET(word) \
  19007. (((word) & HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M) >> HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S)
  19008. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M 0x00000004
  19009. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S 2
  19010. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_SET(word, value) \
  19011. do { \
  19012. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU, value); \
  19013. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S; \
  19014. } while (0)
  19015. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_GET(word) \
  19016. (((word) & HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S)
  19017. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M 0x00000008
  19018. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S 3
  19019. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_SET(word, value) \
  19020. do { \
  19021. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU, value); \
  19022. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S; \
  19023. } while (0)
  19024. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_GET(word) \
  19025. (((word) & HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S)
  19026. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M 0x00000010
  19027. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S 4
  19028. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_SET(word, value) \
  19029. do { \
  19030. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION, value); \
  19031. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S; \
  19032. } while (0)
  19033. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_GET(word) \
  19034. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S)
  19035. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M 0x00000020
  19036. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S 5
  19037. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_SET(word, value) \
  19038. do { \
  19039. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SA_IS_VALID, value); \
  19040. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S; \
  19041. } while (0)
  19042. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_GET(word) \
  19043. (((word) & HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S)
  19044. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M 0x00000040
  19045. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S 6
  19046. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_SET(word, value) \
  19047. do { \
  19048. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_VALID, value); \
  19049. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S; \
  19050. } while (0)
  19051. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_GET(word) \
  19052. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S)
  19053. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M 0x00000080
  19054. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S 7
  19055. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_SET(word, value) \
  19056. do { \
  19057. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC, value); \
  19058. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S; \
  19059. } while (0)
  19060. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_GET(word) \
  19061. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S)
  19062. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_M 0x0000FF00
  19063. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_S 8
  19064. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_SET(word, value) \
  19065. do { \
  19066. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_TID_INFO, value); \
  19067. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_TID_INFO_S; \
  19068. } while (0)
  19069. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_GET(word) \
  19070. (((word) & HTT_RX_DATA_MSDU_INFO_TID_INFO_M) >> HTT_RX_DATA_MSDU_INFO_TID_INFO_S)
  19071. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M 0x3FFF0000
  19072. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S 16
  19073. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_SET(word, value) \
  19074. do { \
  19075. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH, value); \
  19076. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S; \
  19077. } while (0)
  19078. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_GET(word) \
  19079. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S)
  19080. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M 0x40000000
  19081. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S 30
  19082. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_SET(word, value) \
  19083. do { \
  19084. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP, value); \
  19085. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S; \
  19086. } while (0)
  19087. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_GET(word) \
  19088. (((word) & HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M) >> HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S)
  19089. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M 0x00000001
  19090. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S 0
  19091. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_SET(word, value) \
  19092. do { \
  19093. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_VALID, value); \
  19094. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S; \
  19095. } while (0)
  19096. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_GET(word) \
  19097. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S)
  19098. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M 0x0000001E
  19099. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S 1
  19100. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_SET(word, value) \
  19101. do { \
  19102. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_INFO, value); \
  19103. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S; \
  19104. } while (0)
  19105. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_GET(word) \
  19106. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S)
  19107. #endif