htt.h 878 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. */
  231. #define HTT_CURRENT_VERSION_MAJOR 3
  232. #define HTT_CURRENT_VERSION_MINOR 109
  233. #define HTT_NUM_TX_FRAG_DESC 1024
  234. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  235. #define HTT_CHECK_SET_VAL(field, val) \
  236. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  237. /* macros to assist in sign-extending fields from HTT messages */
  238. #define HTT_SIGN_BIT_MASK(field) \
  239. ((field ## _M + (1 << field ## _S)) >> 1)
  240. #define HTT_SIGN_BIT(_val, field) \
  241. (_val & HTT_SIGN_BIT_MASK(field))
  242. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  243. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  244. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  245. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  246. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  247. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  248. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  249. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  250. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  251. /*
  252. * TEMPORARY:
  253. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  254. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  255. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  256. * updated.
  257. */
  258. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  259. /*
  260. * TEMPORARY:
  261. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  262. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  263. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  264. * updated.
  265. */
  266. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  267. /**
  268. * htt_dbg_stats_type -
  269. * bit positions for each stats type within a stats type bitmask
  270. * The bitmask contains 24 bits.
  271. */
  272. enum htt_dbg_stats_type {
  273. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  274. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  275. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  276. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  277. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  278. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  279. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  280. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  281. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  282. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  283. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  284. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  285. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  286. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  287. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  288. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  289. /* bits 16-23 currently reserved */
  290. /* keep this last */
  291. HTT_DBG_NUM_STATS
  292. };
  293. /*=== HTT option selection TLVs ===
  294. * Certain HTT messages have alternatives or options.
  295. * For such cases, the host and target need to agree on which option to use.
  296. * Option specification TLVs can be appended to the VERSION_REQ and
  297. * VERSION_CONF messages to select options other than the default.
  298. * These TLVs are entirely optional - if they are not provided, there is a
  299. * well-defined default for each option. If they are provided, they can be
  300. * provided in any order. Each TLV can be present or absent independent of
  301. * the presence / absence of other TLVs.
  302. *
  303. * The HTT option selection TLVs use the following format:
  304. * |31 16|15 8|7 0|
  305. * |---------------------------------+----------------+----------------|
  306. * | value (payload) | length | tag |
  307. * |-------------------------------------------------------------------|
  308. * The value portion need not be only 2 bytes; it can be extended by any
  309. * integer number of 4-byte units. The total length of the TLV, including
  310. * the tag and length fields, must be a multiple of 4 bytes. The length
  311. * field specifies the total TLV size in 4-byte units. Thus, the typical
  312. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  313. * field, would store 0x1 in its length field, to show that the TLV occupies
  314. * a single 4-byte unit.
  315. */
  316. /*--- TLV header format - applies to all HTT option TLVs ---*/
  317. enum HTT_OPTION_TLV_TAGS {
  318. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  319. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  320. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  321. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  322. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  323. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  324. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  325. };
  326. #define HTT_TCL_METADATA_VER_SZ 4
  327. PREPACK struct htt_option_tlv_header_t {
  328. A_UINT8 tag;
  329. A_UINT8 length;
  330. } POSTPACK;
  331. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  332. #define HTT_OPTION_TLV_TAG_S 0
  333. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  334. #define HTT_OPTION_TLV_LENGTH_S 8
  335. /*
  336. * value0 - 16 bit value field stored in word0
  337. * The TLV's value field may be longer than 2 bytes, in which case
  338. * the remainder of the value is stored in word1, word2, etc.
  339. */
  340. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  341. #define HTT_OPTION_TLV_VALUE0_S 16
  342. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_TAG_GET(word) \
  348. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  349. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  350. do { \
  351. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  352. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  353. } while (0)
  354. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  355. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  356. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  357. do { \
  358. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  359. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  360. } while (0)
  361. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  362. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  363. /*--- format of specific HTT option TLVs ---*/
  364. /*
  365. * HTT option TLV for specifying LL bus address size
  366. * Some chips require bus addresses used by the target to access buffers
  367. * within the host's memory to be 32 bits; others require bus addresses
  368. * used by the target to access buffers within the host's memory to be
  369. * 64 bits.
  370. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  371. * a suffix to the VERSION_CONF message to specify which bus address format
  372. * the target requires.
  373. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  374. * default to providing bus addresses to the target in 32-bit format.
  375. */
  376. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  377. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  378. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  379. };
  380. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  381. struct htt_option_tlv_header_t hdr;
  382. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  383. } POSTPACK;
  384. /*
  385. * HTT option TLV for specifying whether HL systems should indicate
  386. * over-the-air tx completion for individual frames, or should instead
  387. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  388. * requests an OTA tx completion for a particular tx frame.
  389. * This option does not apply to LL systems, where the TX_COMPL_IND
  390. * is mandatory.
  391. * This option is primarily intended for HL systems in which the tx frame
  392. * downloads over the host --> target bus are as slow as or slower than
  393. * the transmissions over the WLAN PHY. For cases where the bus is faster
  394. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  395. * and consquently will send one TX_COMPL_IND message that covers several
  396. * tx frames. For cases where the WLAN PHY is faster than the bus,
  397. * the target will end up transmitting very short A-MPDUs, and consequently
  398. * sending many TX_COMPL_IND messages, which each cover a very small number
  399. * of tx frames.
  400. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  401. * a suffix to the VERSION_REQ message to request whether the host desires to
  402. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  403. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  404. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  405. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  406. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  407. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  408. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  409. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  410. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  411. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  412. * TLV.
  413. */
  414. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  415. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  416. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  417. };
  418. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  419. struct htt_option_tlv_header_t hdr;
  420. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  421. } POSTPACK;
  422. /*
  423. * HTT option TLV for specifying how many tx queue groups the target
  424. * may establish.
  425. * This TLV specifies the maximum value the target may send in the
  426. * txq_group_id field of any TXQ_GROUP information elements sent by
  427. * the target to the host. This allows the host to pre-allocate an
  428. * appropriate number of tx queue group structs.
  429. *
  430. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  431. * a suffix to the VERSION_REQ message to specify whether the host supports
  432. * tx queue groups at all, and if so if there is any limit on the number of
  433. * tx queue groups that the host supports.
  434. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  435. * a suffix to the VERSION_CONF message. If the host has specified in the
  436. * VER_REQ message a limit on the number of tx queue groups the host can
  437. * supprt, the target shall limit its specification of the maximum tx groups
  438. * to be no larger than this host-specified limit.
  439. *
  440. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  441. * shall preallocate 4 tx queue group structs, and the target shall not
  442. * specify a txq_group_id larger than 3.
  443. */
  444. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  445. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  446. /*
  447. * values 1 through N specify the max number of tx queue groups
  448. * the sender supports
  449. */
  450. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  451. };
  452. /* TEMPORARY backwards-compatibility alias for a typo fix -
  453. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  454. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  455. * to support the old name (with the typo) until all references to the
  456. * old name are replaced with the new name.
  457. */
  458. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  459. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  460. struct htt_option_tlv_header_t hdr;
  461. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  462. } POSTPACK;
  463. /*
  464. * HTT option TLV for specifying whether the target supports an extended
  465. * version of the HTT tx descriptor. If the target provides this TLV
  466. * and specifies in the TLV that the target supports an extended version
  467. * of the HTT tx descriptor, the target must check the "extension" bit in
  468. * the HTT tx descriptor, and if the extension bit is set, to expect a
  469. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  470. * descriptor. Furthermore, the target must provide room for the HTT
  471. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  472. * This option is intended for systems where the host needs to explicitly
  473. * control the transmission parameters such as tx power for individual
  474. * tx frames.
  475. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  476. * as a suffix to the VERSION_CONF message to explicitly specify whether
  477. * the target supports the HTT tx MSDU extension descriptor.
  478. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  479. * by the host as lack of target support for the HTT tx MSDU extension
  480. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  481. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  482. * the HTT tx MSDU extension descriptor.
  483. * The host is not required to provide the HTT tx MSDU extension descriptor
  484. * just because the target supports it; the target must check the
  485. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  486. * extension descriptor is present.
  487. */
  488. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  489. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  490. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  491. };
  492. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  493. struct htt_option_tlv_header_t hdr;
  494. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  495. } POSTPACK;
  496. /*
  497. * For the tcl data command V2 and higher support added a new
  498. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  499. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  500. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  501. * HTT option TLV for specifying which version of the TCL metadata struct
  502. * should be used:
  503. * V1 -> use htt_tx_tcl_metadata struct
  504. * V2 -> use htt_tx_tcl_metadata_v2 struct
  505. * Old FW will only support V1.
  506. * New FW will support V2. New FW will still support V1, at least during
  507. * a transition period.
  508. * Similarly, old host will only support V1, and new host will support V1 + V2.
  509. *
  510. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  511. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  512. * of TCL metadata the host supports. If the host doesn't provide a
  513. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  514. * is implicitly understood that the host only supports V1.
  515. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  516. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  517. * the host shall use. The target shall only select one of the versions
  518. * supported by the host. If the target doesn't provide a
  519. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  520. * is implicitly understood that the V1 TCL metadata shall be used.
  521. */
  522. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  523. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  524. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  525. };
  526. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  527. struct htt_option_tlv_header_t hdr;
  528. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  529. } POSTPACK;
  530. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  531. HTT_OPTION_TLV_VALUE0_SET(word, value)
  532. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  533. HTT_OPTION_TLV_VALUE0_GET(word)
  534. typedef struct {
  535. union {
  536. /* BIT [11 : 0] :- tag
  537. * BIT [23 : 12] :- length
  538. * BIT [31 : 24] :- reserved
  539. */
  540. A_UINT32 tag__length;
  541. /*
  542. * The following struct is not endian-portable.
  543. * It is suitable for use within the target, which is known to be
  544. * little-endian.
  545. * The host should use the above endian-portable macros to access
  546. * the tag and length bitfields in an endian-neutral manner.
  547. */
  548. struct {
  549. A_UINT32 tag : 12, /* BIT [11 : 0] */
  550. length : 12, /* BIT [23 : 12] */
  551. reserved : 8; /* BIT [31 : 24] */
  552. };
  553. };
  554. } htt_tlv_hdr_t;
  555. /** HTT stats TLV tag values */
  556. typedef enum {
  557. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  558. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  559. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  560. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  561. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  562. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  563. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  564. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  565. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  566. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  567. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  568. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  569. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  570. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  571. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  572. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  573. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  574. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  575. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  576. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  577. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  578. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  579. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  580. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  581. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  582. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  583. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  584. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  585. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  586. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  587. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  588. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  589. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  590. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  591. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  592. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  593. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  594. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  595. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  596. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  597. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  598. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  599. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  600. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  601. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  602. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  603. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  604. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  605. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  606. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  607. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  608. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  609. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  610. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  611. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  612. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  613. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  614. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  615. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  616. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  617. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  618. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  619. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  620. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  621. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  622. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  623. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  624. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  625. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  626. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  627. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  628. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  629. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  630. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  631. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  632. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  633. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  634. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  635. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  636. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  637. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  638. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  639. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  640. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  641. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  642. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  643. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  644. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  645. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  646. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  647. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  648. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  649. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  650. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  651. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  652. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  653. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  654. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  655. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  656. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  657. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  658. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  659. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  660. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  661. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  662. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  663. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  664. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  665. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  666. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  667. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  668. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  669. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  670. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  671. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  672. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  673. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  674. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  675. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  676. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  677. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  678. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  679. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  680. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  681. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  682. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  683. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  684. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  685. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  686. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  687. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  688. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  689. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  690. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  691. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  692. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  693. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  694. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  696. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  697. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  698. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  699. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  700. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  701. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  702. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  703. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  704. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  705. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  712. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  713. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  714. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  715. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  716. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  717. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  718. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  719. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  720. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  721. HTT_STATS_MAX_TAG,
  722. } htt_stats_tlv_tag_t;
  723. /* retain deprecated enum name as an alias for the current enum name */
  724. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  725. #define HTT_STATS_TLV_TAG_M 0x00000fff
  726. #define HTT_STATS_TLV_TAG_S 0
  727. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  728. #define HTT_STATS_TLV_LENGTH_S 12
  729. #define HTT_STATS_TLV_TAG_GET(_var) \
  730. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  731. HTT_STATS_TLV_TAG_S)
  732. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  733. do { \
  734. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  735. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  736. } while (0)
  737. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  738. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  739. HTT_STATS_TLV_LENGTH_S)
  740. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  741. do { \
  742. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  743. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  744. } while (0)
  745. /*=== host -> target messages ===============================================*/
  746. enum htt_h2t_msg_type {
  747. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  748. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  749. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  750. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  751. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  752. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  753. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  754. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  755. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  756. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  757. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  758. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  759. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  760. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  761. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  762. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  763. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  764. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  765. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  766. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  767. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  768. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  769. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  770. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  771. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  772. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  773. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  774. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  775. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  776. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  777. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  778. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  779. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  780. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  781. /* keep this last */
  782. HTT_H2T_NUM_MSGS
  783. };
  784. /*
  785. * HTT host to target message type -
  786. * stored in bits 7:0 of the first word of the message
  787. */
  788. #define HTT_H2T_MSG_TYPE_M 0xff
  789. #define HTT_H2T_MSG_TYPE_S 0
  790. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  791. do { \
  792. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  793. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  794. } while (0)
  795. #define HTT_H2T_MSG_TYPE_GET(word) \
  796. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  797. /**
  798. * @brief host -> target version number request message definition
  799. *
  800. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  801. *
  802. *
  803. * |31 24|23 16|15 8|7 0|
  804. * |----------------+----------------+----------------+----------------|
  805. * | reserved | msg type |
  806. * |-------------------------------------------------------------------|
  807. * : option request TLV (optional) |
  808. * :...................................................................:
  809. *
  810. * The VER_REQ message may consist of a single 4-byte word, or may be
  811. * extended with TLVs that specify which HTT options the host is requesting
  812. * from the target.
  813. * The following option TLVs may be appended to the VER_REQ message:
  814. * - HL_SUPPRESS_TX_COMPL_IND
  815. * - HL_MAX_TX_QUEUE_GROUPS
  816. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  817. * may be appended to the VER_REQ message (but only one TLV of each type).
  818. *
  819. * Header fields:
  820. * - MSG_TYPE
  821. * Bits 7:0
  822. * Purpose: identifies this as a version number request message
  823. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  824. */
  825. #define HTT_VER_REQ_BYTES 4
  826. /* TBDXXX: figure out a reasonable number */
  827. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  828. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  829. /**
  830. * @brief HTT tx MSDU descriptor
  831. *
  832. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  833. *
  834. * @details
  835. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  836. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  837. * the target firmware needs for the FW's tx processing, particularly
  838. * for creating the HW msdu descriptor.
  839. * The same HTT tx descriptor is used for HL and LL systems, though
  840. * a few fields within the tx descriptor are used only by LL or
  841. * only by HL.
  842. * The HTT tx descriptor is defined in two manners: by a struct with
  843. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  844. * definitions.
  845. * The target should use the struct def, for simplicitly and clarity,
  846. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  847. * neutral. Specifically, the host shall use the get/set macros built
  848. * around the mask + shift defs.
  849. */
  850. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  851. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  852. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  853. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  854. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  855. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  856. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  857. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  858. #define HTT_TX_VDEV_ID_WORD 0
  859. #define HTT_TX_VDEV_ID_MASK 0x3f
  860. #define HTT_TX_VDEV_ID_SHIFT 16
  861. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  862. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  863. #define HTT_TX_MSDU_LEN_DWORD 1
  864. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  865. /*
  866. * HTT_VAR_PADDR macros
  867. * Allow physical / bus addresses to be either a single 32-bit value,
  868. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  869. */
  870. #define HTT_VAR_PADDR32(var_name) \
  871. A_UINT32 var_name
  872. #define HTT_VAR_PADDR64_LE(var_name) \
  873. struct { \
  874. /* little-endian: lo precedes hi */ \
  875. A_UINT32 lo; \
  876. A_UINT32 hi; \
  877. } var_name
  878. /*
  879. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  880. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  881. * addresses are stored in a XXX-bit field.
  882. * This macro is used to define both htt_tx_msdu_desc32_t and
  883. * htt_tx_msdu_desc64_t structs.
  884. */
  885. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  886. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  887. { \
  888. /* DWORD 0: flags and meta-data */ \
  889. A_UINT32 \
  890. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  891. \
  892. /* pkt_subtype - \
  893. * Detailed specification of the tx frame contents, extending the \
  894. * general specification provided by pkt_type. \
  895. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  896. * pkt_type | pkt_subtype \
  897. * ============================================================== \
  898. * 802.3 | bit 0:3 - Reserved \
  899. * | bit 4: 0x0 - Copy-Engine Classification Results \
  900. * | not appended to the HTT message \
  901. * | 0x1 - Copy-Engine Classification Results \
  902. * | appended to the HTT message in the \
  903. * | format: \
  904. * | [HTT tx desc, frame header, \
  905. * | CE classification results] \
  906. * | The CE classification results begin \
  907. * | at the next 4-byte boundary after \
  908. * | the frame header. \
  909. * ------------+------------------------------------------------- \
  910. * Eth2 | bit 0:3 - Reserved \
  911. * | bit 4: 0x0 - Copy-Engine Classification Results \
  912. * | not appended to the HTT message \
  913. * | 0x1 - Copy-Engine Classification Results \
  914. * | appended to the HTT message. \
  915. * | See the above specification of the \
  916. * | CE classification results location. \
  917. * ------------+------------------------------------------------- \
  918. * native WiFi | bit 0:3 - Reserved \
  919. * | bit 4: 0x0 - Copy-Engine Classification Results \
  920. * | not appended to the HTT message \
  921. * | 0x1 - Copy-Engine Classification Results \
  922. * | appended to the HTT message. \
  923. * | See the above specification of the \
  924. * | CE classification results location. \
  925. * ------------+------------------------------------------------- \
  926. * mgmt | 0x0 - 802.11 MAC header absent \
  927. * | 0x1 - 802.11 MAC header present \
  928. * ------------+------------------------------------------------- \
  929. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  930. * | 0x1 - 802.11 MAC header present \
  931. * | bit 1: 0x0 - allow aggregation \
  932. * | 0x1 - don't allow aggregation \
  933. * | bit 2: 0x0 - perform encryption \
  934. * | 0x1 - don't perform encryption \
  935. * | bit 3: 0x0 - perform tx classification / queuing \
  936. * | 0x1 - don't perform tx classification; \
  937. * | insert the frame into the "misc" \
  938. * | tx queue \
  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. pkt_subtype: 5, \
  947. \
  948. /* pkt_type - \
  949. * General specification of the tx frame contents. \
  950. * The htt_pkt_type enum should be used to specify and check the \
  951. * value of this field. \
  952. */ \
  953. pkt_type: 3, \
  954. \
  955. /* vdev_id - \
  956. * ID for the vdev that is sending this tx frame. \
  957. * For certain non-standard packet types, e.g. pkt_type == raw \
  958. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  959. * This field is used primarily for determining where to queue \
  960. * broadcast and multicast frames. \
  961. */ \
  962. vdev_id: 6, \
  963. /* ext_tid - \
  964. * The extended traffic ID. \
  965. * If the TID is unknown, the extended TID is set to \
  966. * HTT_TX_EXT_TID_INVALID. \
  967. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  968. * value of the QoS TID. \
  969. * If the tx frame is non-QoS data, then the extended TID is set to \
  970. * HTT_TX_EXT_TID_NON_QOS. \
  971. * If the tx frame is multicast or broadcast, then the extended TID \
  972. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  973. */ \
  974. ext_tid: 5, \
  975. \
  976. /* postponed - \
  977. * This flag indicates whether the tx frame has been downloaded to \
  978. * the target before but discarded by the target, and now is being \
  979. * downloaded again; or if this is a new frame that is being \
  980. * downloaded for the first time. \
  981. * This flag allows the target to determine the correct order for \
  982. * transmitting new vs. old frames. \
  983. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  984. * This flag only applies to HL systems, since in LL systems, \
  985. * the tx flow control is handled entirely within the target. \
  986. */ \
  987. postponed: 1, \
  988. \
  989. /* extension - \
  990. * This flag indicates whether a HTT tx MSDU extension descriptor \
  991. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  992. * \
  993. * 0x0 - no extension MSDU descriptor is present \
  994. * 0x1 - an extension MSDU descriptor immediately follows the \
  995. * regular MSDU descriptor \
  996. */ \
  997. extension: 1, \
  998. \
  999. /* cksum_offload - \
  1000. * This flag indicates whether checksum offload is enabled or not \
  1001. * for this frame. Target FW use this flag to turn on HW checksumming \
  1002. * 0x0 - No checksum offload \
  1003. * 0x1 - L3 header checksum only \
  1004. * 0x2 - L4 checksum only \
  1005. * 0x3 - L3 header checksum + L4 checksum \
  1006. */ \
  1007. cksum_offload: 2, \
  1008. \
  1009. /* tx_comp_req - \
  1010. * This flag indicates whether Tx Completion \
  1011. * from fw is required or not. \
  1012. * This flag is only relevant if tx completion is not \
  1013. * universally enabled. \
  1014. * For all LL systems, tx completion is mandatory, \
  1015. * so this flag will be irrelevant. \
  1016. * For HL systems tx completion is optional, but HL systems in which \
  1017. * the bus throughput exceeds the WLAN throughput will \
  1018. * probably want to always use tx completion, and thus \
  1019. * would not check this flag. \
  1020. * This flag is required when tx completions are not used universally, \
  1021. * but are still required for certain tx frames for which \
  1022. * an OTA delivery acknowledgment is needed by the host. \
  1023. * In practice, this would be for HL systems in which the \
  1024. * bus throughput is less than the WLAN throughput. \
  1025. * \
  1026. * 0x0 - Tx Completion Indication from Fw not required \
  1027. * 0x1 - Tx Completion Indication from Fw is required \
  1028. */ \
  1029. tx_compl_req: 1; \
  1030. \
  1031. \
  1032. /* DWORD 1: MSDU length and ID */ \
  1033. A_UINT32 \
  1034. len: 16, /* MSDU length, in bytes */ \
  1035. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1036. * and this id is used to calculate fragmentation \
  1037. * descriptor pointer inside the target based on \
  1038. * the base address, configured inside the target. \
  1039. */ \
  1040. \
  1041. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1042. /* frags_desc_ptr - \
  1043. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1044. * where the tx frame's fragments reside in memory. \
  1045. * This field only applies to LL systems, since in HL systems the \
  1046. * (degenerate single-fragment) fragmentation descriptor is created \
  1047. * within the target. \
  1048. */ \
  1049. _paddr__frags_desc_ptr_; \
  1050. \
  1051. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1052. /* \
  1053. * Peer ID : Target can use this value to know which peer-id packet \
  1054. * destined to. \
  1055. * It's intended to be specified by host in case of NAWDS. \
  1056. */ \
  1057. A_UINT16 peerid; \
  1058. \
  1059. /* \
  1060. * Channel frequency: This identifies the desired channel \
  1061. * frequency (in mhz) for tx frames. This is used by FW to help \
  1062. * determine when it is safe to transmit or drop frames for \
  1063. * off-channel operation. \
  1064. * The default value of zero indicates to FW that the corresponding \
  1065. * VDEV's home channel (if there is one) is the desired channel \
  1066. * frequency. \
  1067. */ \
  1068. A_UINT16 chanfreq; \
  1069. \
  1070. /* Reason reserved is commented is increasing the htt structure size \
  1071. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1072. * A_UINT32 reserved_dword3_bits0_31; \
  1073. */ \
  1074. } POSTPACK
  1075. /* define a htt_tx_msdu_desc32_t type */
  1076. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1077. /* define a htt_tx_msdu_desc64_t type */
  1078. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1079. /*
  1080. * Make htt_tx_msdu_desc_t be an alias for either
  1081. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1082. */
  1083. #if HTT_PADDR64
  1084. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1085. #else
  1086. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1087. #endif
  1088. /* decriptor information for Management frame*/
  1089. /*
  1090. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1091. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1092. */
  1093. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1094. extern A_UINT32 mgmt_hdr_len;
  1095. PREPACK struct htt_mgmt_tx_desc_t {
  1096. A_UINT32 msg_type;
  1097. #if HTT_PADDR64
  1098. A_UINT64 frag_paddr; /* DMAble address of the data */
  1099. #else
  1100. A_UINT32 frag_paddr; /* DMAble address of the data */
  1101. #endif
  1102. A_UINT32 desc_id; /* returned to host during completion
  1103. * to free the meory*/
  1104. A_UINT32 len; /* Fragment length */
  1105. A_UINT32 vdev_id; /* virtual device ID*/
  1106. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1107. } POSTPACK;
  1108. PREPACK struct htt_mgmt_tx_compl_ind {
  1109. A_UINT32 desc_id;
  1110. A_UINT32 status;
  1111. } POSTPACK;
  1112. /*
  1113. * This SDU header size comes from the summation of the following:
  1114. * 1. Max of:
  1115. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1116. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1117. * b. 802.11 header, for raw frames: 36 bytes
  1118. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1119. * QoS header, HT header)
  1120. * c. 802.3 header, for ethernet frames: 14 bytes
  1121. * (destination address, source address, ethertype / length)
  1122. * 2. Max of:
  1123. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1124. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1125. * 3. 802.1Q VLAN header: 4 bytes
  1126. * 4. LLC/SNAP header: 8 bytes
  1127. */
  1128. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1129. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1130. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1131. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1132. A_COMPILE_TIME_ASSERT(
  1133. htt_encap_hdr_size_max_check_nwifi,
  1134. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1135. A_COMPILE_TIME_ASSERT(
  1136. htt_encap_hdr_size_max_check_enet,
  1137. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1138. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1139. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1140. #define HTT_TX_HDR_SIZE_802_1Q 4
  1141. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1142. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1143. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1144. HTT_TX_HDR_SIZE_802_1Q + \
  1145. HTT_TX_HDR_SIZE_LLC_SNAP)
  1146. #define HTT_HL_TX_FRM_HDR_LEN \
  1147. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1148. #define HTT_LL_TX_FRM_HDR_LEN \
  1149. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1150. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1151. /* dword 0 */
  1152. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1153. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1154. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1155. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1156. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1157. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1158. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1159. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1160. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1161. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1162. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1163. #define HTT_TX_DESC_PKT_TYPE_S 13
  1164. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1165. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1166. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1167. #define HTT_TX_DESC_VDEV_ID_S 16
  1168. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1169. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1170. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1171. #define HTT_TX_DESC_EXT_TID_S 22
  1172. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1173. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1174. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1175. #define HTT_TX_DESC_POSTPONED_S 27
  1176. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1177. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1178. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1179. #define HTT_TX_DESC_EXTENSION_S 28
  1180. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1181. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1182. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1183. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1184. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1185. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1186. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1187. #define HTT_TX_DESC_TX_COMP_S 31
  1188. /* dword 1 */
  1189. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1190. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1191. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1192. #define HTT_TX_DESC_FRM_LEN_S 0
  1193. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1194. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1195. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1196. #define HTT_TX_DESC_FRM_ID_S 16
  1197. /* dword 2 */
  1198. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1199. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1200. /* for systems using 64-bit format for bus addresses */
  1201. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1202. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1203. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1204. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1205. /* for systems using 32-bit format for bus addresses */
  1206. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1207. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1208. /* dword 3 */
  1209. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1210. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1211. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1212. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1213. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1214. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1215. #if HTT_PADDR64
  1216. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1217. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1218. #else
  1219. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1220. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1221. #endif
  1222. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1223. #define HTT_TX_DESC_PEER_ID_S 0
  1224. /*
  1225. * TEMPORARY:
  1226. * The original definitions for the PEER_ID fields contained typos
  1227. * (with _DESC_PADDR appended to this PEER_ID field name).
  1228. * Retain deprecated original names for PEER_ID fields until all code that
  1229. * refers to them has been updated.
  1230. */
  1231. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1232. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1233. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1234. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1235. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1236. HTT_TX_DESC_PEER_ID_M
  1237. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1238. HTT_TX_DESC_PEER_ID_S
  1239. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1240. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1241. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1242. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1243. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1244. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1245. #if HTT_PADDR64
  1246. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1247. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1248. #else
  1249. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1250. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1251. #endif
  1252. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1253. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1254. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1255. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1256. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1259. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1260. } while (0)
  1261. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1262. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1263. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1264. do { \
  1265. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1266. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1267. } while (0)
  1268. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1269. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1270. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1271. do { \
  1272. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1273. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1274. } while (0)
  1275. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1276. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1277. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1278. do { \
  1279. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1280. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1281. } while (0)
  1282. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1283. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1284. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1288. } while (0)
  1289. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1290. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1291. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1295. } while (0)
  1296. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1297. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1298. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1302. } while (0)
  1303. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1304. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1305. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1306. do { \
  1307. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1308. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1309. } while (0)
  1310. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1311. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1312. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1313. do { \
  1314. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1315. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1316. } while (0)
  1317. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1318. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1319. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1323. } while (0)
  1324. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1325. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1326. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1330. } while (0)
  1331. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1332. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1333. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1336. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1337. } while (0)
  1338. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1339. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1340. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1344. } while (0)
  1345. /* enums used in the HTT tx MSDU extension descriptor */
  1346. enum {
  1347. htt_tx_guard_interval_regular = 0,
  1348. htt_tx_guard_interval_short = 1,
  1349. };
  1350. enum {
  1351. htt_tx_preamble_type_ofdm = 0,
  1352. htt_tx_preamble_type_cck = 1,
  1353. htt_tx_preamble_type_ht = 2,
  1354. htt_tx_preamble_type_vht = 3,
  1355. };
  1356. enum {
  1357. htt_tx_bandwidth_5MHz = 0,
  1358. htt_tx_bandwidth_10MHz = 1,
  1359. htt_tx_bandwidth_20MHz = 2,
  1360. htt_tx_bandwidth_40MHz = 3,
  1361. htt_tx_bandwidth_80MHz = 4,
  1362. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1363. };
  1364. /**
  1365. * @brief HTT tx MSDU extension descriptor
  1366. * @details
  1367. * If the target supports HTT tx MSDU extension descriptors, the host has
  1368. * the option of appending the following struct following the regular
  1369. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1370. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1371. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1372. * tx specs for each frame.
  1373. */
  1374. PREPACK struct htt_tx_msdu_desc_ext_t {
  1375. /* DWORD 0: flags */
  1376. A_UINT32
  1377. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1378. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1379. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1380. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1381. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1382. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1383. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1384. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1385. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1386. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1387. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1388. /* DWORD 1: tx power, tx rate, tx BW */
  1389. A_UINT32
  1390. /* pwr -
  1391. * Specify what power the tx frame needs to be transmitted at.
  1392. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1393. * The value needs to be appropriately sign-extended when extracting
  1394. * the value from the message and storing it in a variable that is
  1395. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1396. * automatically handles this sign-extension.)
  1397. * If the transmission uses multiple tx chains, this power spec is
  1398. * the total transmit power, assuming incoherent combination of
  1399. * per-chain power to produce the total power.
  1400. */
  1401. pwr: 8,
  1402. /* mcs_mask -
  1403. * Specify the allowable values for MCS index (modulation and coding)
  1404. * to use for transmitting the frame.
  1405. *
  1406. * For HT / VHT preamble types, this mask directly corresponds to
  1407. * the HT or VHT MCS indices that are allowed. For each bit N set
  1408. * within the mask, MCS index N is allowed for transmitting the frame.
  1409. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1410. * rates versus OFDM rates, so the host has the option of specifying
  1411. * that the target must transmit the frame with CCK or OFDM rates
  1412. * (not HT or VHT), but leaving the decision to the target whether
  1413. * to use CCK or OFDM.
  1414. *
  1415. * For CCK and OFDM, the bits within this mask are interpreted as
  1416. * follows:
  1417. * bit 0 -> CCK 1 Mbps rate is allowed
  1418. * bit 1 -> CCK 2 Mbps rate is allowed
  1419. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1420. * bit 3 -> CCK 11 Mbps rate is allowed
  1421. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1422. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1423. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1424. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1425. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1426. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1427. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1428. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1429. *
  1430. * The MCS index specification needs to be compatible with the
  1431. * bandwidth mask specification. For example, a MCS index == 9
  1432. * specification is inconsistent with a preamble type == VHT,
  1433. * Nss == 1, and channel bandwidth == 20 MHz.
  1434. *
  1435. * Furthermore, the host has only a limited ability to specify to
  1436. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1437. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1438. */
  1439. mcs_mask: 12,
  1440. /* nss_mask -
  1441. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1442. * Each bit in this mask corresponds to a Nss value:
  1443. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1444. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1445. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1446. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1447. * The values in the Nss mask must be suitable for the recipient, e.g.
  1448. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1449. * recipient which only supports 2x2 MIMO.
  1450. */
  1451. nss_mask: 4,
  1452. /* guard_interval -
  1453. * Specify a htt_tx_guard_interval enum value to indicate whether
  1454. * the transmission should use a regular guard interval or a
  1455. * short guard interval.
  1456. */
  1457. guard_interval: 1,
  1458. /* preamble_type_mask -
  1459. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1460. * may choose from for transmitting this frame.
  1461. * The bits in this mask correspond to the values in the
  1462. * htt_tx_preamble_type enum. For example, to allow the target
  1463. * to transmit the frame as either CCK or OFDM, this field would
  1464. * be set to
  1465. * (1 << htt_tx_preamble_type_ofdm) |
  1466. * (1 << htt_tx_preamble_type_cck)
  1467. */
  1468. preamble_type_mask: 4,
  1469. reserved1_31_29: 3; /* unused, set to 0x0 */
  1470. /* DWORD 2: tx chain mask, tx retries */
  1471. A_UINT32
  1472. /* chain_mask - specify which chains to transmit from */
  1473. chain_mask: 4,
  1474. /* retry_limit -
  1475. * Specify the maximum number of transmissions, including the
  1476. * initial transmission, to attempt before giving up if no ack
  1477. * is received.
  1478. * If the tx rate is specified, then all retries shall use the
  1479. * same rate as the initial transmission.
  1480. * If no tx rate is specified, the target can choose whether to
  1481. * retain the original rate during the retransmissions, or to
  1482. * fall back to a more robust rate.
  1483. */
  1484. retry_limit: 4,
  1485. /* bandwidth_mask -
  1486. * Specify what channel widths may be used for the transmission.
  1487. * A value of zero indicates "don't care" - the target may choose
  1488. * the transmission bandwidth.
  1489. * The bits within this mask correspond to the htt_tx_bandwidth
  1490. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1491. * The bandwidth_mask must be consistent with the preamble_type_mask
  1492. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1493. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1494. */
  1495. bandwidth_mask: 6,
  1496. reserved2_31_14: 18; /* unused, set to 0x0 */
  1497. /* DWORD 3: tx expiry time (TSF) LSBs */
  1498. A_UINT32 expire_tsf_lo;
  1499. /* DWORD 4: tx expiry time (TSF) MSBs */
  1500. A_UINT32 expire_tsf_hi;
  1501. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1502. } POSTPACK;
  1503. /* DWORD 0 */
  1504. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1524. /* DWORD 1 */
  1525. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1526. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1527. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1528. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1529. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1530. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1531. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1532. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1533. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1534. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1535. /* DWORD 2 */
  1536. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1537. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1538. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1539. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1540. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1541. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1542. /* DWORD 0 */
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1544. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1545. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1547. do { \
  1548. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1549. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1550. } while (0)
  1551. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1552. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1553. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1554. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1555. do { \
  1556. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1557. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1558. } while (0)
  1559. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1560. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1561. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1563. do { \
  1564. HTT_CHECK_SET_VAL( \
  1565. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1566. ((_var) |= ((_val) \
  1567. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1568. } while (0)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL( \
  1575. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1576. ((_var) |= ((_val) \
  1577. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1578. } while (0)
  1579. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1580. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1581. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1582. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1583. do { \
  1584. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1585. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1586. } while (0)
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1588. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1589. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1590. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1591. do { \
  1592. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1593. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1594. } while (0)
  1595. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1597. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1598. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1605. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1606. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1613. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1614. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1618. } while (0)
  1619. /* DWORD 1 */
  1620. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1621. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1622. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1623. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1624. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1625. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1626. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1627. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1628. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1629. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1631. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1632. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1633. do { \
  1634. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1635. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1636. } while (0)
  1637. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1638. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1639. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1640. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1641. do { \
  1642. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1643. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1644. } while (0)
  1645. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1647. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1648. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1649. do { \
  1650. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1651. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1652. } while (0)
  1653. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1655. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1656. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1659. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1660. } while (0)
  1661. /* DWORD 2 */
  1662. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1663. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1664. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1665. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1666. do { \
  1667. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1668. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1669. } while (0)
  1670. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1671. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1672. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1673. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1674. do { \
  1675. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1676. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1677. } while (0)
  1678. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1679. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1680. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1681. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1682. do { \
  1683. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1684. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1685. } while (0)
  1686. typedef enum {
  1687. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1688. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1689. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1690. } htt_11ax_ltf_subtype_t;
  1691. typedef enum {
  1692. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1693. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1694. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1695. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1696. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1697. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1698. } htt_tx_ext2_preamble_type_t;
  1699. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1700. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1701. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1702. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1703. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1704. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1705. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1706. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1707. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1708. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1709. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1710. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1711. /**
  1712. * @brief HTT tx MSDU extension descriptor v2
  1713. * @details
  1714. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1715. * is received as tcl_exit_base->host_meta_info in firmware.
  1716. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1717. * are already part of tcl_exit_base.
  1718. */
  1719. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1720. /* DWORD 0: flags */
  1721. A_UINT32
  1722. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1723. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1724. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1725. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1726. valid_retries : 1, /* if set, tx retries spec is valid */
  1727. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1728. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1729. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1730. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1731. valid_key_flags : 1, /* if set, key flags is valid */
  1732. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1733. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1734. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1735. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1736. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1737. 1 = ENCRYPT,
  1738. 2 ~ 3 - Reserved */
  1739. /* retry_limit -
  1740. * Specify the maximum number of transmissions, including the
  1741. * initial transmission, to attempt before giving up if no ack
  1742. * is received.
  1743. * If the tx rate is specified, then all retries shall use the
  1744. * same rate as the initial transmission.
  1745. * If no tx rate is specified, the target can choose whether to
  1746. * retain the original rate during the retransmissions, or to
  1747. * fall back to a more robust rate.
  1748. */
  1749. retry_limit : 4,
  1750. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1751. * Valid only for 11ax preamble types HE_SU
  1752. * and HE_EXT_SU
  1753. */
  1754. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1755. * Valid only for 11ax preamble types HE_SU
  1756. * and HE_EXT_SU
  1757. */
  1758. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1759. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1760. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1761. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1762. */
  1763. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1764. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1765. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1766. * Use cases:
  1767. * Any time firmware uses TQM-BYPASS for Data
  1768. * TID, firmware expect host to set this bit.
  1769. */
  1770. /* DWORD 1: tx power, tx rate */
  1771. A_UINT32
  1772. power : 8, /* unit of the power field is 0.5 dbm
  1773. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1774. * signed value ranging from -64dbm to 63.5 dbm
  1775. */
  1776. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1777. * Setting more than one MCS isn't currently
  1778. * supported by the target (but is supported
  1779. * in the interface in case in the future
  1780. * the target supports specifications of
  1781. * a limited set of MCS values.
  1782. */
  1783. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1784. * Setting more than one Nss isn't currently
  1785. * supported by the target (but is supported
  1786. * in the interface in case in the future
  1787. * the target supports specifications of
  1788. * a limited set of Nss values.
  1789. */
  1790. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1791. update_peer_cache : 1; /* When set these custom values will be
  1792. * used for all packets, until the next
  1793. * update via this ext header.
  1794. * This is to make sure not all packets
  1795. * need to include this header.
  1796. */
  1797. /* DWORD 2: tx chain mask, tx retries */
  1798. A_UINT32
  1799. /* chain_mask - specify which chains to transmit from */
  1800. chain_mask : 8,
  1801. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1802. * TODO: Update Enum values for key_flags
  1803. */
  1804. /*
  1805. * Channel frequency: This identifies the desired channel
  1806. * frequency (in MHz) for tx frames. This is used by FW to help
  1807. * determine when it is safe to transmit or drop frames for
  1808. * off-channel operation.
  1809. * The default value of zero indicates to FW that the corresponding
  1810. * VDEV's home channel (if there is one) is the desired channel
  1811. * frequency.
  1812. */
  1813. chanfreq : 16;
  1814. /* DWORD 3: tx expiry time (TSF) LSBs */
  1815. A_UINT32 expire_tsf_lo;
  1816. /* DWORD 4: tx expiry time (TSF) MSBs */
  1817. A_UINT32 expire_tsf_hi;
  1818. /* DWORD 5: flags to control routing / processing of the MSDU */
  1819. A_UINT32
  1820. /* learning_frame
  1821. * When this flag is set, this frame will be dropped by FW
  1822. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1823. */
  1824. learning_frame : 1,
  1825. /* send_as_standalone
  1826. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1827. * i.e. with no A-MSDU or A-MPDU aggregation.
  1828. * The scope is extended to other use-cases.
  1829. */
  1830. send_as_standalone : 1,
  1831. /* is_host_opaque_valid
  1832. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1833. * with valid information.
  1834. */
  1835. is_host_opaque_valid : 1,
  1836. traffic_end_indication: 1,
  1837. rsvd0 : 28;
  1838. /* DWORD 6 : Host opaque cookie for special frames */
  1839. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1840. rsvd1 : 16;
  1841. /*
  1842. * This structure can be expanded further up to 40 bytes
  1843. * by adding further DWORDs as needed.
  1844. */
  1845. } POSTPACK;
  1846. /* DWORD 0 */
  1847. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1850. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1873. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1874. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1875. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1876. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1877. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1878. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1879. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1880. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1881. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1882. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1883. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1884. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1885. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1886. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1887. /* DWORD 1 */
  1888. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1889. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1890. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1891. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1892. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1893. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1894. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1895. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1896. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1897. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1898. /* DWORD 2 */
  1899. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1900. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1901. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1902. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1903. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1904. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1905. /* DWORD 5 */
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1907. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1910. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1912. /* DWORD 6 */
  1913. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1914. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1915. /* DWORD 0 */
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1917. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1918. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1920. do { \
  1921. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1922. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1923. } while (0)
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1925. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1926. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1928. do { \
  1929. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1930. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1931. } while (0)
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1933. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1934. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1936. do { \
  1937. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1938. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1939. } while (0)
  1940. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1941. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1942. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1944. do { \
  1945. HTT_CHECK_SET_VAL( \
  1946. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1947. ((_var) |= ((_val) \
  1948. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1949. } while (0)
  1950. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1951. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1952. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1954. do { \
  1955. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1956. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1957. } while (0)
  1958. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1959. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1960. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1964. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1965. } while (0)
  1966. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1967. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1968. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1969. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL( \
  1972. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1973. ((_var) |= ((_val) \
  1974. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1975. } while (0)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1977. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1978. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1980. do { \
  1981. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1982. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1983. } while (0)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1985. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1986. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1988. do { \
  1989. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1990. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1991. } while (0)
  1992. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1993. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1994. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1996. do { \
  1997. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1998. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1999. } while (0)
  2000. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2001. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2002. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2003. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2004. do { \
  2005. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2006. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2007. } while (0)
  2008. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2009. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2010. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2011. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2014. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2015. } while (0)
  2016. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2017. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2018. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2019. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2020. do { \
  2021. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2022. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2023. } while (0)
  2024. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2025. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2026. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2027. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2028. do { \
  2029. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2030. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2031. } while (0)
  2032. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2033. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2034. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2035. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2036. do { \
  2037. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2038. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2039. } while (0)
  2040. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2041. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2042. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2043. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2044. do { \
  2045. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2046. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2047. } while (0)
  2048. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2049. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2050. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2051. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2052. do { \
  2053. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2054. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2055. } while (0)
  2056. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2057. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2058. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2059. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2063. } while (0)
  2064. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2065. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2066. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2067. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2071. } while (0)
  2072. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2073. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2074. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2075. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2078. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2079. } while (0)
  2080. /* DWORD 1 */
  2081. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2082. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2083. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2084. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2085. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2086. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2087. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2088. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2089. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2090. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2091. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2092. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2093. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2097. } while (0)
  2098. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2099. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2100. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2101. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2102. do { \
  2103. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2104. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2105. } while (0)
  2106. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2107. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2108. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2109. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2110. do { \
  2111. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2112. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2113. } while (0)
  2114. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2115. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2116. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2117. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2118. do { \
  2119. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2120. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2121. } while (0)
  2122. /* DWORD 2 */
  2123. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2124. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2125. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2126. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2127. do { \
  2128. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2129. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2130. } while (0)
  2131. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2132. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2133. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2134. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2135. do { \
  2136. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2137. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2138. } while (0)
  2139. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2140. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2141. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2142. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2143. do { \
  2144. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2145. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2146. } while (0)
  2147. /* DWORD 5 */
  2148. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2149. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2150. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2151. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2152. do { \
  2153. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2154. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2155. } while (0)
  2156. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2157. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2158. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2159. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2160. do { \
  2161. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2162. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2163. } while (0)
  2164. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2165. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2166. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2167. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2171. } while (0)
  2172. /* DWORD 6 */
  2173. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2174. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2175. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2176. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2177. do { \
  2178. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2179. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2180. } while (0)
  2181. typedef enum {
  2182. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2183. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2184. } htt_tcl_metadata_type;
  2185. /**
  2186. * @brief HTT TCL command number format
  2187. * @details
  2188. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2189. * available to firmware as tcl_exit_base->tcl_status_number.
  2190. * For regular / multicast packets host will send vdev and mac id and for
  2191. * NAWDS packets, host will send peer id.
  2192. * A_UINT32 is used to avoid endianness conversion problems.
  2193. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2194. */
  2195. typedef struct {
  2196. A_UINT32
  2197. type: 1, /* vdev_id based or peer_id based */
  2198. rsvd: 31;
  2199. } htt_tx_tcl_vdev_or_peer_t;
  2200. typedef struct {
  2201. A_UINT32
  2202. type: 1, /* vdev_id based or peer_id based */
  2203. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2204. vdev_id: 8,
  2205. pdev_id: 2,
  2206. host_inspected:1,
  2207. rsvd: 19;
  2208. } htt_tx_tcl_vdev_metadata;
  2209. typedef struct {
  2210. A_UINT32
  2211. type: 1, /* vdev_id based or peer_id based */
  2212. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2213. peer_id: 14,
  2214. rsvd: 16;
  2215. } htt_tx_tcl_peer_metadata;
  2216. PREPACK struct htt_tx_tcl_metadata {
  2217. union {
  2218. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2219. htt_tx_tcl_vdev_metadata vdev_meta;
  2220. htt_tx_tcl_peer_metadata peer_meta;
  2221. };
  2222. } POSTPACK;
  2223. /* DWORD 0 */
  2224. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2225. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2226. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2227. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2228. /* VDEV metadata */
  2229. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2230. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2231. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2232. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2233. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2234. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2235. /* PEER metadata */
  2236. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2237. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2238. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2239. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2240. HTT_TX_TCL_METADATA_TYPE_S)
  2241. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2242. do { \
  2243. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2244. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2245. } while (0)
  2246. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2247. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2248. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2249. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2250. do { \
  2251. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2252. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2253. } while (0)
  2254. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2255. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2256. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2257. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2258. do { \
  2259. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2260. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2261. } while (0)
  2262. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2263. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2264. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2265. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2269. } while (0)
  2270. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2271. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2272. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2273. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2277. } while (0)
  2278. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2279. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2280. HTT_TX_TCL_METADATA_PEER_ID_S)
  2281. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2285. } while (0)
  2286. /*------------------------------------------------------------------
  2287. * V2 Version of TCL Data Command
  2288. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2289. * MLO global_seq all flavours of TCL Data Cmd.
  2290. *-----------------------------------------------------------------*/
  2291. typedef enum {
  2292. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2293. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2294. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2295. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2296. } htt_tcl_metadata_type_v2;
  2297. /**
  2298. * @brief HTT TCL command number format
  2299. * @details
  2300. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2301. * available to firmware as tcl_exit_base->tcl_status_number.
  2302. * A_UINT32 is used to avoid endianness conversion problems.
  2303. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2304. */
  2305. typedef struct {
  2306. A_UINT32
  2307. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2308. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2309. vdev_id: 8,
  2310. pdev_id: 2,
  2311. host_inspected:1,
  2312. rsvd: 2,
  2313. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2314. } htt_tx_tcl_vdev_metadata_v2;
  2315. typedef struct {
  2316. A_UINT32
  2317. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2318. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2319. peer_id: 13,
  2320. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2321. } htt_tx_tcl_peer_metadata_v2;
  2322. typedef struct {
  2323. A_UINT32
  2324. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2325. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2326. svc_class_id: 8,
  2327. rsvd: 5,
  2328. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2329. } htt_tx_tcl_svc_class_id_metadata;
  2330. typedef struct {
  2331. A_UINT32
  2332. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2333. host_inspected: 1,
  2334. global_seq_no: 12,
  2335. rsvd: 1,
  2336. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2337. } htt_tx_tcl_global_seq_metadata;
  2338. PREPACK struct htt_tx_tcl_metadata_v2 {
  2339. union {
  2340. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2341. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2342. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2343. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2344. };
  2345. } POSTPACK;
  2346. /* DWORD 0 */
  2347. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2348. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2349. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2350. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2351. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2352. /* VDEV V2 metadata */
  2353. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2354. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2355. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2356. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2357. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2358. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2359. /* PEER V2 metadata */
  2360. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2361. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2362. /* SVC_CLASS_ID metadata */
  2363. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2364. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2365. /* Global Seq no metadata */
  2366. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2367. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2368. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2369. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2370. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2371. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2372. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2373. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2374. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2375. do { \
  2376. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2377. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2378. } while (0)
  2379. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2380. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2381. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2382. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2383. do { \
  2384. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2385. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2386. } while (0)
  2387. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2388. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2389. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2390. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2391. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2392. do { \
  2393. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2394. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2395. } while (0)
  2396. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2397. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2398. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2399. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2400. do { \
  2401. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2402. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2403. } while (0)
  2404. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2405. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2406. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2407. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2411. } while (0)
  2412. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2413. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2414. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2415. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2416. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2417. do { \
  2418. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2419. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2420. } while (0)
  2421. /*----- Get and Set V2 type field in Service Class fields ----*/
  2422. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2423. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2424. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2425. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2428. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2429. } while (0)
  2430. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2431. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2432. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2433. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2434. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2435. do { \
  2436. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2437. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2438. } while (0)
  2439. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2440. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2441. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2442. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2443. do { \
  2444. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2445. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2446. } while (0)
  2447. /*------------------------------------------------------------------
  2448. * End V2 Version of TCL Data Command
  2449. *-----------------------------------------------------------------*/
  2450. typedef enum {
  2451. HTT_TX_FW2WBM_TX_STATUS_OK,
  2452. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2453. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2454. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2455. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2456. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2457. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2458. HTT_TX_FW2WBM_TX_STATUS_MAX
  2459. } htt_tx_fw2wbm_tx_status_t;
  2460. typedef enum {
  2461. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2462. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2463. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2464. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2465. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2466. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2467. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2468. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2469. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2470. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2471. } htt_tx_fw2wbm_reinject_reason_t;
  2472. /**
  2473. * @brief HTT TX WBM Completion from firmware to host
  2474. * @details
  2475. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2476. * DWORD 3 and 4 for software based completions (Exception frames and
  2477. * TQM bypass frames)
  2478. * For software based completions, wbm_release_ring->release_source_module will
  2479. * be set to release_source_fw
  2480. */
  2481. PREPACK struct htt_tx_wbm_completion {
  2482. A_UINT32
  2483. sch_cmd_id: 24,
  2484. exception_frame: 1, /* If set, this packet was queued via exception path */
  2485. rsvd0_31_25: 7;
  2486. A_UINT32
  2487. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2488. * reception of an ACK or BA, this field indicates
  2489. * the RSSI of the received ACK or BA frame.
  2490. * When the frame is removed as result of a direct
  2491. * remove command from the SW, this field is set
  2492. * to 0x0 (which is never a valid value when real
  2493. * RSSI is available).
  2494. * Units: dB w.r.t noise floor
  2495. */
  2496. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2497. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2498. rsvd1_31_16: 16;
  2499. } POSTPACK;
  2500. /* DWORD 0 */
  2501. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2502. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2503. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2504. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2505. /* DWORD 1 */
  2506. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2507. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2508. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2509. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2510. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2511. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2512. /* DWORD 0 */
  2513. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2514. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2515. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2516. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2517. do { \
  2518. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2519. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2520. } while (0)
  2521. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2522. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2523. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2524. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2525. do { \
  2526. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2527. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2528. } while (0)
  2529. /* DWORD 1 */
  2530. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2531. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2532. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2533. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2534. do { \
  2535. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2536. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2537. } while (0)
  2538. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2539. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2540. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2541. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2542. do { \
  2543. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2544. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2545. } while (0)
  2546. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2547. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2548. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2549. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2550. do { \
  2551. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2552. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2553. } while (0)
  2554. /**
  2555. * @brief HTT TX WBM Completion from firmware to host
  2556. * @details
  2557. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2558. * (WBM) offload HW.
  2559. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2560. * For software based completions, release_source_module will
  2561. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2562. * struct wbm_release_ring and then switch to this after looking at
  2563. * release_source_module.
  2564. */
  2565. PREPACK struct htt_tx_wbm_completion_v2 {
  2566. A_UINT32
  2567. used_by_hw0; /* Refer to struct wbm_release_ring */
  2568. A_UINT32
  2569. used_by_hw1; /* Refer to struct wbm_release_ring */
  2570. A_UINT32
  2571. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2572. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2573. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2574. exception_frame: 1,
  2575. rsvd0: 12, /* For future use */
  2576. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2577. rsvd1: 1; /* For future use */
  2578. A_UINT32
  2579. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2580. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2581. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2582. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2583. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2584. */
  2585. A_UINT32
  2586. data1: 32;
  2587. A_UINT32
  2588. data2: 32;
  2589. A_UINT32
  2590. used_by_hw3; /* Refer to struct wbm_release_ring */
  2591. } POSTPACK;
  2592. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2593. /* DWORD 3 */
  2594. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2595. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2596. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2597. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2598. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2599. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2600. /* DWORD 3 */
  2601. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2602. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2603. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2604. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2605. do { \
  2606. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2607. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2608. } while (0)
  2609. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2610. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2611. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2612. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2613. do { \
  2614. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2615. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2616. } while (0)
  2617. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2618. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2619. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2620. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2621. do { \
  2622. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2623. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2624. } while (0)
  2625. /**
  2626. * @brief HTT TX WBM Completion from firmware to host (V3)
  2627. * @details
  2628. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2629. * (WBM) offload HW.
  2630. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2631. * For software based completions, release_source_module will
  2632. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2633. * struct wbm_release_ring and then switch to this after looking at
  2634. * release_source_module.
  2635. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2636. * by new generations of targets.
  2637. */
  2638. PREPACK struct htt_tx_wbm_completion_v3 {
  2639. A_UINT32
  2640. used_by_hw0; /* Refer to struct wbm_release_ring */
  2641. A_UINT32
  2642. used_by_hw1; /* Refer to struct wbm_release_ring */
  2643. A_UINT32
  2644. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2645. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2646. used_by_hw3: 15;
  2647. A_UINT32
  2648. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2649. exception_frame: 1,
  2650. rsvd0: 27; /* For future use */
  2651. A_UINT32
  2652. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2653. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2654. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2655. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2656. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2657. */
  2658. A_UINT32
  2659. data1: 32;
  2660. A_UINT32
  2661. data2: 32;
  2662. A_UINT32
  2663. rsvd1: 20,
  2664. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2665. } POSTPACK;
  2666. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2667. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2668. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2669. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2670. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2671. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2672. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2673. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2674. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2675. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2676. do { \
  2677. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2678. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2679. } while (0)
  2680. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2681. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2682. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2683. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2684. do { \
  2685. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2686. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2687. } while (0)
  2688. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2689. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2690. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2691. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2692. do { \
  2693. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2694. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2695. } while (0)
  2696. typedef enum {
  2697. TX_FRAME_TYPE_UNDEFINED = 0,
  2698. TX_FRAME_TYPE_EAPOL = 1,
  2699. } htt_tx_wbm_status_frame_type;
  2700. /**
  2701. * @brief HTT TX WBM transmit status from firmware to host
  2702. * @details
  2703. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2704. * (WBM) offload HW.
  2705. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2706. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2707. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2708. */
  2709. PREPACK struct htt_tx_wbm_transmit_status {
  2710. A_UINT32
  2711. sch_cmd_id: 24,
  2712. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2713. * reception of an ACK or BA, this field indicates
  2714. * the RSSI of the received ACK or BA frame.
  2715. * When the frame is removed as result of a direct
  2716. * remove command from the SW, this field is set
  2717. * to 0x0 (which is never a valid value when real
  2718. * RSSI is available).
  2719. * Units: dB w.r.t noise floor
  2720. */
  2721. A_UINT32
  2722. sw_peer_id: 16,
  2723. tid_num: 5,
  2724. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2725. * and tid_num fields contain valid data.
  2726. * If this "valid" flag is not set, the
  2727. * sw_peer_id and tid_num fields must be ignored.
  2728. */
  2729. mcast: 1,
  2730. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2731. * contains valid data.
  2732. */
  2733. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2734. reserved: 4;
  2735. A_UINT32
  2736. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2737. * packets in the wbm completion path
  2738. */
  2739. } POSTPACK;
  2740. /* DWORD 4 */
  2741. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2742. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2743. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2744. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2745. /* DWORD 5 */
  2746. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2747. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2748. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2749. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2750. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2751. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2752. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2753. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2754. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2755. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2756. /* DWORD 4 */
  2757. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2758. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2759. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2760. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2761. do { \
  2762. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2763. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2764. } while (0)
  2765. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2766. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2767. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2768. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2769. do { \
  2770. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2771. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2772. } while (0)
  2773. /* DWORD 5 */
  2774. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2775. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2776. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2777. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2778. do { \
  2779. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2780. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2781. } while (0)
  2782. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2783. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2784. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2785. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2786. do { \
  2787. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2788. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2789. } while (0)
  2790. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2791. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2792. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2793. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2796. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2797. } while (0)
  2798. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2799. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2800. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2801. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2802. do { \
  2803. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2804. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2805. } while (0)
  2806. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2807. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2808. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2809. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2812. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2813. } while (0)
  2814. /**
  2815. * @brief HTT TX WBM reinject status from firmware to host
  2816. * @details
  2817. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2818. * (WBM) offload HW.
  2819. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2820. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2821. */
  2822. PREPACK struct htt_tx_wbm_reinject_status {
  2823. A_UINT32
  2824. reserved0: 32;
  2825. A_UINT32
  2826. reserved1: 32;
  2827. A_UINT32
  2828. reserved2: 32;
  2829. } POSTPACK;
  2830. /**
  2831. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2832. * @details
  2833. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2834. * (WBM) offload HW.
  2835. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2836. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2837. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2838. * STA side.
  2839. */
  2840. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2841. A_UINT32
  2842. mec_sa_addr_31_0;
  2843. A_UINT32
  2844. mec_sa_addr_47_32: 16,
  2845. sa_ast_index: 16;
  2846. A_UINT32
  2847. vdev_id: 8,
  2848. reserved0: 24;
  2849. } POSTPACK;
  2850. /* DWORD 4 - mec_sa_addr_31_0 */
  2851. /* DWORD 5 */
  2852. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2853. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2854. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2855. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2856. /* DWORD 6 */
  2857. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2858. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2859. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2860. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2861. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2862. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2865. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2866. } while (0)
  2867. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2868. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2869. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2870. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2873. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2874. } while (0)
  2875. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2876. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2877. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2878. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2881. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2882. } while (0)
  2883. typedef enum {
  2884. TX_FLOW_PRIORITY_BE,
  2885. TX_FLOW_PRIORITY_HIGH,
  2886. TX_FLOW_PRIORITY_LOW,
  2887. } htt_tx_flow_priority_t;
  2888. typedef enum {
  2889. TX_FLOW_LATENCY_SENSITIVE,
  2890. TX_FLOW_LATENCY_INSENSITIVE,
  2891. } htt_tx_flow_latency_t;
  2892. typedef enum {
  2893. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2894. TX_FLOW_INTERACTIVE_TRAFFIC,
  2895. TX_FLOW_PERIODIC_TRAFFIC,
  2896. TX_FLOW_BURSTY_TRAFFIC,
  2897. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2898. } htt_tx_flow_traffic_pattern_t;
  2899. /**
  2900. * @brief HTT TX Flow search metadata format
  2901. * @details
  2902. * Host will set this metadata in flow table's flow search entry along with
  2903. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2904. * firmware and TQM ring if the flow search entry wins.
  2905. * This metadata is available to firmware in that first MSDU's
  2906. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2907. * to one of the available flows for specific tid and returns the tqm flow
  2908. * pointer as part of htt_tx_map_flow_info message.
  2909. */
  2910. PREPACK struct htt_tx_flow_metadata {
  2911. A_UINT32
  2912. rsvd0_1_0: 2,
  2913. tid: 4,
  2914. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2915. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2916. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2917. * Else choose final tid based on latency, priority.
  2918. */
  2919. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2920. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2921. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2922. } POSTPACK;
  2923. /* DWORD 0 */
  2924. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2925. #define HTT_TX_FLOW_METADATA_TID_S 2
  2926. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2927. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2928. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2929. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2930. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2931. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2932. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2933. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2934. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2935. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2936. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2937. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2938. /* DWORD 0 */
  2939. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2940. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2941. HTT_TX_FLOW_METADATA_TID_S)
  2942. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2943. do { \
  2944. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2945. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2946. } while (0)
  2947. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2948. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2949. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2950. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2951. do { \
  2952. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2953. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2954. } while (0)
  2955. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2956. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2957. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2958. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2959. do { \
  2960. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2961. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2962. } while (0)
  2963. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2964. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2965. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2966. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2969. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2970. } while (0)
  2971. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2972. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2973. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2974. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2975. do { \
  2976. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2977. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2978. } while (0)
  2979. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2980. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2981. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2982. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2983. do { \
  2984. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2985. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2986. } while (0)
  2987. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2988. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2989. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2990. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2991. do { \
  2992. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2993. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2994. } while (0)
  2995. /**
  2996. * @brief host -> target ADD WDS Entry
  2997. *
  2998. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2999. *
  3000. * @brief host -> target DELETE WDS Entry
  3001. *
  3002. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3003. *
  3004. * @details
  3005. * HTT wds entry from source port learning
  3006. * Host will learn wds entries from rx and send this message to firmware
  3007. * to enable firmware to configure/delete AST entries for wds clients.
  3008. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3009. * and when SA's entry is deleted, firmware removes this AST entry
  3010. *
  3011. * The message would appear as follows:
  3012. *
  3013. * |31 30|29 |17 16|15 8|7 0|
  3014. * |----------------+----------------+----------------+----------------|
  3015. * | rsvd0 |PDVID| vdev_id | msg_type |
  3016. * |-------------------------------------------------------------------|
  3017. * | sa_addr_31_0 |
  3018. * |-------------------------------------------------------------------|
  3019. * | | ta_peer_id | sa_addr_47_32 |
  3020. * |-------------------------------------------------------------------|
  3021. * Where PDVID = pdev_id
  3022. *
  3023. * The message is interpreted as follows:
  3024. *
  3025. * dword0 - b'0:7 - msg_type: This will be set to
  3026. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3027. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3028. *
  3029. * dword0 - b'8:15 - vdev_id
  3030. *
  3031. * dword0 - b'16:17 - pdev_id
  3032. *
  3033. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3034. *
  3035. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3036. *
  3037. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3038. *
  3039. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3040. */
  3041. PREPACK struct htt_wds_entry {
  3042. A_UINT32
  3043. msg_type: 8,
  3044. vdev_id: 8,
  3045. pdev_id: 2,
  3046. rsvd0: 14;
  3047. A_UINT32 sa_addr_31_0;
  3048. A_UINT32
  3049. sa_addr_47_32: 16,
  3050. ta_peer_id: 14,
  3051. rsvd2: 2;
  3052. } POSTPACK;
  3053. /* DWORD 0 */
  3054. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3055. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3056. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3057. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3058. /* DWORD 2 */
  3059. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3060. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3061. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3062. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3063. /* DWORD 0 */
  3064. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3065. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3066. HTT_WDS_ENTRY_VDEV_ID_S)
  3067. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3068. do { \
  3069. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3070. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3071. } while (0)
  3072. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3073. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3074. HTT_WDS_ENTRY_PDEV_ID_S)
  3075. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3076. do { \
  3077. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3078. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3079. } while (0)
  3080. /* DWORD 2 */
  3081. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3082. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3083. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3084. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3085. do { \
  3086. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3087. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3088. } while (0)
  3089. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3090. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3091. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3092. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3093. do { \
  3094. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3095. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3096. } while (0)
  3097. /**
  3098. * @brief MAC DMA rx ring setup specification
  3099. *
  3100. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3101. *
  3102. * @details
  3103. * To allow for dynamic rx ring reconfiguration and to avoid race
  3104. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3105. * it uses. Instead, it sends this message to the target, indicating how
  3106. * the rx ring used by the host should be set up and maintained.
  3107. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3108. * specifications.
  3109. *
  3110. * |31 16|15 8|7 0|
  3111. * |---------------------------------------------------------------|
  3112. * header: | reserved | num rings | msg type |
  3113. * |---------------------------------------------------------------|
  3114. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3115. #if HTT_PADDR64
  3116. * | FW_IDX shadow register physical address (bits 63:32) |
  3117. #endif
  3118. * |---------------------------------------------------------------|
  3119. * | rx ring base physical address (bits 31:0) |
  3120. #if HTT_PADDR64
  3121. * | rx ring base physical address (bits 63:32) |
  3122. #endif
  3123. * |---------------------------------------------------------------|
  3124. * | rx ring buffer size | rx ring length |
  3125. * |---------------------------------------------------------------|
  3126. * | FW_IDX initial value | enabled flags |
  3127. * |---------------------------------------------------------------|
  3128. * | MSDU payload offset | 802.11 header offset |
  3129. * |---------------------------------------------------------------|
  3130. * | PPDU end offset | PPDU start offset |
  3131. * |---------------------------------------------------------------|
  3132. * | MPDU end offset | MPDU start offset |
  3133. * |---------------------------------------------------------------|
  3134. * | MSDU end offset | MSDU start offset |
  3135. * |---------------------------------------------------------------|
  3136. * | frag info offset | rx attention offset |
  3137. * |---------------------------------------------------------------|
  3138. * payload 2, if present, has the same format as payload 1
  3139. * Header fields:
  3140. * - MSG_TYPE
  3141. * Bits 7:0
  3142. * Purpose: identifies this as an rx ring configuration message
  3143. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3144. * - NUM_RINGS
  3145. * Bits 15:8
  3146. * Purpose: indicates whether the host is setting up one rx ring or two
  3147. * Value: 1 or 2
  3148. * Payload:
  3149. * for systems using 64-bit format for bus addresses:
  3150. * - IDX_SHADOW_REG_PADDR_LO
  3151. * Bits 31:0
  3152. * Value: lower 4 bytes of physical address of the host's
  3153. * FW_IDX shadow register
  3154. * - IDX_SHADOW_REG_PADDR_HI
  3155. * Bits 31:0
  3156. * Value: upper 4 bytes of physical address of the host's
  3157. * FW_IDX shadow register
  3158. * - RING_BASE_PADDR_LO
  3159. * Bits 31:0
  3160. * Value: lower 4 bytes of physical address of the host's rx ring
  3161. * - RING_BASE_PADDR_HI
  3162. * Bits 31:0
  3163. * Value: uppper 4 bytes of physical address of the host's rx ring
  3164. * for systems using 32-bit format for bus addresses:
  3165. * - IDX_SHADOW_REG_PADDR
  3166. * Bits 31:0
  3167. * Value: physical address of the host's FW_IDX shadow register
  3168. * - RING_BASE_PADDR
  3169. * Bits 31:0
  3170. * Value: physical address of the host's rx ring
  3171. * - RING_LEN
  3172. * Bits 15:0
  3173. * Value: number of elements in the rx ring
  3174. * - RING_BUF_SZ
  3175. * Bits 31:16
  3176. * Value: size of the buffers referenced by the rx ring, in byte units
  3177. * - ENABLED_FLAGS
  3178. * Bits 15:0
  3179. * Value: 1-bit flags to show whether different rx fields are enabled
  3180. * bit 0: 802.11 header enabled (1) or disabled (0)
  3181. * bit 1: MSDU payload enabled (1) or disabled (0)
  3182. * bit 2: PPDU start enabled (1) or disabled (0)
  3183. * bit 3: PPDU end enabled (1) or disabled (0)
  3184. * bit 4: MPDU start enabled (1) or disabled (0)
  3185. * bit 5: MPDU end enabled (1) or disabled (0)
  3186. * bit 6: MSDU start enabled (1) or disabled (0)
  3187. * bit 7: MSDU end enabled (1) or disabled (0)
  3188. * bit 8: rx attention enabled (1) or disabled (0)
  3189. * bit 9: frag info enabled (1) or disabled (0)
  3190. * bit 10: unicast rx enabled (1) or disabled (0)
  3191. * bit 11: multicast rx enabled (1) or disabled (0)
  3192. * bit 12: ctrl rx enabled (1) or disabled (0)
  3193. * bit 13: mgmt rx enabled (1) or disabled (0)
  3194. * bit 14: null rx enabled (1) or disabled (0)
  3195. * bit 15: phy data rx enabled (1) or disabled (0)
  3196. * - IDX_INIT_VAL
  3197. * Bits 31:16
  3198. * Purpose: Specify the initial value for the FW_IDX.
  3199. * Value: the number of buffers initially present in the host's rx ring
  3200. * - OFFSET_802_11_HDR
  3201. * Bits 15:0
  3202. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3203. * - OFFSET_MSDU_PAYLOAD
  3204. * Bits 31:16
  3205. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3206. * - OFFSET_PPDU_START
  3207. * Bits 15:0
  3208. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3209. * - OFFSET_PPDU_END
  3210. * Bits 31:16
  3211. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3212. * - OFFSET_MPDU_START
  3213. * Bits 15:0
  3214. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3215. * - OFFSET_MPDU_END
  3216. * Bits 31:16
  3217. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3218. * - OFFSET_MSDU_START
  3219. * Bits 15:0
  3220. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3221. * - OFFSET_MSDU_END
  3222. * Bits 31:16
  3223. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3224. * - OFFSET_RX_ATTN
  3225. * Bits 15:0
  3226. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3227. * - OFFSET_FRAG_INFO
  3228. * Bits 31:16
  3229. * Value: offset in QUAD-bytes of frag info table
  3230. */
  3231. /* header fields */
  3232. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3233. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3234. /* payload fields */
  3235. /* for systems using a 64-bit format for bus addresses */
  3236. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3237. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3238. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3239. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3240. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3241. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3242. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3243. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3244. /* for systems using a 32-bit format for bus addresses */
  3245. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3246. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3247. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3248. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3249. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3250. #define HTT_RX_RING_CFG_LEN_S 0
  3251. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3252. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3253. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3254. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3255. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3256. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3257. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3258. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3259. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3260. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3261. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3262. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3263. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3264. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3265. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3266. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3267. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3268. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3269. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3270. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3271. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3272. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3273. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3274. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3275. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3276. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3277. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3278. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3279. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3280. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3281. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3282. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3283. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3284. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3285. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3286. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3287. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3288. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3289. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3290. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3291. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3292. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3293. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3294. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3295. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3296. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3297. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3298. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3299. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3300. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3301. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3302. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3303. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3304. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3305. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3306. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3307. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3308. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3309. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3310. #if HTT_PADDR64
  3311. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3312. #else
  3313. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3314. #endif
  3315. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3316. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3317. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3318. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3319. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3320. do { \
  3321. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3322. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3323. } while (0)
  3324. /* degenerate case for 32-bit fields */
  3325. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3326. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3327. ((_var) = (_val))
  3328. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3329. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3330. ((_var) = (_val))
  3331. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3332. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3333. ((_var) = (_val))
  3334. /* degenerate case for 32-bit fields */
  3335. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3336. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3337. ((_var) = (_val))
  3338. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3339. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3340. ((_var) = (_val))
  3341. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3342. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3343. ((_var) = (_val))
  3344. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3345. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3346. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3347. do { \
  3348. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3349. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3350. } while (0)
  3351. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3352. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3353. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3354. do { \
  3355. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3356. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3357. } while (0)
  3358. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3359. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3360. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3361. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3362. do { \
  3363. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3364. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3365. } while (0)
  3366. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3367. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3368. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3369. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3370. do { \
  3371. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3372. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3373. } while (0)
  3374. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3375. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3376. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3377. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3378. do { \
  3379. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3380. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3381. } while (0)
  3382. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3383. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3384. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3385. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3386. do { \
  3387. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3388. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3389. } while (0)
  3390. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3391. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3392. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3393. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3394. do { \
  3395. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3396. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3397. } while (0)
  3398. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3399. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3400. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3401. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3402. do { \
  3403. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3404. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3405. } while (0)
  3406. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3407. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3408. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3409. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3410. do { \
  3411. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3412. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3413. } while (0)
  3414. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3415. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3416. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3417. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3418. do { \
  3419. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3420. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3421. } while (0)
  3422. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3423. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3424. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3425. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3426. do { \
  3427. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3428. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3429. } while (0)
  3430. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3431. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3432. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3433. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3434. do { \
  3435. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3436. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3437. } while (0)
  3438. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3439. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3440. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3441. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3442. do { \
  3443. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3444. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3445. } while (0)
  3446. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3447. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3448. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3449. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3450. do { \
  3451. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3452. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3453. } while (0)
  3454. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3455. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3456. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3457. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3458. do { \
  3459. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3460. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3461. } while (0)
  3462. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3463. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3464. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3465. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3466. do { \
  3467. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3468. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3469. } while (0)
  3470. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3471. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3472. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3473. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3474. do { \
  3475. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3476. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3477. } while (0)
  3478. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3479. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3480. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3481. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3482. do { \
  3483. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3484. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3485. } while (0)
  3486. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3487. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3488. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3489. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3490. do { \
  3491. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3492. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3493. } while (0)
  3494. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3495. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3496. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3497. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3498. do { \
  3499. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3500. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3501. } while (0)
  3502. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3503. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3504. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3505. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3506. do { \
  3507. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3508. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3509. } while (0)
  3510. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3511. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3512. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3513. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3514. do { \
  3515. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3516. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3517. } while (0)
  3518. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3519. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3520. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3521. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3522. do { \
  3523. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3524. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3525. } while (0)
  3526. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3527. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3528. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3529. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3530. do { \
  3531. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3532. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3533. } while (0)
  3534. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3535. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3536. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3537. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3538. do { \
  3539. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3540. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3541. } while (0)
  3542. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3543. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3544. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3545. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3546. do { \
  3547. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3548. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3549. } while (0)
  3550. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3551. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3552. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3553. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3554. do { \
  3555. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3556. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3557. } while (0)
  3558. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3559. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3560. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3561. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3562. do { \
  3563. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3564. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3565. } while (0)
  3566. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3567. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3568. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3569. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3570. do { \
  3571. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3572. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3573. } while (0)
  3574. /**
  3575. * @brief host -> target FW statistics retrieve
  3576. *
  3577. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3578. *
  3579. * @details
  3580. * The following field definitions describe the format of the HTT host
  3581. * to target FW stats retrieve message. The message specifies the type of
  3582. * stats host wants to retrieve.
  3583. *
  3584. * |31 24|23 16|15 8|7 0|
  3585. * |-----------------------------------------------------------|
  3586. * | stats types request bitmask | msg type |
  3587. * |-----------------------------------------------------------|
  3588. * | stats types reset bitmask | reserved |
  3589. * |-----------------------------------------------------------|
  3590. * | stats type | config value |
  3591. * |-----------------------------------------------------------|
  3592. * | cookie LSBs |
  3593. * |-----------------------------------------------------------|
  3594. * | cookie MSBs |
  3595. * |-----------------------------------------------------------|
  3596. * Header fields:
  3597. * - MSG_TYPE
  3598. * Bits 7:0
  3599. * Purpose: identifies this is a stats upload request message
  3600. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3601. * - UPLOAD_TYPES
  3602. * Bits 31:8
  3603. * Purpose: identifies which types of FW statistics to upload
  3604. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3605. * - RESET_TYPES
  3606. * Bits 31:8
  3607. * Purpose: identifies which types of FW statistics to reset
  3608. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3609. * - CFG_VAL
  3610. * Bits 23:0
  3611. * Purpose: give an opaque configuration value to the specified stats type
  3612. * Value: stats-type specific configuration value
  3613. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3614. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3615. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3616. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3617. * - CFG_STAT_TYPE
  3618. * Bits 31:24
  3619. * Purpose: specify which stats type (if any) the config value applies to
  3620. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3621. * a valid configuration specification
  3622. * - COOKIE_LSBS
  3623. * Bits 31:0
  3624. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3625. * message with its preceding host->target stats request message.
  3626. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3627. * - COOKIE_MSBS
  3628. * Bits 31:0
  3629. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3630. * message with its preceding host->target stats request message.
  3631. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3632. */
  3633. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3634. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3635. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3636. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3637. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3638. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3639. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3640. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3641. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3642. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3643. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3644. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3645. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3646. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3649. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3650. } while (0)
  3651. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3652. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3653. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3654. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3657. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3658. } while (0)
  3659. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3660. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3661. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3662. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3665. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3666. } while (0)
  3667. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3668. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3669. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3670. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3673. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3674. } while (0)
  3675. /**
  3676. * @brief host -> target HTT out-of-band sync request
  3677. *
  3678. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3679. *
  3680. * @details
  3681. * The HTT SYNC tells the target to suspend processing of subsequent
  3682. * HTT host-to-target messages until some other target agent locally
  3683. * informs the target HTT FW that the current sync counter is equal to
  3684. * or greater than (in a modulo sense) the sync counter specified in
  3685. * the SYNC message.
  3686. * This allows other host-target components to synchronize their operation
  3687. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3688. * security key has been downloaded to and activated by the target.
  3689. * In the absence of any explicit synchronization counter value
  3690. * specification, the target HTT FW will use zero as the default current
  3691. * sync value.
  3692. *
  3693. * |31 24|23 16|15 8|7 0|
  3694. * |-----------------------------------------------------------|
  3695. * | reserved | sync count | msg type |
  3696. * |-----------------------------------------------------------|
  3697. * Header fields:
  3698. * - MSG_TYPE
  3699. * Bits 7:0
  3700. * Purpose: identifies this as a sync message
  3701. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3702. * - SYNC_COUNT
  3703. * Bits 15:8
  3704. * Purpose: specifies what sync value the HTT FW will wait for from
  3705. * an out-of-band specification to resume its operation
  3706. * Value: in-band sync counter value to compare against the out-of-band
  3707. * counter spec.
  3708. * The HTT target FW will suspend its host->target message processing
  3709. * as long as
  3710. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3711. */
  3712. #define HTT_H2T_SYNC_MSG_SZ 4
  3713. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3714. #define HTT_H2T_SYNC_COUNT_S 8
  3715. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3716. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3717. HTT_H2T_SYNC_COUNT_S)
  3718. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3719. do { \
  3720. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3721. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3722. } while (0)
  3723. /**
  3724. * @brief host -> target HTT aggregation configuration
  3725. *
  3726. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3727. */
  3728. #define HTT_AGGR_CFG_MSG_SZ 4
  3729. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3730. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3731. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3732. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3733. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3734. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3735. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3736. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3737. do { \
  3738. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3739. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3740. } while (0)
  3741. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3742. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3743. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3744. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3745. do { \
  3746. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3747. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3748. } while (0)
  3749. /**
  3750. * @brief host -> target HTT configure max amsdu info per vdev
  3751. *
  3752. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3753. *
  3754. * @details
  3755. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3756. *
  3757. * |31 21|20 16|15 8|7 0|
  3758. * |-----------------------------------------------------------|
  3759. * | reserved | vdev id | max amsdu | msg type |
  3760. * |-----------------------------------------------------------|
  3761. * Header fields:
  3762. * - MSG_TYPE
  3763. * Bits 7:0
  3764. * Purpose: identifies this as a aggr cfg ex message
  3765. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3766. * - MAX_NUM_AMSDU_SUBFRM
  3767. * Bits 15:8
  3768. * Purpose: max MSDUs per A-MSDU
  3769. * - VDEV_ID
  3770. * Bits 20:16
  3771. * Purpose: ID of the vdev to which this limit is applied
  3772. */
  3773. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3774. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3775. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3776. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3777. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3778. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3779. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3780. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3781. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3782. do { \
  3783. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3784. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3785. } while (0)
  3786. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3787. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3788. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3789. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3792. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3793. } while (0)
  3794. /**
  3795. * @brief HTT WDI_IPA Config Message
  3796. *
  3797. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3798. *
  3799. * @details
  3800. * The HTT WDI_IPA config message is created/sent by host at driver
  3801. * init time. It contains information about data structures used on
  3802. * WDI_IPA TX and RX path.
  3803. * TX CE ring is used for pushing packet metadata from IPA uC
  3804. * to WLAN FW
  3805. * TX Completion ring is used for generating TX completions from
  3806. * WLAN FW to IPA uC
  3807. * RX Indication ring is used for indicating RX packets from FW
  3808. * to IPA uC
  3809. * RX Ring2 is used as either completion ring or as second
  3810. * indication ring. when Ring2 is used as completion ring, IPA uC
  3811. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3812. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3813. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3814. * indicated in RX Indication ring. Please see WDI_IPA specification
  3815. * for more details.
  3816. * |31 24|23 16|15 8|7 0|
  3817. * |----------------+----------------+----------------+----------------|
  3818. * | tx pkt pool size | Rsvd | msg_type |
  3819. * |-------------------------------------------------------------------|
  3820. * | tx comp ring base (bits 31:0) |
  3821. #if HTT_PADDR64
  3822. * | tx comp ring base (bits 63:32) |
  3823. #endif
  3824. * |-------------------------------------------------------------------|
  3825. * | tx comp ring size |
  3826. * |-------------------------------------------------------------------|
  3827. * | tx comp WR_IDX physical address (bits 31:0) |
  3828. #if HTT_PADDR64
  3829. * | tx comp WR_IDX physical address (bits 63:32) |
  3830. #endif
  3831. * |-------------------------------------------------------------------|
  3832. * | tx CE WR_IDX physical address (bits 31:0) |
  3833. #if HTT_PADDR64
  3834. * | tx CE WR_IDX physical address (bits 63:32) |
  3835. #endif
  3836. * |-------------------------------------------------------------------|
  3837. * | rx indication ring base (bits 31:0) |
  3838. #if HTT_PADDR64
  3839. * | rx indication ring base (bits 63:32) |
  3840. #endif
  3841. * |-------------------------------------------------------------------|
  3842. * | rx indication ring size |
  3843. * |-------------------------------------------------------------------|
  3844. * | rx ind RD_IDX physical address (bits 31:0) |
  3845. #if HTT_PADDR64
  3846. * | rx ind RD_IDX physical address (bits 63:32) |
  3847. #endif
  3848. * |-------------------------------------------------------------------|
  3849. * | rx ind WR_IDX physical address (bits 31:0) |
  3850. #if HTT_PADDR64
  3851. * | rx ind WR_IDX physical address (bits 63:32) |
  3852. #endif
  3853. * |-------------------------------------------------------------------|
  3854. * |-------------------------------------------------------------------|
  3855. * | rx ring2 base (bits 31:0) |
  3856. #if HTT_PADDR64
  3857. * | rx ring2 base (bits 63:32) |
  3858. #endif
  3859. * |-------------------------------------------------------------------|
  3860. * | rx ring2 size |
  3861. * |-------------------------------------------------------------------|
  3862. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3863. #if HTT_PADDR64
  3864. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3865. #endif
  3866. * |-------------------------------------------------------------------|
  3867. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3868. #if HTT_PADDR64
  3869. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3870. #endif
  3871. * |-------------------------------------------------------------------|
  3872. *
  3873. * Header fields:
  3874. * Header fields:
  3875. * - MSG_TYPE
  3876. * Bits 7:0
  3877. * Purpose: Identifies this as WDI_IPA config message
  3878. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3879. * - TX_PKT_POOL_SIZE
  3880. * Bits 15:0
  3881. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3882. * WDI_IPA TX path
  3883. * For systems using 32-bit format for bus addresses:
  3884. * - TX_COMP_RING_BASE_ADDR
  3885. * Bits 31:0
  3886. * Purpose: TX Completion Ring base address in DDR
  3887. * - TX_COMP_RING_SIZE
  3888. * Bits 31:0
  3889. * Purpose: TX Completion Ring size (must be power of 2)
  3890. * - TX_COMP_WR_IDX_ADDR
  3891. * Bits 31:0
  3892. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3893. * updates the Write Index for WDI_IPA TX completion ring
  3894. * - TX_CE_WR_IDX_ADDR
  3895. * Bits 31:0
  3896. * Purpose: DDR address where IPA uC
  3897. * updates the WR Index for TX CE ring
  3898. * (needed for fusion platforms)
  3899. * - RX_IND_RING_BASE_ADDR
  3900. * Bits 31:0
  3901. * Purpose: RX Indication Ring base address in DDR
  3902. * - RX_IND_RING_SIZE
  3903. * Bits 31:0
  3904. * Purpose: RX Indication Ring size
  3905. * - RX_IND_RD_IDX_ADDR
  3906. * Bits 31:0
  3907. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3908. * RX indication ring
  3909. * - RX_IND_WR_IDX_ADDR
  3910. * Bits 31:0
  3911. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3912. * updates the Write Index for WDI_IPA RX indication ring
  3913. * - RX_RING2_BASE_ADDR
  3914. * Bits 31:0
  3915. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3916. * - RX_RING2_SIZE
  3917. * Bits 31:0
  3918. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3919. * - RX_RING2_RD_IDX_ADDR
  3920. * Bits 31:0
  3921. * Purpose: If Second RX ring is Indication ring, DDR address where
  3922. * IPA uC updates the Read Index for Ring2.
  3923. * If Second RX ring is completion ring, this is NOT used
  3924. * - RX_RING2_WR_IDX_ADDR
  3925. * Bits 31:0
  3926. * Purpose: If Second RX ring is Indication ring, DDR address where
  3927. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3928. * If second RX ring is completion ring, DDR address where
  3929. * IPA uC updates the Write Index for Ring 2.
  3930. * For systems using 64-bit format for bus addresses:
  3931. * - TX_COMP_RING_BASE_ADDR_LO
  3932. * Bits 31:0
  3933. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3934. * - TX_COMP_RING_BASE_ADDR_HI
  3935. * Bits 31:0
  3936. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3937. * - TX_COMP_RING_SIZE
  3938. * Bits 31:0
  3939. * Purpose: TX Completion Ring size (must be power of 2)
  3940. * - TX_COMP_WR_IDX_ADDR_LO
  3941. * Bits 31:0
  3942. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3943. * Lower 4 bytes of DDR address where WIFI FW
  3944. * updates the Write Index for WDI_IPA TX completion ring
  3945. * - TX_COMP_WR_IDX_ADDR_HI
  3946. * Bits 31:0
  3947. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3948. * Higher 4 bytes of DDR address where WIFI FW
  3949. * updates the Write Index for WDI_IPA TX completion ring
  3950. * - TX_CE_WR_IDX_ADDR_LO
  3951. * Bits 31:0
  3952. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3953. * updates the WR Index for TX CE ring
  3954. * (needed for fusion platforms)
  3955. * - TX_CE_WR_IDX_ADDR_HI
  3956. * Bits 31:0
  3957. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3958. * updates the WR Index for TX CE ring
  3959. * (needed for fusion platforms)
  3960. * - RX_IND_RING_BASE_ADDR_LO
  3961. * Bits 31:0
  3962. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3963. * - RX_IND_RING_BASE_ADDR_HI
  3964. * Bits 31:0
  3965. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3966. * - RX_IND_RING_SIZE
  3967. * Bits 31:0
  3968. * Purpose: RX Indication Ring size
  3969. * - RX_IND_RD_IDX_ADDR_LO
  3970. * Bits 31:0
  3971. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3972. * for WDI_IPA RX indication ring
  3973. * - RX_IND_RD_IDX_ADDR_HI
  3974. * Bits 31:0
  3975. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3976. * for WDI_IPA RX indication ring
  3977. * - RX_IND_WR_IDX_ADDR_LO
  3978. * Bits 31:0
  3979. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3980. * Lower 4 bytes of DDR address where WIFI FW
  3981. * updates the Write Index for WDI_IPA RX indication ring
  3982. * - RX_IND_WR_IDX_ADDR_HI
  3983. * Bits 31:0
  3984. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3985. * Higher 4 bytes of DDR address where WIFI FW
  3986. * updates the Write Index for WDI_IPA RX indication ring
  3987. * - RX_RING2_BASE_ADDR_LO
  3988. * Bits 31:0
  3989. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3990. * - RX_RING2_BASE_ADDR_HI
  3991. * Bits 31:0
  3992. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3993. * - RX_RING2_SIZE
  3994. * Bits 31:0
  3995. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3996. * - RX_RING2_RD_IDX_ADDR_LO
  3997. * Bits 31:0
  3998. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3999. * DDR address where IPA uC updates the Read Index for Ring2.
  4000. * If Second RX ring is completion ring, this is NOT used
  4001. * - RX_RING2_RD_IDX_ADDR_HI
  4002. * Bits 31:0
  4003. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4004. * DDR address where IPA uC updates the Read Index for Ring2.
  4005. * If Second RX ring is completion ring, this is NOT used
  4006. * - RX_RING2_WR_IDX_ADDR_LO
  4007. * Bits 31:0
  4008. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4009. * DDR address where WIFI FW updates the Write Index
  4010. * for WDI_IPA RX ring2
  4011. * If second RX ring is completion ring, lower 4 bytes of
  4012. * DDR address where IPA uC updates the Write Index for Ring 2.
  4013. * - RX_RING2_WR_IDX_ADDR_HI
  4014. * Bits 31:0
  4015. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4016. * DDR address where WIFI FW updates the Write Index
  4017. * for WDI_IPA RX ring2
  4018. * If second RX ring is completion ring, higher 4 bytes of
  4019. * DDR address where IPA uC updates the Write Index for Ring 2.
  4020. */
  4021. #if HTT_PADDR64
  4022. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4023. #else
  4024. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4025. #endif
  4026. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4027. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4028. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4029. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4030. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4031. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4032. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4033. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4034. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4035. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4036. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4037. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4038. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4039. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4040. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4041. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4042. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4043. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4044. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4045. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4046. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4048. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4050. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4052. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4054. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4056. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4058. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4060. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4062. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4064. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4066. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4068. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4070. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4072. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4074. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4088. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4089. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4090. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4091. do { \
  4092. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4093. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4094. } while (0)
  4095. /* for systems using 32-bit format for bus addr */
  4096. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4097. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4098. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4099. do { \
  4100. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4101. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4102. } while (0)
  4103. /* for systems using 64-bit format for bus addr */
  4104. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4105. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4106. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4107. do { \
  4108. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4109. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4110. } while (0)
  4111. /* for systems using 64-bit format for bus addr */
  4112. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4113. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4114. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4115. do { \
  4116. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4117. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4118. } while (0)
  4119. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4120. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4121. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4122. do { \
  4123. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4124. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4125. } while (0)
  4126. /* for systems using 32-bit format for bus addr */
  4127. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4128. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4129. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4130. do { \
  4131. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4132. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4133. } while (0)
  4134. /* for systems using 64-bit format for bus addr */
  4135. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4136. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4137. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4138. do { \
  4139. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4140. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4141. } while (0)
  4142. /* for systems using 64-bit format for bus addr */
  4143. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4144. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4145. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4146. do { \
  4147. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4148. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4149. } while (0)
  4150. /* for systems using 32-bit format for bus addr */
  4151. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4152. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4153. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4154. do { \
  4155. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4156. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4157. } while (0)
  4158. /* for systems using 64-bit format for bus addr */
  4159. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4160. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4161. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4164. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4165. } while (0)
  4166. /* for systems using 64-bit format for bus addr */
  4167. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4168. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4169. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4170. do { \
  4171. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4172. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4173. } while (0)
  4174. /* for systems using 32-bit format for bus addr */
  4175. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4176. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4177. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4178. do { \
  4179. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4180. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4181. } while (0)
  4182. /* for systems using 64-bit format for bus addr */
  4183. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4184. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4185. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4186. do { \
  4187. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4188. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4189. } while (0)
  4190. /* for systems using 64-bit format for bus addr */
  4191. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4192. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4193. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4194. do { \
  4195. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4196. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4197. } while (0)
  4198. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4199. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4200. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4203. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4204. } while (0)
  4205. /* for systems using 32-bit format for bus addr */
  4206. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4207. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4208. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4209. do { \
  4210. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4211. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4212. } while (0)
  4213. /* for systems using 64-bit format for bus addr */
  4214. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4215. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4216. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4217. do { \
  4218. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4219. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4220. } while (0)
  4221. /* for systems using 64-bit format for bus addr */
  4222. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4223. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4224. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4225. do { \
  4226. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4227. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4228. } while (0)
  4229. /* for systems using 32-bit format for bus addr */
  4230. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4231. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4232. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4233. do { \
  4234. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4235. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4236. } while (0)
  4237. /* for systems using 64-bit format for bus addr */
  4238. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4239. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4240. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4243. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4244. } while (0)
  4245. /* for systems using 64-bit format for bus addr */
  4246. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4247. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4248. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4249. do { \
  4250. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4251. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4252. } while (0)
  4253. /* for systems using 32-bit format for bus addr */
  4254. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4255. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4256. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4257. do { \
  4258. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4259. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4260. } while (0)
  4261. /* for systems using 64-bit format for bus addr */
  4262. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4263. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4264. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4265. do { \
  4266. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4267. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4268. } while (0)
  4269. /* for systems using 64-bit format for bus addr */
  4270. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4271. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4272. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4273. do { \
  4274. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4275. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4276. } while (0)
  4277. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4278. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4279. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4280. do { \
  4281. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4282. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4283. } while (0)
  4284. /* for systems using 32-bit format for bus addr */
  4285. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4286. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4287. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4288. do { \
  4289. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4290. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4291. } while (0)
  4292. /* for systems using 64-bit format for bus addr */
  4293. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4294. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4295. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4296. do { \
  4297. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4298. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4299. } while (0)
  4300. /* for systems using 64-bit format for bus addr */
  4301. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4302. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4303. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4306. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4307. } while (0)
  4308. /* for systems using 32-bit format for bus addr */
  4309. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4310. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4311. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4314. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4315. } while (0)
  4316. /* for systems using 64-bit format for bus addr */
  4317. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4318. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4319. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4320. do { \
  4321. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4322. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4323. } while (0)
  4324. /* for systems using 64-bit format for bus addr */
  4325. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4326. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4327. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4328. do { \
  4329. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4330. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4331. } while (0)
  4332. /*
  4333. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4334. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4335. * addresses are stored in a XXX-bit field.
  4336. * This macro is used to define both htt_wdi_ipa_config32_t and
  4337. * htt_wdi_ipa_config64_t structs.
  4338. */
  4339. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4340. _paddr__tx_comp_ring_base_addr_, \
  4341. _paddr__tx_comp_wr_idx_addr_, \
  4342. _paddr__tx_ce_wr_idx_addr_, \
  4343. _paddr__rx_ind_ring_base_addr_, \
  4344. _paddr__rx_ind_rd_idx_addr_, \
  4345. _paddr__rx_ind_wr_idx_addr_, \
  4346. _paddr__rx_ring2_base_addr_,\
  4347. _paddr__rx_ring2_rd_idx_addr_,\
  4348. _paddr__rx_ring2_wr_idx_addr_) \
  4349. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4350. { \
  4351. /* DWORD 0: flags and meta-data */ \
  4352. A_UINT32 \
  4353. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4354. reserved: 8, \
  4355. tx_pkt_pool_size: 16;\
  4356. /* DWORD 1 */\
  4357. _paddr__tx_comp_ring_base_addr_;\
  4358. /* DWORD 2 (or 3)*/\
  4359. A_UINT32 tx_comp_ring_size;\
  4360. /* DWORD 3 (or 4)*/\
  4361. _paddr__tx_comp_wr_idx_addr_;\
  4362. /* DWORD 4 (or 6)*/\
  4363. _paddr__tx_ce_wr_idx_addr_;\
  4364. /* DWORD 5 (or 8)*/\
  4365. _paddr__rx_ind_ring_base_addr_;\
  4366. /* DWORD 6 (or 10)*/\
  4367. A_UINT32 rx_ind_ring_size;\
  4368. /* DWORD 7 (or 11)*/\
  4369. _paddr__rx_ind_rd_idx_addr_;\
  4370. /* DWORD 8 (or 13)*/\
  4371. _paddr__rx_ind_wr_idx_addr_;\
  4372. /* DWORD 9 (or 15)*/\
  4373. _paddr__rx_ring2_base_addr_;\
  4374. /* DWORD 10 (or 17) */\
  4375. A_UINT32 rx_ring2_size;\
  4376. /* DWORD 11 (or 18) */\
  4377. _paddr__rx_ring2_rd_idx_addr_;\
  4378. /* DWORD 12 (or 20) */\
  4379. _paddr__rx_ring2_wr_idx_addr_;\
  4380. } POSTPACK
  4381. /* define a htt_wdi_ipa_config32_t type */
  4382. 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));
  4383. /* define a htt_wdi_ipa_config64_t type */
  4384. 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));
  4385. #if HTT_PADDR64
  4386. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4387. #else
  4388. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4389. #endif
  4390. enum htt_wdi_ipa_op_code {
  4391. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4392. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4393. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4394. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4395. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4396. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4397. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4398. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4399. /* keep this last */
  4400. HTT_WDI_IPA_OPCODE_MAX
  4401. };
  4402. /**
  4403. * @brief HTT WDI_IPA Operation Request Message
  4404. *
  4405. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4406. *
  4407. * @details
  4408. * HTT WDI_IPA Operation Request message is sent by host
  4409. * to either suspend or resume WDI_IPA TX or RX path.
  4410. * |31 24|23 16|15 8|7 0|
  4411. * |----------------+----------------+----------------+----------------|
  4412. * | op_code | Rsvd | msg_type |
  4413. * |-------------------------------------------------------------------|
  4414. *
  4415. * Header fields:
  4416. * - MSG_TYPE
  4417. * Bits 7:0
  4418. * Purpose: Identifies this as WDI_IPA Operation Request message
  4419. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4420. * - OP_CODE
  4421. * Bits 31:16
  4422. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4423. * value: = enum htt_wdi_ipa_op_code
  4424. */
  4425. PREPACK struct htt_wdi_ipa_op_request_t
  4426. {
  4427. /* DWORD 0: flags and meta-data */
  4428. A_UINT32
  4429. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4430. reserved: 8,
  4431. op_code: 16;
  4432. } POSTPACK;
  4433. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4434. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4435. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4436. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4437. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4438. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4439. do { \
  4440. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4441. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4442. } while (0)
  4443. /*
  4444. * @brief host -> target HTT_MSI_SETUP message
  4445. *
  4446. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4447. *
  4448. * @details
  4449. * After target is booted up, host can send MSI setup message so that
  4450. * target sets up HW registers based on setup message.
  4451. *
  4452. * The message would appear as follows:
  4453. * |31 24|23 16|15|14 8|7 0|
  4454. * |---------------+-----------------+-----------------+-----------------|
  4455. * | reserved | msi_type | pdev_id | msg_type |
  4456. * |---------------------------------------------------------------------|
  4457. * | msi_addr_lo |
  4458. * |---------------------------------------------------------------------|
  4459. * | msi_addr_hi |
  4460. * |---------------------------------------------------------------------|
  4461. * | msi_data |
  4462. * |---------------------------------------------------------------------|
  4463. *
  4464. * The message is interpreted as follows:
  4465. * dword0 - b'0:7 - msg_type: This will be set to
  4466. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4467. * b'8:15 - pdev_id:
  4468. * 0 (for rings at SOC/UMAC level),
  4469. * 1/2/3 mac id (for rings at LMAC level)
  4470. * b'16:23 - msi_type: identify which msi registers need to be setup
  4471. * more details can be got from enum htt_msi_setup_type
  4472. * b'24:31 - reserved
  4473. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4474. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4475. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4476. */
  4477. PREPACK struct htt_msi_setup_t {
  4478. A_UINT32 msg_type: 8,
  4479. pdev_id: 8,
  4480. msi_type: 8,
  4481. reserved: 8;
  4482. A_UINT32 msi_addr_lo;
  4483. A_UINT32 msi_addr_hi;
  4484. A_UINT32 msi_data;
  4485. } POSTPACK;
  4486. enum htt_msi_setup_type {
  4487. HTT_PPDU_END_MSI_SETUP_TYPE,
  4488. /* Insert new types here*/
  4489. };
  4490. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4491. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4492. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4493. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4494. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4495. HTT_MSI_SETUP_PDEV_ID_S)
  4496. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4497. do { \
  4498. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4499. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4500. } while (0)
  4501. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4502. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4503. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4504. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4505. HTT_MSI_SETUP_MSI_TYPE_S)
  4506. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4507. do { \
  4508. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4509. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4510. } while (0)
  4511. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4512. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4513. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4514. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4515. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4516. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4517. do { \
  4518. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4519. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4520. } while (0)
  4521. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4522. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4523. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4524. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4525. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4526. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4527. do { \
  4528. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4529. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4530. } while (0)
  4531. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4532. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4533. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4534. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4535. HTT_MSI_SETUP_MSI_DATA_S)
  4536. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4537. do { \
  4538. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4539. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4540. } while (0)
  4541. /*
  4542. * @brief host -> target HTT_SRING_SETUP message
  4543. *
  4544. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4545. *
  4546. * @details
  4547. * After target is booted up, Host can send SRING setup message for
  4548. * each host facing LMAC SRING. Target setups up HW registers based
  4549. * on setup message and confirms back to Host if response_required is set.
  4550. * Host should wait for confirmation message before sending new SRING
  4551. * setup message
  4552. *
  4553. * The message would appear as follows:
  4554. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4555. * |--------------- +-----------------+-----------------+-----------------|
  4556. * | ring_type | ring_id | pdev_id | msg_type |
  4557. * |----------------------------------------------------------------------|
  4558. * | ring_base_addr_lo |
  4559. * |----------------------------------------------------------------------|
  4560. * | ring_base_addr_hi |
  4561. * |----------------------------------------------------------------------|
  4562. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4563. * |----------------------------------------------------------------------|
  4564. * | ring_head_offset32_remote_addr_lo |
  4565. * |----------------------------------------------------------------------|
  4566. * | ring_head_offset32_remote_addr_hi |
  4567. * |----------------------------------------------------------------------|
  4568. * | ring_tail_offset32_remote_addr_lo |
  4569. * |----------------------------------------------------------------------|
  4570. * | ring_tail_offset32_remote_addr_hi |
  4571. * |----------------------------------------------------------------------|
  4572. * | ring_msi_addr_lo |
  4573. * |----------------------------------------------------------------------|
  4574. * | ring_msi_addr_hi |
  4575. * |----------------------------------------------------------------------|
  4576. * | ring_msi_data |
  4577. * |----------------------------------------------------------------------|
  4578. * | intr_timer_th |IM| intr_batch_counter_th |
  4579. * |----------------------------------------------------------------------|
  4580. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4581. * |----------------------------------------------------------------------|
  4582. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4583. * |----------------------------------------------------------------------|
  4584. * Where
  4585. * IM = sw_intr_mode
  4586. * RR = response_required
  4587. * PTCF = prefetch_timer_cfg
  4588. * IP = IPA drop flag
  4589. *
  4590. * The message is interpreted as follows:
  4591. * dword0 - b'0:7 - msg_type: This will be set to
  4592. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4593. * b'8:15 - pdev_id:
  4594. * 0 (for rings at SOC/UMAC level),
  4595. * 1/2/3 mac id (for rings at LMAC level)
  4596. * b'16:23 - ring_id: identify which ring is to setup,
  4597. * more details can be got from enum htt_srng_ring_id
  4598. * b'24:31 - ring_type: identify type of host rings,
  4599. * more details can be got from enum htt_srng_ring_type
  4600. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4601. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4602. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4603. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4604. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4605. * SW_TO_HW_RING.
  4606. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4607. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4608. * Lower 32 bits of memory address of the remote variable
  4609. * storing the 4-byte word offset that identifies the head
  4610. * element within the ring.
  4611. * (The head offset variable has type A_UINT32.)
  4612. * Valid for HW_TO_SW and SW_TO_SW rings.
  4613. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4614. * Upper 32 bits of memory address of the remote variable
  4615. * storing the 4-byte word offset that identifies the head
  4616. * element within the ring.
  4617. * (The head offset variable has type A_UINT32.)
  4618. * Valid for HW_TO_SW and SW_TO_SW rings.
  4619. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4620. * Lower 32 bits of memory address of the remote variable
  4621. * storing the 4-byte word offset that identifies the tail
  4622. * element within the ring.
  4623. * (The tail offset variable has type A_UINT32.)
  4624. * Valid for HW_TO_SW and SW_TO_SW rings.
  4625. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4626. * Upper 32 bits of memory address of the remote variable
  4627. * storing the 4-byte word offset that identifies the tail
  4628. * element within the ring.
  4629. * (The tail offset variable has type A_UINT32.)
  4630. * Valid for HW_TO_SW and SW_TO_SW rings.
  4631. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4632. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4633. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4634. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4635. * dword10 - b'0:31 - ring_msi_data: MSI data
  4636. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4637. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4638. * dword11 - b'0:14 - intr_batch_counter_th:
  4639. * batch counter threshold is in units of 4-byte words.
  4640. * HW internally maintains and increments batch count.
  4641. * (see SRING spec for detail description).
  4642. * When batch count reaches threshold value, an interrupt
  4643. * is generated by HW.
  4644. * b'15 - sw_intr_mode:
  4645. * This configuration shall be static.
  4646. * Only programmed at power up.
  4647. * 0: generate pulse style sw interrupts
  4648. * 1: generate level style sw interrupts
  4649. * b'16:31 - intr_timer_th:
  4650. * The timer init value when timer is idle or is
  4651. * initialized to start downcounting.
  4652. * In 8us units (to cover a range of 0 to 524 ms)
  4653. * dword12 - b'0:15 - intr_low_threshold:
  4654. * Used only by Consumer ring to generate ring_sw_int_p.
  4655. * Ring entries low threshold water mark, that is used
  4656. * in combination with the interrupt timer as well as
  4657. * the the clearing of the level interrupt.
  4658. * b'16:18 - prefetch_timer_cfg:
  4659. * Used only by Consumer ring to set timer mode to
  4660. * support Application prefetch handling.
  4661. * The external tail offset/pointer will be updated
  4662. * at following intervals:
  4663. * 3'b000: (Prefetch feature disabled; used only for debug)
  4664. * 3'b001: 1 usec
  4665. * 3'b010: 4 usec
  4666. * 3'b011: 8 usec (default)
  4667. * 3'b100: 16 usec
  4668. * Others: Reserverd
  4669. * b'19 - response_required:
  4670. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4671. * b'20 - ipa_drop_flag:
  4672. Indicates that host will config ipa drop threshold percentage
  4673. * b'21:31 - reserved: reserved for future use
  4674. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4675. * b'8:15 - ipa drop high threshold percentage:
  4676. * b'16:31 - Reserved
  4677. */
  4678. PREPACK struct htt_sring_setup_t {
  4679. A_UINT32 msg_type: 8,
  4680. pdev_id: 8,
  4681. ring_id: 8,
  4682. ring_type: 8;
  4683. A_UINT32 ring_base_addr_lo;
  4684. A_UINT32 ring_base_addr_hi;
  4685. A_UINT32 ring_size: 16,
  4686. ring_entry_size: 8,
  4687. ring_misc_cfg_flag: 8;
  4688. A_UINT32 ring_head_offset32_remote_addr_lo;
  4689. A_UINT32 ring_head_offset32_remote_addr_hi;
  4690. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4691. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4692. A_UINT32 ring_msi_addr_lo;
  4693. A_UINT32 ring_msi_addr_hi;
  4694. A_UINT32 ring_msi_data;
  4695. A_UINT32 intr_batch_counter_th: 15,
  4696. sw_intr_mode: 1,
  4697. intr_timer_th: 16;
  4698. A_UINT32 intr_low_threshold: 16,
  4699. prefetch_timer_cfg: 3,
  4700. response_required: 1,
  4701. ipa_drop_flag: 1,
  4702. reserved1: 11;
  4703. A_UINT32 ipa_drop_low_threshold: 8,
  4704. ipa_drop_high_threshold: 8,
  4705. reserved: 16;
  4706. } POSTPACK;
  4707. enum htt_srng_ring_type {
  4708. HTT_HW_TO_SW_RING = 0,
  4709. HTT_SW_TO_HW_RING,
  4710. HTT_SW_TO_SW_RING,
  4711. /* Insert new ring types above this line */
  4712. };
  4713. enum htt_srng_ring_id {
  4714. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4715. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4716. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4717. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4718. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4719. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4720. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4721. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4722. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4723. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4724. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4725. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4726. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4727. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4728. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4729. /* Add Other SRING which can't be directly configured by host software above this line */
  4730. };
  4731. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4732. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4733. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4734. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4735. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4736. HTT_SRING_SETUP_PDEV_ID_S)
  4737. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4738. do { \
  4739. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4740. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4741. } while (0)
  4742. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4743. #define HTT_SRING_SETUP_RING_ID_S 16
  4744. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4745. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4746. HTT_SRING_SETUP_RING_ID_S)
  4747. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4748. do { \
  4749. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4750. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4751. } while (0)
  4752. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4753. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4754. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4755. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4756. HTT_SRING_SETUP_RING_TYPE_S)
  4757. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4758. do { \
  4759. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4760. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4761. } while (0)
  4762. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4763. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4764. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4765. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4766. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4767. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4768. do { \
  4769. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4770. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4771. } while (0)
  4772. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4773. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4774. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4775. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4776. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4777. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4778. do { \
  4779. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4780. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4781. } while (0)
  4782. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4783. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4784. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4785. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4786. HTT_SRING_SETUP_RING_SIZE_S)
  4787. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4788. do { \
  4789. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4790. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4791. } while (0)
  4792. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4793. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4794. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4795. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4796. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4797. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4798. do { \
  4799. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4800. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4801. } while (0)
  4802. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4803. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4804. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4805. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4806. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4807. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4808. do { \
  4809. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4810. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4811. } while (0)
  4812. /* This control bit is applicable to only Producer, which updates Ring ID field
  4813. * of each descriptor before pushing into the ring.
  4814. * 0: updates ring_id(default)
  4815. * 1: ring_id updating disabled */
  4816. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4817. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4818. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4819. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4820. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4821. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4822. do { \
  4823. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4824. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4825. } while (0)
  4826. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4827. * of each descriptor before pushing into the ring.
  4828. * 0: updates Loopcnt(default)
  4829. * 1: Loopcnt updating disabled */
  4830. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4831. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4832. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4833. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4834. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4835. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4836. do { \
  4837. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4838. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4839. } while (0)
  4840. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4841. * into security_id port of GXI/AXI. */
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4845. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4846. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4847. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4848. do { \
  4849. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4850. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4851. } while (0)
  4852. /* During MSI write operation, SRNG drives value of this register bit into
  4853. * swap bit of GXI/AXI. */
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4857. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4858. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4860. do { \
  4861. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4862. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4863. } while (0)
  4864. /* During Pointer write operation, SRNG drives value of this register bit into
  4865. * swap bit of GXI/AXI. */
  4866. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4867. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4869. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4870. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4872. do { \
  4873. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4874. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4875. } while (0)
  4876. /* During any data or TLV write operation, SRNG drives value of this register
  4877. * bit into swap bit of GXI/AXI. */
  4878. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4879. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4880. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4881. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4882. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4884. do { \
  4885. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4886. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4887. } while (0)
  4888. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4889. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4890. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4891. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4892. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4893. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4894. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4895. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4896. do { \
  4897. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4898. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4899. } while (0)
  4900. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4901. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4902. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4903. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4904. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4905. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4906. do { \
  4907. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4908. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4909. } while (0)
  4910. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4911. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4912. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4913. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4914. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4915. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4916. do { \
  4917. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4918. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4919. } while (0)
  4920. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4921. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4922. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4923. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4924. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4925. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4926. do { \
  4927. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4928. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4929. } while (0)
  4930. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4931. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4932. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4933. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4934. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4935. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4936. do { \
  4937. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4938. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4939. } while (0)
  4940. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4941. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4942. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4943. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4944. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4945. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4946. do { \
  4947. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4948. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4949. } while (0)
  4950. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4951. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4952. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4953. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4954. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4955. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4956. do { \
  4957. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4958. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4959. } while (0)
  4960. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4961. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4962. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4963. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4964. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4965. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4966. do { \
  4967. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4968. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4969. } while (0)
  4970. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4971. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4972. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4973. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4974. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4975. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4976. do { \
  4977. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4978. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4979. } while (0)
  4980. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4981. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4982. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4983. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4984. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4985. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4986. do { \
  4987. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4988. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4989. } while (0)
  4990. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4991. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4992. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4993. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4994. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4995. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4996. do { \
  4997. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4998. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4999. } while (0)
  5000. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5001. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5002. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5003. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5004. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5005. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5006. do { \
  5007. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5008. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5009. } while (0)
  5010. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5011. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5012. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5013. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5014. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5015. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5016. do { \
  5017. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5018. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5019. } while (0)
  5020. /**
  5021. * @brief host -> target RX ring selection config message
  5022. *
  5023. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5024. *
  5025. * @details
  5026. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5027. * configure RXDMA rings.
  5028. * The configuration is per ring based and includes both packet subtypes
  5029. * and PPDU/MPDU TLVs.
  5030. *
  5031. * The message would appear as follows:
  5032. *
  5033. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5034. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5035. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5036. * |-------------------------------------------------------------------|
  5037. * | rsvd2 | ring_buffer_size |
  5038. * |-------------------------------------------------------------------|
  5039. * | packet_type_enable_flags_0 |
  5040. * |-------------------------------------------------------------------|
  5041. * | packet_type_enable_flags_1 |
  5042. * |-------------------------------------------------------------------|
  5043. * | packet_type_enable_flags_2 |
  5044. * |-------------------------------------------------------------------|
  5045. * | packet_type_enable_flags_3 |
  5046. * |-------------------------------------------------------------------|
  5047. * | tlv_filter_in_flags |
  5048. * |-------------------------------------------------------------------|
  5049. * | rx_header_offset | rx_packet_offset |
  5050. * |-------------------------------------------------------------------|
  5051. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5052. * |-------------------------------------------------------------------|
  5053. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5054. * |-------------------------------------------------------------------|
  5055. * | rsvd3 | rx_attention_offset |
  5056. * |-------------------------------------------------------------------|
  5057. * | rsvd4 | mo| fp| rx_drop_threshold |
  5058. * | |ndp|ndp| |
  5059. * |-------------------------------------------------------------------|
  5060. * Where:
  5061. * PS = pkt_swap
  5062. * SS = status_swap
  5063. * OV = rx_offsets_valid
  5064. * DT = drop_thresh_valid
  5065. * The message is interpreted as follows:
  5066. * dword0 - b'0:7 - msg_type: This will be set to
  5067. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5068. * b'8:15 - pdev_id:
  5069. * 0 (for rings at SOC/UMAC level),
  5070. * 1/2/3 mac id (for rings at LMAC level)
  5071. * b'16:23 - ring_id : Identify the ring to configure.
  5072. * More details can be got from enum htt_srng_ring_id
  5073. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5074. * BUF_RING_CFG_0 defs within HW .h files,
  5075. * e.g. wmac_top_reg_seq_hwioreg.h
  5076. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5077. * BUF_RING_CFG_0 defs within HW .h files,
  5078. * e.g. wmac_top_reg_seq_hwioreg.h
  5079. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5080. * configuration fields are valid
  5081. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5082. * rx_drop_threshold field is valid
  5083. * b'28 - rx_mon_global_en: Enable/Disable global register
  5084. 8 configuration in Rx monitor module.
  5085. * b'29:31 - rsvd1: reserved for future use
  5086. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5087. * in byte units.
  5088. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5089. * b'16:18 - config_length_mgmt (MGMT):
  5090. * Represents the length of mpdu bytes for mgmt pkt.
  5091. * valid values:
  5092. * 001 - 64bytes
  5093. * 010 - 128bytes
  5094. * 100 - 256bytes
  5095. * 111 - Full mpdu bytes
  5096. * b'19:21 - config_length_ctrl (CTRL):
  5097. * Represents the length of mpdu bytes for ctrl pkt.
  5098. * valid values:
  5099. * 001 - 64bytes
  5100. * 010 - 128bytes
  5101. * 100 - 256bytes
  5102. * 111 - Full mpdu bytes
  5103. * b'22:24 - config_length_data (DATA):
  5104. * Represents the length of mpdu bytes for data pkt.
  5105. * valid values:
  5106. * 001 - 64bytes
  5107. * 010 - 128bytes
  5108. * 100 - 256bytes
  5109. * 111 - Full mpdu bytes
  5110. * b'25:26 - rx_hdr_len:
  5111. * Specifies the number of bytes of recvd packet to copy
  5112. * into the rx_hdr tlv.
  5113. * supported values for now by host:
  5114. * 01 - 64bytes
  5115. * 10 - 128bytes
  5116. * 11 - 256bytes
  5117. * default - 128 bytes
  5118. * b'27:31 - rsvd2: Reserved for future use
  5119. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5120. * Enable MGMT packet from 0b0000 to 0b1001
  5121. * bits from low to high: FP, MD, MO - 3 bits
  5122. * FP: Filter_Pass
  5123. * MD: Monitor_Direct
  5124. * MO: Monitor_Other
  5125. * 10 mgmt subtypes * 3 bits -> 30 bits
  5126. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5127. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5128. * Enable MGMT packet from 0b1010 to 0b1111
  5129. * bits from low to high: FP, MD, MO - 3 bits
  5130. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5131. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5132. * Enable CTRL packet from 0b0000 to 0b1001
  5133. * bits from low to high: FP, MD, MO - 3 bits
  5134. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5135. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5136. * Enable CTRL packet from 0b1010 to 0b1111,
  5137. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5138. * bits from low to high: FP, MD, MO - 3 bits
  5139. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5140. * dword6 - b'0:31 - tlv_filter_in_flags:
  5141. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5142. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5143. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5144. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5145. * A value of 0 will be considered as ignore this config.
  5146. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5147. * e.g. wmac_top_reg_seq_hwioreg.h
  5148. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5149. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5150. * A value of 0 will be considered as ignore this config.
  5151. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5152. * e.g. wmac_top_reg_seq_hwioreg.h
  5153. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5154. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5155. * A value of 0 will be considered as ignore this config.
  5156. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5157. * e.g. wmac_top_reg_seq_hwioreg.h
  5158. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5159. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5160. * A value of 0 will be considered as ignore this config.
  5161. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5162. * e.g. wmac_top_reg_seq_hwioreg.h
  5163. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5164. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5165. * A value of 0 will be considered as ignore this config.
  5166. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5167. * e.g. wmac_top_reg_seq_hwioreg.h
  5168. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5169. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5170. * A value of 0 will be considered as ignore this config.
  5171. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5172. * e.g. wmac_top_reg_seq_hwioreg.h
  5173. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5174. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5175. * A value of 0 will be considered as ignore this config.
  5176. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5177. * e.g. wmac_top_reg_seq_hwioreg.h
  5178. * - b'16:31 - rsvd3 for future use
  5179. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5180. * to source rings. Consumer drops packets if the available
  5181. * words in the ring falls below the configured threshold
  5182. * value.
  5183. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5184. * by host. 1 -> subscribed
  5185. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5186. * by host. 1 -> subscribed
  5187. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5188. * subscribed by host. 1 -> subscribed
  5189. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5190. * selection for the FP PHY ERR status tlv.
  5191. * 0 - wbm2rxdma_buf_source_ring
  5192. * 1 - fw2rxdma_buf_source_ring
  5193. * 2 - sw2rxdma_buf_source_ring
  5194. * 3 - no_buffer_ring
  5195. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5196. * selection for the FP PHY ERR status tlv.
  5197. * 0 - rxdma_release_ring
  5198. * 1 - rxdma2fw_ring
  5199. * 2 - rxdma2sw_ring
  5200. * 3 - rxdma2reo_ring
  5201. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5202. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5203. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5204. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5205. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5206. * 0: MSDU level logging
  5207. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5208. * 0: MSDU level logging
  5209. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5210. * 0: MSDU level logging
  5211. * - b'23 - word_mask_compaction: enable/disable word mask for
  5212. * mpdu/msdu start/end tlvs
  5213. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5214. * manager override
  5215. * - b'25:28 - rbm_override_val: return buffer manager override value
  5216. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5217. * which have to be posted to host from phy.
  5218. * Corresponding to errors defined in
  5219. * phyrx_abort_request_reason enums 0 to 31.
  5220. * Refer to RXPCU register definition header files for the
  5221. * phyrx_abort_request_reason enum definition.
  5222. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5223. * errors which have to be posted to host from phy.
  5224. * Corresponding to errors defined in
  5225. * phyrx_abort_request_reason enums 32 to 63.
  5226. * Refer to RXPCU register definition header files for the
  5227. * phyrx_abort_request_reason enum definition.
  5228. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5229. * applicable if word mask enabled
  5230. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5231. * applicable if word mask enabled
  5232. * - b'19:31 - rsvd7
  5233. * dword15- b'0:16 - rx_msdu_end_word_mask
  5234. * - b'17:31 - rsvd5
  5235. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5236. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5237. * buffer
  5238. * 1: RX_PKT TLV logging at specified offset for the
  5239. * subsequent buffer
  5240. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5241. */
  5242. PREPACK struct htt_rx_ring_selection_cfg_t {
  5243. A_UINT32 msg_type: 8,
  5244. pdev_id: 8,
  5245. ring_id: 8,
  5246. status_swap: 1,
  5247. pkt_swap: 1,
  5248. rx_offsets_valid: 1,
  5249. drop_thresh_valid: 1,
  5250. rx_mon_global_en: 1,
  5251. rsvd1: 3;
  5252. A_UINT32 ring_buffer_size: 16,
  5253. config_length_mgmt:3,
  5254. config_length_ctrl:3,
  5255. config_length_data:3,
  5256. rx_hdr_len: 2,
  5257. rsvd2: 5;
  5258. A_UINT32 packet_type_enable_flags_0;
  5259. A_UINT32 packet_type_enable_flags_1;
  5260. A_UINT32 packet_type_enable_flags_2;
  5261. A_UINT32 packet_type_enable_flags_3;
  5262. A_UINT32 tlv_filter_in_flags;
  5263. A_UINT32 rx_packet_offset: 16,
  5264. rx_header_offset: 16;
  5265. A_UINT32 rx_mpdu_end_offset: 16,
  5266. rx_mpdu_start_offset: 16;
  5267. A_UINT32 rx_msdu_end_offset: 16,
  5268. rx_msdu_start_offset: 16;
  5269. A_UINT32 rx_attn_offset: 16,
  5270. rsvd3: 16;
  5271. A_UINT32 rx_drop_threshold: 10,
  5272. fp_ndp: 1,
  5273. mo_ndp: 1,
  5274. fp_phy_err: 1,
  5275. fp_phy_err_buf_src: 2,
  5276. fp_phy_err_buf_dest: 2,
  5277. pkt_type_enable_msdu_or_mpdu_logging:3,
  5278. dma_mpdu_mgmt: 1,
  5279. dma_mpdu_ctrl: 1,
  5280. dma_mpdu_data: 1,
  5281. word_mask_compaction_enable:1,
  5282. rbm_override_enable: 1,
  5283. rbm_override_val: 4,
  5284. rsvd4: 3;
  5285. A_UINT32 phy_err_mask;
  5286. A_UINT32 phy_err_mask_cont;
  5287. A_UINT32 rx_mpdu_start_word_mask:16,
  5288. rx_mpdu_end_word_mask: 3,
  5289. rsvd7: 13;
  5290. A_UINT32 rx_msdu_end_word_mask: 17,
  5291. rsvd5: 15;
  5292. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5293. rx_pkt_tlv_offset: 15,
  5294. rsvd6: 16;
  5295. } POSTPACK;
  5296. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5297. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5298. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5299. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5300. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5301. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5302. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5303. do { \
  5304. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5305. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5306. } while (0)
  5307. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5308. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5309. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5310. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5311. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5312. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5313. do { \
  5314. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5315. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5316. } while (0)
  5317. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5318. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5319. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5320. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5321. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5322. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5323. do { \
  5324. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5325. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5326. } while (0)
  5327. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5328. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5329. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5330. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5331. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5332. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5333. do { \
  5334. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5335. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5336. } while (0)
  5337. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5338. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5339. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5340. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5341. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5342. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5343. do { \
  5344. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5345. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5346. } while (0)
  5347. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5348. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5349. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5350. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5351. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5352. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5353. do { \
  5354. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5355. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5356. } while (0)
  5357. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5358. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5359. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5360. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5361. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5362. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5363. do { \
  5364. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5365. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5366. } while (0)
  5367. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5368. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5369. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5370. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5371. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5372. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5373. do { \
  5374. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5375. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5376. } while (0)
  5377. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5378. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5379. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5380. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5381. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5382. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5383. do { \
  5384. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5385. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5386. } while (0)
  5387. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5388. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5389. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5390. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5391. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5392. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5393. do { \
  5394. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5395. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5396. } while (0)
  5397. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5398. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5399. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5400. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5401. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5402. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5403. do { \
  5404. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5405. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5406. } while (0)
  5407. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5408. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5409. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5410. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5411. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5412. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5413. do { \
  5414. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5415. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5416. } while(0)
  5417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5420. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5421. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5423. do { \
  5424. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5425. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5426. } while (0)
  5427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5430. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5431. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5433. do { \
  5434. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5435. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5436. } while (0)
  5437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5440. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5441. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5443. do { \
  5444. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5445. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5446. } while (0)
  5447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5450. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5451. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5453. do { \
  5454. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5455. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5456. } while (0)
  5457. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5458. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5459. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5460. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5461. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5462. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5463. do { \
  5464. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5465. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5466. } while (0)
  5467. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5468. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5469. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5470. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5471. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5472. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5473. do { \
  5474. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5475. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5476. } while (0)
  5477. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5479. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5480. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5481. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5482. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5483. do { \
  5484. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5485. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5486. } while (0)
  5487. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5488. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5489. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5490. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5491. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5492. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5493. do { \
  5494. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5495. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5496. } while (0)
  5497. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5498. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5499. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5500. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5501. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5502. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5503. do { \
  5504. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5505. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5506. } while (0)
  5507. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5508. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5509. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5510. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5511. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5512. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5513. do { \
  5514. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5515. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5516. } while (0)
  5517. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5519. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5520. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5521. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5522. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5523. do { \
  5524. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5525. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5526. } while (0)
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5530. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5531. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5532. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5533. do { \
  5534. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5535. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5536. } while (0)
  5537. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5540. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5541. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5542. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5543. do { \
  5544. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5545. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5546. } while (0)
  5547. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5548. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5549. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5550. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5551. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5552. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5553. do { \
  5554. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5555. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5556. } while (0)
  5557. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5558. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5559. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5560. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5561. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5562. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5563. do { \
  5564. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5565. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5566. } while (0)
  5567. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5568. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5569. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5570. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5571. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5572. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5573. do { \
  5574. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5575. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5576. } while (0)
  5577. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5578. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5579. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5580. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5581. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5582. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5583. do { \
  5584. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5585. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5586. } while (0)
  5587. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5588. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5589. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5590. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5591. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5592. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5593. do { \
  5594. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5595. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5596. } while (0)
  5597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5600. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5601. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5603. do { \
  5604. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5605. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5606. } while (0)
  5607. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5608. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5609. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5610. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5611. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5612. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5613. do { \
  5614. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5615. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5616. } while (0)
  5617. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5618. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5619. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5620. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5621. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5622. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5623. do { \
  5624. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5625. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5626. } while (0)
  5627. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5628. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5629. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5630. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5631. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5632. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5633. do { \
  5634. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5635. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5636. } while (0)
  5637. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5638. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5639. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5640. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5641. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5642. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5643. do { \
  5644. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5645. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5646. } while (0)
  5647. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5648. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5649. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5650. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5651. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5652. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5653. do { \
  5654. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5655. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5656. } while (0)
  5657. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5658. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5659. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5660. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5661. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5662. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5663. do { \
  5664. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5665. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5666. } while (0)
  5667. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5668. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5669. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5670. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5671. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5672. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5673. do { \
  5674. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5675. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5676. } while (0)
  5677. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5678. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5679. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5680. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5681. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5682. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5683. do { \
  5684. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5685. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5686. } while (0)
  5687. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5688. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5689. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5690. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5691. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5692. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5693. do { \
  5694. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5695. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5696. } while (0)
  5697. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5698. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5699. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5700. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5701. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5702. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5703. do { \
  5704. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5705. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5706. } while (0)
  5707. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5708. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5709. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5710. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5711. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5712. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5713. do { \
  5714. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5715. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5716. } while (0)
  5717. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5718. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5719. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5720. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5721. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5722. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5723. do { \
  5724. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5725. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5726. } while (0)
  5727. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5728. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5729. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5730. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5731. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5732. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5733. do { \
  5734. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5735. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5736. } while (0)
  5737. /*
  5738. * Subtype based MGMT frames enable bits.
  5739. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5740. */
  5741. /* association request */
  5742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5748. /* association response */
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5755. /* Reassociation request */
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5762. /* Reassociation response */
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5769. /* Probe request */
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5776. /* Probe response */
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5783. /* Timing Advertisement */
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5790. /* Reserved */
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5797. /* Beacon */
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5804. /* ATIM */
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5811. /* Disassociation */
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5818. /* Authentication */
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5825. /* Deauthentication */
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5832. /* Action */
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5839. /* Action No Ack */
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5846. /* Reserved */
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5853. /*
  5854. * Subtype based CTRL frames enable bits.
  5855. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5856. */
  5857. /* Reserved */
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5864. /* Reserved */
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5871. /* Reserved */
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5878. /* Reserved */
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5885. /* Reserved */
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5892. /* Reserved */
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5899. /* Reserved */
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5906. /* Control Wrapper */
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5913. /* Block Ack Request */
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5920. /* Block Ack*/
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5927. /* PS-POLL */
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5934. /* RTS */
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5941. /* CTS */
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5948. /* ACK */
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5955. /* CF-END */
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5962. /* CF-END + CF-ACK */
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5969. /* Multicast data */
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5976. /* Unicast data */
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5983. /* NULL data */
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5991. do { \
  5992. HTT_CHECK_SET_VAL(httsym, value); \
  5993. (word) |= (value) << httsym##_S; \
  5994. } while (0)
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5996. (((word) & httsym##_M) >> httsym##_S)
  5997. #define htt_rx_ring_pkt_enable_subtype_set( \
  5998. word, flag, mode, type, subtype, val) \
  5999. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6000. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6001. #define htt_rx_ring_pkt_enable_subtype_get( \
  6002. word, flag, mode, type, subtype) \
  6003. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6004. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6005. /* Definition to filter in TLVs */
  6006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6034. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6035. do { \
  6036. HTT_CHECK_SET_VAL(httsym, enable); \
  6037. (word) |= (enable) << httsym##_S; \
  6038. } while (0)
  6039. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6040. (((word) & httsym##_M) >> httsym##_S)
  6041. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6042. HTT_RX_RING_TLV_ENABLE_SET( \
  6043. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6044. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6045. HTT_RX_RING_TLV_ENABLE_GET( \
  6046. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6047. /**
  6048. * @brief host -> target TX monitor config message
  6049. *
  6050. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6051. *
  6052. * @details
  6053. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6054. * configure RXDMA rings.
  6055. * The configuration is per ring based and includes both packet types
  6056. * and PPDU/MPDU TLVs.
  6057. *
  6058. * The message would appear as follows:
  6059. *
  6060. * |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|
  6061. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6062. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6063. * |-----------+--------+--------+-----+------------------------------------|
  6064. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6065. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6066. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6067. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6068. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6069. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6070. * |------------------------------------------------------------------------|
  6071. * | tlv_filter_mask_in0 |
  6072. * |------------------------------------------------------------------------|
  6073. * | tlv_filter_mask_in1 |
  6074. * |------------------------------------------------------------------------|
  6075. * | tlv_filter_mask_in2 |
  6076. * |------------------------------------------------------------------------|
  6077. * | tlv_filter_mask_in3 |
  6078. * |-----------------+-----------------+---------------------+--------------|
  6079. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6080. * |------------------------------------------------------------------------|
  6081. * | pcu_ppdu_setup_word_mask |
  6082. * |--------------------+--+--+--+-----+---------------------+--------------|
  6083. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6084. * |------------------------------------------------------------------------|
  6085. *
  6086. * Where:
  6087. * PS = pkt_swap
  6088. * SS = status_swap
  6089. * The message is interpreted as follows:
  6090. * dword0 - b'0:7 - msg_type: This will be set to
  6091. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6092. * b'8:15 - pdev_id:
  6093. * 0 (for rings at SOC level),
  6094. * 1/2/3 mac id (for rings at LMAC level)
  6095. * b'16:23 - ring_id : Identify the ring to configure.
  6096. * More details can be got from enum htt_srng_ring_id
  6097. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6098. * BUF_RING_CFG_0 defs within HW .h files,
  6099. * e.g. wmac_top_reg_seq_hwioreg.h
  6100. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6101. * BUF_RING_CFG_0 defs within HW .h files,
  6102. * e.g. wmac_top_reg_seq_hwioreg.h
  6103. * b'26 - tx_mon_global_en: Enable/Disable global register
  6104. * configuration in Tx monitor module.
  6105. * b'27:31 - rsvd1: reserved for future use
  6106. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6107. * in byte units.
  6108. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6109. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6110. * 64, 128, 256.
  6111. * If all 3 bits are set config length is > 256.
  6112. * if val is '0', then ignore this field.
  6113. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6114. * 64, 128, 256.
  6115. * If all 3 bits are set config length is > 256.
  6116. * if val is '0', then ignore this field.
  6117. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6118. * 64, 128, 256.
  6119. * If all 3 bits are set config length is > 256.
  6120. * If val is '0', then ignore this field.
  6121. * - b'25:31 - rsvd2: Reserved for future use
  6122. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6123. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6124. * If packet_type_enable_flags is '1' for MGMT type,
  6125. * monitor will ignore this bit and allow this TLV.
  6126. * If packet_type_enable_flags is '0' for MGMT type,
  6127. * monitor will use this bit to enable/disable logging
  6128. * of this TLV.
  6129. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6130. * If packet_type_enable_flags is '1' for CTRL type,
  6131. * monitor will ignore this bit and allow this TLV.
  6132. * If packet_type_enable_flags is '0' for CTRL type,
  6133. * monitor will use this bit to enable/disable logging
  6134. * of this TLV.
  6135. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6136. * If packet_type_enable_flags is '1' for DATA type,
  6137. * monitor will ignore this bit and allow this TLV.
  6138. * If packet_type_enable_flags is '0' for DATA type,
  6139. * monitor will use this bit to enable/disable logging
  6140. * of this TLV.
  6141. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6142. * If packet_type_enable_flags is '1' for MGMT type,
  6143. * monitor will ignore this bit and allow this TLV.
  6144. * If packet_type_enable_flags is '0' for MGMT type,
  6145. * monitor will use this bit to enable/disable logging
  6146. * of this TLV.
  6147. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6148. * If packet_type_enable_flags is '1' for CTRL type,
  6149. * monitor will ignore this bit and allow this TLV.
  6150. * If packet_type_enable_flags is '0' for CTRL type,
  6151. * monitor will use this bit to enable/disable logging
  6152. * of this TLV.
  6153. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6154. * If packet_type_enable_flags is '1' for DATA type,
  6155. * monitor will ignore this bit and allow this TLV.
  6156. * If packet_type_enable_flags is '0' for DATA type,
  6157. * monitor will use this bit to enable/disable logging
  6158. * of this TLV.
  6159. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6160. * If packet_type_enable_flags is '1' for MGMT type,
  6161. * monitor will ignore this bit and allow this TLV.
  6162. * If packet_type_enable_flags is '0' for MGMT type,
  6163. * monitor will use this bit to enable/disable logging
  6164. * of this TLV.
  6165. * If filter_in_TX_MPDU_START = 1 it is recommended
  6166. * to set this bit.
  6167. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6168. * If packet_type_enable_flags is '1' for CTRL type,
  6169. * monitor will ignore this bit and allow this TLV.
  6170. * If packet_type_enable_flags is '0' for CTRL type,
  6171. * monitor will use this bit to enable/disable logging
  6172. * of this TLV.
  6173. * If filter_in_TX_MPDU_START = 1 it is recommended
  6174. * to set this bit.
  6175. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6176. * If packet_type_enable_flags is '1' for DATA type,
  6177. * monitor will ignore this bit and allow this TLV.
  6178. * If packet_type_enable_flags is '0' for DATA type,
  6179. * monitor will use this bit to enable/disable logging
  6180. * of this TLV.
  6181. * If filter_in_TX_MPDU_START = 1 it is recommended
  6182. * to set this bit.
  6183. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6184. * If packet_type_enable_flags is '1' for MGMT type,
  6185. * monitor will ignore this bit and allow this TLV.
  6186. * If packet_type_enable_flags is '0' for MGMT type,
  6187. * monitor will use this bit to enable/disable logging
  6188. * of this TLV.
  6189. * If filter_in_TX_MSDU_START = 1 it is recommended
  6190. * to set this bit.
  6191. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6192. * If packet_type_enable_flags is '1' for CTRL type,
  6193. * monitor will ignore this bit and allow this TLV.
  6194. * If packet_type_enable_flags is '0' for CTRL type,
  6195. * monitor will use this bit to enable/disable logging
  6196. * of this TLV.
  6197. * If filter_in_TX_MSDU_START = 1 it is recommended
  6198. * to set this bit.
  6199. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6200. * If packet_type_enable_flags is '1' for DATA type,
  6201. * monitor will ignore this bit and allow this TLV.
  6202. * If packet_type_enable_flags is '0' for DATA type,
  6203. * monitor will use this bit to enable/disable logging
  6204. * of this TLV.
  6205. * If filter_in_TX_MSDU_START = 1 it is recommended
  6206. * to set this bit.
  6207. * b'15:31 - rsvd3: Reserved for future use
  6208. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6209. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6210. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6211. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6212. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6213. * - b'8:15 - tx_peer_entry_word_mask:
  6214. * - b'16:23 - tx_queue_ext_word_mask:
  6215. * - b'24:31 - tx_msdu_start_word_mask:
  6216. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6217. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6218. * - b'8:15 - rxpcu_user_setup_word_mask:
  6219. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6220. * MGMT, CTRL, DATA
  6221. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6222. * 0 -> MSDU level logging is enabled
  6223. * (valid only if bit is set in
  6224. * pkt_type_enable_msdu_or_mpdu_logging)
  6225. * 1 -> MPDU level logging is enabled
  6226. * (valid only if bit is set in
  6227. * pkt_type_enable_msdu_or_mpdu_logging)
  6228. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6229. * 0 -> MSDU level logging is enabled
  6230. * (valid only if bit is set in
  6231. * pkt_type_enable_msdu_or_mpdu_logging)
  6232. * 1 -> MPDU level logging is enabled
  6233. * (valid only if bit is set in
  6234. * pkt_type_enable_msdu_or_mpdu_logging)
  6235. * - b'21 - dma_mpdu_data(D) : For DATA
  6236. * 0 -> MSDU level logging is enabled
  6237. * (valid only if bit is set in
  6238. * pkt_type_enable_msdu_or_mpdu_logging)
  6239. * 1 -> MPDU level logging is enabled
  6240. * (valid only if bit is set in
  6241. * pkt_type_enable_msdu_or_mpdu_logging)
  6242. * - b'22:31 - rsvd4 for future use
  6243. */
  6244. PREPACK struct htt_tx_monitor_cfg_t {
  6245. A_UINT32 msg_type: 8,
  6246. pdev_id: 8,
  6247. ring_id: 8,
  6248. status_swap: 1,
  6249. pkt_swap: 1,
  6250. tx_mon_global_en: 1,
  6251. rsvd1: 5;
  6252. A_UINT32 ring_buffer_size: 16,
  6253. config_length_mgmt: 3,
  6254. config_length_ctrl: 3,
  6255. config_length_data: 3,
  6256. rsvd2: 7;
  6257. A_UINT32 pkt_type_enable_flags: 3,
  6258. filter_in_tx_mpdu_start_mgmt: 1,
  6259. filter_in_tx_mpdu_start_ctrl: 1,
  6260. filter_in_tx_mpdu_start_data: 1,
  6261. filter_in_tx_msdu_start_mgmt: 1,
  6262. filter_in_tx_msdu_start_ctrl: 1,
  6263. filter_in_tx_msdu_start_data: 1,
  6264. filter_in_tx_mpdu_end_mgmt: 1,
  6265. filter_in_tx_mpdu_end_ctrl: 1,
  6266. filter_in_tx_mpdu_end_data: 1,
  6267. filter_in_tx_msdu_end_mgmt: 1,
  6268. filter_in_tx_msdu_end_ctrl: 1,
  6269. filter_in_tx_msdu_end_data: 1,
  6270. rsvd3: 17;
  6271. A_UINT32 tlv_filter_mask_in0;
  6272. A_UINT32 tlv_filter_mask_in1;
  6273. A_UINT32 tlv_filter_mask_in2;
  6274. A_UINT32 tlv_filter_mask_in3;
  6275. A_UINT32 tx_fes_setup_word_mask: 8,
  6276. tx_peer_entry_word_mask: 8,
  6277. tx_queue_ext_word_mask: 8,
  6278. tx_msdu_start_word_mask: 8;
  6279. A_UINT32 pcu_ppdu_setup_word_mask;
  6280. A_UINT32 tx_mpdu_start_word_mask: 8,
  6281. rxpcu_user_setup_word_mask: 8,
  6282. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6283. dma_mpdu_mgmt: 1,
  6284. dma_mpdu_ctrl: 1,
  6285. dma_mpdu_data: 1,
  6286. rsvd4: 10;
  6287. } POSTPACK;
  6288. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6289. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6290. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6291. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6292. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6293. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6294. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6295. do { \
  6296. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6297. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6298. } while (0)
  6299. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6300. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6301. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6302. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6303. HTT_TX_MONITOR_CFG_RING_ID_S)
  6304. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6305. do { \
  6306. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6307. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6308. } while (0)
  6309. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6310. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6311. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6312. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6313. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6314. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6315. do { \
  6316. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6317. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6318. } while (0)
  6319. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6320. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6321. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6322. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6323. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6324. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6325. do { \
  6326. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6327. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6328. } while (0)
  6329. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6330. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6331. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6332. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6333. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6334. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6335. do { \
  6336. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6337. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6338. } while (0)
  6339. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6340. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6341. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6342. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6343. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6344. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6345. do { \
  6346. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6347. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6348. } while (0)
  6349. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6350. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6351. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6352. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6353. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6354. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6355. do { \
  6356. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6357. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6358. } while (0)
  6359. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6360. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6361. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6362. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6363. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6364. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6365. do { \
  6366. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6367. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6368. } while (0)
  6369. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6370. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6371. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6372. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6373. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6374. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6375. do { \
  6376. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6377. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6378. } while (0)
  6379. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6380. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6381. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6382. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6383. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6384. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6385. do { \
  6386. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6387. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6388. } while (0)
  6389. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6390. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6391. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6392. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6393. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6394. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6395. do { \
  6396. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6397. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6398. } while (0)
  6399. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6400. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6401. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6402. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6403. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6404. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6405. do { \
  6406. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6407. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6408. } while (0)
  6409. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6410. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6411. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6412. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6413. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6414. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6415. do { \
  6416. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6417. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6418. } while (0)
  6419. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6420. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6421. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6422. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6423. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6424. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6425. do { \
  6426. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6427. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6428. } while (0)
  6429. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6430. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6431. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6432. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6433. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6434. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6435. do { \
  6436. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6437. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6438. } while (0)
  6439. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6440. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6441. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6442. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6443. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6444. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6445. do { \
  6446. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6447. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6448. } while (0)
  6449. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6450. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6451. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6452. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6453. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6454. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6455. do { \
  6456. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6457. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6458. } while (0)
  6459. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6460. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6461. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6462. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6463. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6464. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6465. do { \
  6466. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6467. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6468. } while (0)
  6469. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6470. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6471. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6472. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6473. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6474. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6475. do { \
  6476. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6477. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6478. } while (0)
  6479. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6480. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6481. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6482. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6483. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6484. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6485. do { \
  6486. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6487. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6488. } while (0)
  6489. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6490. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6491. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6492. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6493. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6494. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6495. do { \
  6496. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6497. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6498. } while (0)
  6499. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6500. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6501. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6502. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6503. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6504. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6505. do { \
  6506. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6507. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6508. } while (0)
  6509. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6510. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6511. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6512. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6513. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6514. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6515. do { \
  6516. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6517. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6518. } while (0)
  6519. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6520. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6521. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6522. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6523. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6524. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6525. do { \
  6526. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6527. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6528. } while (0)
  6529. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6530. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6531. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6532. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6533. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6534. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6535. do { \
  6536. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6537. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6538. } while (0)
  6539. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6540. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6541. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6542. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6543. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6544. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6545. do { \
  6546. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6547. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6548. } while (0)
  6549. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6550. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6551. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6552. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6553. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6554. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6555. do { \
  6556. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6557. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6558. } while (0)
  6559. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6560. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6561. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6562. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6563. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6564. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6565. do { \
  6566. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6567. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6568. } while (0)
  6569. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6570. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6571. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6572. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6573. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6574. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6575. do { \
  6576. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6577. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6578. } while (0)
  6579. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6580. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6581. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6582. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6583. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6584. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6585. do { \
  6586. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6587. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6588. } while (0)
  6589. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6590. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6591. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6592. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6593. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6594. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6595. do { \
  6596. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6597. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6598. } while (0)
  6599. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6600. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6601. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6602. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6603. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6604. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6605. do { \
  6606. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6607. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6608. } while (0)
  6609. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6610. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6611. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6612. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6613. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6614. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6615. do { \
  6616. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6617. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6618. } while (0)
  6619. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6620. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6621. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6622. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6623. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6624. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6625. do { \
  6626. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6627. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6628. } while (0)
  6629. /*
  6630. * pkt_type_enable_flags
  6631. */
  6632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6638. /*
  6639. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6640. */
  6641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6642. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6643. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6644. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6645. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6646. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6647. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6648. do { \
  6649. HTT_CHECK_SET_VAL(httsym, value); \
  6650. (word) |= (value) << httsym##_S; \
  6651. } while (0)
  6652. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6653. (((word) & httsym##_M) >> httsym##_S)
  6654. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6655. * type -> MGMT, CTRL, DATA*/
  6656. #define htt_tx_ring_pkt_type_set( \
  6657. word, mode, type, val) \
  6658. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6659. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6660. #define htt_tx_ring_pkt_type_get( \
  6661. word, mode, type) \
  6662. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6663. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6664. /* Definition to filter in TLVs */
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6729. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6730. do { \
  6731. HTT_CHECK_SET_VAL(httsym, enable); \
  6732. (word) |= (enable) << httsym##_S; \
  6733. } while (0)
  6734. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6735. (((word) & httsym##_M) >> httsym##_S)
  6736. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6737. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6738. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6739. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6740. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6741. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6806. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6807. do { \
  6808. HTT_CHECK_SET_VAL(httsym, enable); \
  6809. (word) |= (enable) << httsym##_S; \
  6810. } while (0)
  6811. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6812. (((word) & httsym##_M) >> httsym##_S)
  6813. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6814. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6815. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6816. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6817. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6818. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6883. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6884. do { \
  6885. HTT_CHECK_SET_VAL(httsym, enable); \
  6886. (word) |= (enable) << httsym##_S; \
  6887. } while (0)
  6888. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6889. (((word) & httsym##_M) >> httsym##_S)
  6890. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6891. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6892. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6893. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6894. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6895. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6940. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6941. do { \
  6942. HTT_CHECK_SET_VAL(httsym, enable); \
  6943. (word) |= (enable) << httsym##_S; \
  6944. } while (0)
  6945. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6946. (((word) & httsym##_M) >> httsym##_S)
  6947. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6948. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6949. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6950. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6951. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6952. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6953. /**
  6954. * @brief host --> target Receive Flow Steering configuration message definition
  6955. *
  6956. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6957. *
  6958. * host --> target Receive Flow Steering configuration message definition.
  6959. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6960. * The reason for this is we want RFS to be configured and ready before MAC
  6961. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6962. *
  6963. * |31 24|23 16|15 9|8|7 0|
  6964. * |----------------+----------------+----------------+----------------|
  6965. * | reserved |E| msg type |
  6966. * |-------------------------------------------------------------------|
  6967. * Where E = RFS enable flag
  6968. *
  6969. * The RFS_CONFIG message consists of a single 4-byte word.
  6970. *
  6971. * Header fields:
  6972. * - MSG_TYPE
  6973. * Bits 7:0
  6974. * Purpose: identifies this as a RFS config msg
  6975. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6976. * - RFS_CONFIG
  6977. * Bit 8
  6978. * Purpose: Tells target whether to enable (1) or disable (0)
  6979. * flow steering feature when sending rx indication messages to host
  6980. */
  6981. #define HTT_H2T_RFS_CONFIG_M 0x100
  6982. #define HTT_H2T_RFS_CONFIG_S 8
  6983. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6984. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6985. HTT_H2T_RFS_CONFIG_S)
  6986. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6987. do { \
  6988. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6989. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6990. } while (0)
  6991. #define HTT_RFS_CFG_REQ_BYTES 4
  6992. /**
  6993. * @brief host -> target FW extended statistics request
  6994. *
  6995. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6996. *
  6997. * @details
  6998. * The following field definitions describe the format of the HTT host
  6999. * to target FW extended stats retrieve message.
  7000. * The message specifies the type of stats the host wants to retrieve.
  7001. *
  7002. * |31 24|23 16|15 8|7 0|
  7003. * |-----------------------------------------------------------|
  7004. * | reserved | stats type | pdev_mask | msg type |
  7005. * |-----------------------------------------------------------|
  7006. * | config param [0] |
  7007. * |-----------------------------------------------------------|
  7008. * | config param [1] |
  7009. * |-----------------------------------------------------------|
  7010. * | config param [2] |
  7011. * |-----------------------------------------------------------|
  7012. * | config param [3] |
  7013. * |-----------------------------------------------------------|
  7014. * | reserved |
  7015. * |-----------------------------------------------------------|
  7016. * | cookie LSBs |
  7017. * |-----------------------------------------------------------|
  7018. * | cookie MSBs |
  7019. * |-----------------------------------------------------------|
  7020. * Header fields:
  7021. * - MSG_TYPE
  7022. * Bits 7:0
  7023. * Purpose: identifies this is a extended stats upload request message
  7024. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7025. * - PDEV_MASK
  7026. * Bits 8:15
  7027. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7028. * Value: This is a overloaded field, refer to usage and interpretation of
  7029. * PDEV in interface document.
  7030. * Bit 8 : Reserved for SOC stats
  7031. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7032. * Indicates MACID_MASK in DBS
  7033. * - STATS_TYPE
  7034. * Bits 23:16
  7035. * Purpose: identifies which FW statistics to upload
  7036. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7037. * - Reserved
  7038. * Bits 31:24
  7039. * - CONFIG_PARAM [0]
  7040. * Bits 31:0
  7041. * Purpose: give an opaque configuration value to the specified stats type
  7042. * Value: stats-type specific configuration value
  7043. * Refer to htt_stats.h for interpretation for each stats sub_type
  7044. * - CONFIG_PARAM [1]
  7045. * Bits 31:0
  7046. * Purpose: give an opaque configuration value to the specified stats type
  7047. * Value: stats-type specific configuration value
  7048. * Refer to htt_stats.h for interpretation for each stats sub_type
  7049. * - CONFIG_PARAM [2]
  7050. * Bits 31:0
  7051. * Purpose: give an opaque configuration value to the specified stats type
  7052. * Value: stats-type specific configuration value
  7053. * Refer to htt_stats.h for interpretation for each stats sub_type
  7054. * - CONFIG_PARAM [3]
  7055. * Bits 31:0
  7056. * Purpose: give an opaque configuration value to the specified stats type
  7057. * Value: stats-type specific configuration value
  7058. * Refer to htt_stats.h for interpretation for each stats sub_type
  7059. * - Reserved [31:0] for future use.
  7060. * - COOKIE_LSBS
  7061. * Bits 31:0
  7062. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7063. * message with its preceding host->target stats request message.
  7064. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7065. * - COOKIE_MSBS
  7066. * Bits 31:0
  7067. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7068. * message with its preceding host->target stats request message.
  7069. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7070. */
  7071. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7072. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7073. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7074. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7075. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7076. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7077. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7078. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7079. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7080. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7081. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7082. do { \
  7083. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7084. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7085. } while (0)
  7086. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7087. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7088. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7089. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7090. do { \
  7091. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7092. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7093. } while (0)
  7094. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7095. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7096. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7097. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7098. do { \
  7099. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7100. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7101. } while (0)
  7102. /**
  7103. * @brief host -> target FW streaming statistics request
  7104. *
  7105. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7106. *
  7107. * @details
  7108. * The following field definitions describe the format of the HTT host
  7109. * to target message that requests the target to start or stop producing
  7110. * ongoing stats of the specified type.
  7111. *
  7112. * |31|30 |23 16|15 8|7 0|
  7113. * |-----------------------------------------------------------|
  7114. * |EN| reserved | stats type | reserved | msg type |
  7115. * |-----------------------------------------------------------|
  7116. * | config param [0] |
  7117. * |-----------------------------------------------------------|
  7118. * | config param [1] |
  7119. * |-----------------------------------------------------------|
  7120. * | config param [2] |
  7121. * |-----------------------------------------------------------|
  7122. * | config param [3] |
  7123. * |-----------------------------------------------------------|
  7124. * Where:
  7125. * - EN is an enable/disable flag
  7126. * Header fields:
  7127. * - MSG_TYPE
  7128. * Bits 7:0
  7129. * Purpose: identifies this is a streaming stats upload request message
  7130. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7131. * - STATS_TYPE
  7132. * Bits 23:16
  7133. * Purpose: identifies which FW statistics to upload
  7134. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7135. * Only the htt_dbg_ext_stats_type values identified as streaming
  7136. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7137. * - ENABLE
  7138. * Bit 31
  7139. * Purpose: enable/disable the target's ongoing stats of the specified type
  7140. * Value:
  7141. * 0 - disable ongoing production of the specified stats type
  7142. * 1 - enable ongoing production of the specified stats type
  7143. * - CONFIG_PARAM [0]
  7144. * Bits 31:0
  7145. * Purpose: give an opaque configuration value to the specified stats type
  7146. * Value: stats-type specific configuration value
  7147. * Refer to htt_stats.h for interpretation for each stats sub_type
  7148. * - CONFIG_PARAM [1]
  7149. * Bits 31:0
  7150. * Purpose: give an opaque configuration value to the specified stats type
  7151. * Value: stats-type specific configuration value
  7152. * Refer to htt_stats.h for interpretation for each stats sub_type
  7153. * - CONFIG_PARAM [2]
  7154. * Bits 31:0
  7155. * Purpose: give an opaque configuration value to the specified stats type
  7156. * Value: stats-type specific configuration value
  7157. * Refer to htt_stats.h for interpretation for each stats sub_type
  7158. * - CONFIG_PARAM [3]
  7159. * Bits 31:0
  7160. * Purpose: give an opaque configuration value to the specified stats type
  7161. * Value: stats-type specific configuration value
  7162. * Refer to htt_stats.h for interpretation for each stats sub_type
  7163. */
  7164. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7165. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7166. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7167. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7168. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7169. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7170. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7171. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7172. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7173. do { \
  7174. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7175. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7176. } while (0)
  7177. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7178. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7179. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7180. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7181. do { \
  7182. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7183. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7184. } while (0)
  7185. /**
  7186. * @brief host -> target FW PPDU_STATS request message
  7187. *
  7188. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7189. *
  7190. * @details
  7191. * The following field definitions describe the format of the HTT host
  7192. * to target FW for PPDU_STATS_CFG msg.
  7193. * The message allows the host to configure the PPDU_STATS_IND messages
  7194. * produced by the target.
  7195. *
  7196. * |31 24|23 16|15 8|7 0|
  7197. * |-----------------------------------------------------------|
  7198. * | REQ bit mask | pdev_mask | msg type |
  7199. * |-----------------------------------------------------------|
  7200. * Header fields:
  7201. * - MSG_TYPE
  7202. * Bits 7:0
  7203. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7204. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7205. * - PDEV_MASK
  7206. * Bits 8:15
  7207. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7208. * Value: This is a overloaded field, refer to usage and interpretation of
  7209. * PDEV in interface document.
  7210. * Bit 8 : Reserved for SOC stats
  7211. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7212. * Indicates MACID_MASK in DBS
  7213. * - REQ_TLV_BIT_MASK
  7214. * Bits 16:31
  7215. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7216. * needs to be included in the target's PPDU_STATS_IND messages.
  7217. * Value: refer htt_ppdu_stats_tlv_tag_t
  7218. *
  7219. */
  7220. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7221. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7222. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7223. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7224. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7225. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7226. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7227. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7228. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7229. do { \
  7230. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7231. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7232. } while (0)
  7233. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7234. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7235. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7236. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7237. do { \
  7238. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7239. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7240. } while (0)
  7241. /**
  7242. * @brief Host-->target HTT RX FSE setup message
  7243. *
  7244. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7245. *
  7246. * @details
  7247. * Through this message, the host will provide details of the flow tables
  7248. * in host DDR along with hash keys.
  7249. * This message can be sent per SOC or per PDEV, which is differentiated
  7250. * by pdev id values.
  7251. * The host will allocate flow search table and sends table size,
  7252. * physical DMA address of flow table, and hash keys to firmware to
  7253. * program into the RXOLE FSE HW block.
  7254. *
  7255. * The following field definitions describe the format of the RX FSE setup
  7256. * message sent from the host to target
  7257. *
  7258. * Header fields:
  7259. * dword0 - b'7:0 - msg_type: This will be set to
  7260. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7261. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7262. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7263. * pdev's LMAC ring.
  7264. * b'31:16 - reserved : Reserved for future use
  7265. * dword1 - b'19:0 - number of records: This field indicates the number of
  7266. * entries in the flow table. For example: 8k number of
  7267. * records is equivalent to
  7268. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7269. * b'27:20 - max search: This field specifies the skid length to FSE
  7270. * parser HW module whenever match is not found at the
  7271. * exact index pointed by hash.
  7272. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7273. * Refer htt_ip_da_sa_prefix below for more details.
  7274. * b'31:30 - reserved: Reserved for future use
  7275. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7276. * table allocated by host in DDR
  7277. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7278. * table allocated by host in DDR
  7279. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7280. * entry hashing
  7281. *
  7282. *
  7283. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7284. * |---------------------------------------------------------------|
  7285. * | reserved | pdev_id | MSG_TYPE |
  7286. * |---------------------------------------------------------------|
  7287. * |resvd|IPDSA| max_search | Number of records |
  7288. * |---------------------------------------------------------------|
  7289. * | base address lo |
  7290. * |---------------------------------------------------------------|
  7291. * | base address high |
  7292. * |---------------------------------------------------------------|
  7293. * | toeplitz key 31_0 |
  7294. * |---------------------------------------------------------------|
  7295. * | toeplitz key 63_32 |
  7296. * |---------------------------------------------------------------|
  7297. * | toeplitz key 95_64 |
  7298. * |---------------------------------------------------------------|
  7299. * | toeplitz key 127_96 |
  7300. * |---------------------------------------------------------------|
  7301. * | toeplitz key 159_128 |
  7302. * |---------------------------------------------------------------|
  7303. * | toeplitz key 191_160 |
  7304. * |---------------------------------------------------------------|
  7305. * | toeplitz key 223_192 |
  7306. * |---------------------------------------------------------------|
  7307. * | toeplitz key 255_224 |
  7308. * |---------------------------------------------------------------|
  7309. * | toeplitz key 287_256 |
  7310. * |---------------------------------------------------------------|
  7311. * | reserved | toeplitz key 314_288(26:0 bits) |
  7312. * |---------------------------------------------------------------|
  7313. * where:
  7314. * IPDSA = ip_da_sa
  7315. */
  7316. /**
  7317. * @brief: htt_ip_da_sa_prefix
  7318. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7319. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7320. * documentation per RFC3849
  7321. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7322. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7323. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7324. */
  7325. enum htt_ip_da_sa_prefix {
  7326. HTT_RX_IPV6_20010db8,
  7327. HTT_RX_IPV4_MAPPED_IPV6,
  7328. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7329. HTT_RX_IPV6_64FF9B,
  7330. };
  7331. /**
  7332. * @brief Host-->target HTT RX FISA configure and enable
  7333. *
  7334. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7335. *
  7336. * @details
  7337. * The host will send this command down to configure and enable the FISA
  7338. * operational params.
  7339. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7340. * register.
  7341. * Should configure both the MACs.
  7342. *
  7343. * dword0 - b'7:0 - msg_type:
  7344. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7345. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7346. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7347. * pdev's LMAC ring.
  7348. * b'31:16 - reserved : Reserved for future use
  7349. *
  7350. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7351. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7352. * packets. 1 flow search will be skipped
  7353. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7354. * tcp,udp packets
  7355. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7356. * calculation
  7357. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7358. * calculation
  7359. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7360. * calculation
  7361. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7362. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7363. * length
  7364. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7365. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7366. * length
  7367. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7368. * num jump
  7369. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7370. * num jump
  7371. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7372. * data type switch has happend for MPDU Sequence num jump
  7373. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7374. * for MPDU Sequence num jump
  7375. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7376. * for decrypt errors
  7377. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7378. * while aggregating a msdu
  7379. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7380. * The aggregation is done until (number of MSDUs aggregated
  7381. * < LIMIT + 1)
  7382. * b'31:18 - Reserved
  7383. *
  7384. * fisa_control_value - 32bit value FW can write to register
  7385. *
  7386. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7387. * Threshold value for FISA timeout (units are microseconds).
  7388. * When the global timestamp exceeds this threshold, FISA
  7389. * aggregation will be restarted.
  7390. * A value of 0 means timeout is disabled.
  7391. * Compare the threshold register with timestamp field in
  7392. * flow entry to generate timeout for the flow.
  7393. *
  7394. * |31 18 |17 16|15 8|7 0|
  7395. * |-------------------------------------------------------------|
  7396. * | reserved | pdev_mask | msg type |
  7397. * |-------------------------------------------------------------|
  7398. * | reserved | FISA_CTRL |
  7399. * |-------------------------------------------------------------|
  7400. * | FISA_TIMEOUT_THRESH |
  7401. * |-------------------------------------------------------------|
  7402. */
  7403. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7404. A_UINT32 msg_type:8,
  7405. pdev_id:8,
  7406. reserved0:16;
  7407. /**
  7408. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7409. * [17:0]
  7410. */
  7411. union {
  7412. /*
  7413. * fisa_control_bits structure is deprecated.
  7414. * Please use fisa_control_bits_v2 going forward.
  7415. */
  7416. struct {
  7417. A_UINT32 fisa_enable: 1,
  7418. ipsec_skip_search: 1,
  7419. nontcp_skip_search: 1,
  7420. add_ipv4_fixed_hdr_len: 1,
  7421. add_ipv6_fixed_hdr_len: 1,
  7422. add_tcp_fixed_hdr_len: 1,
  7423. add_udp_hdr_len: 1,
  7424. chksum_cum_ip_len_en: 1,
  7425. disable_tid_check: 1,
  7426. disable_ta_check: 1,
  7427. disable_qos_check: 1,
  7428. disable_raw_check: 1,
  7429. disable_decrypt_err_check: 1,
  7430. disable_msdu_drop_check: 1,
  7431. fisa_aggr_limit: 4,
  7432. reserved: 14;
  7433. } fisa_control_bits;
  7434. struct {
  7435. A_UINT32 fisa_enable: 1,
  7436. fisa_aggr_limit: 4,
  7437. reserved: 27;
  7438. } fisa_control_bits_v2;
  7439. A_UINT32 fisa_control_value;
  7440. } u_fisa_control;
  7441. /**
  7442. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7443. * timeout threshold for aggregation. Unit in usec.
  7444. * [31:0]
  7445. */
  7446. A_UINT32 fisa_timeout_threshold;
  7447. } POSTPACK;
  7448. /* DWord 0: pdev-ID */
  7449. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7450. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7451. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7452. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7453. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7454. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7455. do { \
  7456. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7457. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7458. } while (0)
  7459. /* Dword 1: fisa_control_value fisa config */
  7460. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7461. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7462. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7463. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7464. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7465. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7466. do { \
  7467. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7468. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7469. } while (0)
  7470. /* Dword 1: fisa_control_value ipsec_skip_search */
  7471. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7472. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7473. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7474. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7475. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7476. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7477. do { \
  7478. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7479. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7480. } while (0)
  7481. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7482. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7483. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7484. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7485. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7486. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7487. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7488. do { \
  7489. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7490. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7491. } while (0)
  7492. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7493. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7494. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7495. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7496. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7497. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7498. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7499. do { \
  7500. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7501. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7502. } while (0)
  7503. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7504. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7505. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7506. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7507. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7508. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7509. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7510. do { \
  7511. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7512. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7513. } while (0)
  7514. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7515. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7516. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7517. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7518. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7519. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7520. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7521. do { \
  7522. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7523. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7524. } while (0)
  7525. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7526. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7527. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7528. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7529. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7530. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7531. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7532. do { \
  7533. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7534. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7535. } while (0)
  7536. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7537. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7538. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7539. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7540. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7541. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7542. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7543. do { \
  7544. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7545. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7546. } while (0)
  7547. /* Dword 1: fisa_control_value disable_tid_check */
  7548. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7549. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7550. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7551. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7552. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7553. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7554. do { \
  7555. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7556. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7557. } while (0)
  7558. /* Dword 1: fisa_control_value disable_ta_check */
  7559. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7560. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7561. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7562. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7563. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7564. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7565. do { \
  7566. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7567. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7568. } while (0)
  7569. /* Dword 1: fisa_control_value disable_qos_check */
  7570. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7571. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7572. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7573. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7574. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7575. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7576. do { \
  7577. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7578. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7579. } while (0)
  7580. /* Dword 1: fisa_control_value disable_raw_check */
  7581. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7582. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7583. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7584. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7585. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7586. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7587. do { \
  7588. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7589. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7590. } while (0)
  7591. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7592. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7593. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7594. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7595. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7596. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7597. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7598. do { \
  7599. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7600. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7601. } while (0)
  7602. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7603. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7604. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7605. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7606. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7607. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7608. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7609. do { \
  7610. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7611. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7612. } while (0)
  7613. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7614. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7615. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7616. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7617. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7618. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7619. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7620. do { \
  7621. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7622. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7623. } while (0)
  7624. /* Dword 1: fisa_control_value fisa config */
  7625. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7626. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7627. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7628. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7629. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7630. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7631. do { \
  7632. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7633. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7634. } while (0)
  7635. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7636. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7637. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7638. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7639. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7640. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7641. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7642. do { \
  7643. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7644. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7645. } while (0)
  7646. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7647. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7648. pdev_id:8,
  7649. reserved0:16;
  7650. A_UINT32 num_records:20,
  7651. max_search:8,
  7652. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7653. reserved1:2;
  7654. A_UINT32 base_addr_lo;
  7655. A_UINT32 base_addr_hi;
  7656. A_UINT32 toeplitz31_0;
  7657. A_UINT32 toeplitz63_32;
  7658. A_UINT32 toeplitz95_64;
  7659. A_UINT32 toeplitz127_96;
  7660. A_UINT32 toeplitz159_128;
  7661. A_UINT32 toeplitz191_160;
  7662. A_UINT32 toeplitz223_192;
  7663. A_UINT32 toeplitz255_224;
  7664. A_UINT32 toeplitz287_256;
  7665. A_UINT32 toeplitz314_288:27,
  7666. reserved2:5;
  7667. } POSTPACK;
  7668. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7669. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7670. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7671. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7672. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7673. /* DWORD 0: Pdev ID */
  7674. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7675. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7676. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7677. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7678. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7679. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7680. do { \
  7681. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7682. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7683. } while (0)
  7684. /* DWORD 1:num of records */
  7685. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7686. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7687. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7688. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7689. HTT_RX_FSE_SETUP_NUM_REC_S)
  7690. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7691. do { \
  7692. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7693. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7694. } while (0)
  7695. /* DWORD 1:max_search */
  7696. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7697. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7698. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7699. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7700. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7701. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7702. do { \
  7703. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7704. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7705. } while (0)
  7706. /* DWORD 1:ip_da_sa prefix */
  7707. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7708. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7709. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7710. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7711. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7712. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7713. do { \
  7714. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7715. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7716. } while (0)
  7717. /* DWORD 2: Base Address LO */
  7718. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7719. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7720. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7721. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7722. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7723. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7724. do { \
  7725. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7726. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7727. } while (0)
  7728. /* DWORD 3: Base Address High */
  7729. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7730. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7731. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7732. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7733. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7734. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7735. do { \
  7736. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7737. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7738. } while (0)
  7739. /* DWORD 4-12: Hash Value */
  7740. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7741. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7742. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7743. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7744. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7745. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7746. do { \
  7747. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7748. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7749. } while (0)
  7750. /* DWORD 13: Hash Value 314:288 bits */
  7751. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7752. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7753. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7754. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7755. do { \
  7756. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7757. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7758. } while (0)
  7759. /**
  7760. * @brief Host-->target HTT RX FSE operation message
  7761. *
  7762. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7763. *
  7764. * @details
  7765. * The host will send this Flow Search Engine (FSE) operation message for
  7766. * every flow add/delete operation.
  7767. * The FSE operation includes FSE full cache invalidation or individual entry
  7768. * invalidation.
  7769. * This message can be sent per SOC or per PDEV which is differentiated
  7770. * by pdev id values.
  7771. *
  7772. * |31 16|15 8|7 1|0|
  7773. * |-------------------------------------------------------------|
  7774. * | reserved | pdev_id | MSG_TYPE |
  7775. * |-------------------------------------------------------------|
  7776. * | reserved | operation |I|
  7777. * |-------------------------------------------------------------|
  7778. * | ip_src_addr_31_0 |
  7779. * |-------------------------------------------------------------|
  7780. * | ip_src_addr_63_32 |
  7781. * |-------------------------------------------------------------|
  7782. * | ip_src_addr_95_64 |
  7783. * |-------------------------------------------------------------|
  7784. * | ip_src_addr_127_96 |
  7785. * |-------------------------------------------------------------|
  7786. * | ip_dst_addr_31_0 |
  7787. * |-------------------------------------------------------------|
  7788. * | ip_dst_addr_63_32 |
  7789. * |-------------------------------------------------------------|
  7790. * | ip_dst_addr_95_64 |
  7791. * |-------------------------------------------------------------|
  7792. * | ip_dst_addr_127_96 |
  7793. * |-------------------------------------------------------------|
  7794. * | l4_dst_port | l4_src_port |
  7795. * | (32-bit SPI incase of IPsec) |
  7796. * |-------------------------------------------------------------|
  7797. * | reserved | l4_proto |
  7798. * |-------------------------------------------------------------|
  7799. *
  7800. * where I is 1-bit ipsec_valid.
  7801. *
  7802. * The following field definitions describe the format of the RX FSE operation
  7803. * message sent from the host to target for every add/delete flow entry to flow
  7804. * table.
  7805. *
  7806. * Header fields:
  7807. * dword0 - b'7:0 - msg_type: This will be set to
  7808. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7809. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7810. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7811. * specified pdev's LMAC ring.
  7812. * b'31:16 - reserved : Reserved for future use
  7813. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7814. * (Internet Protocol Security).
  7815. * IPsec describes the framework for providing security at
  7816. * IP layer. IPsec is defined for both versions of IP:
  7817. * IPV4 and IPV6.
  7818. * Please refer to htt_rx_flow_proto enumeration below for
  7819. * more info.
  7820. * ipsec_valid = 1 for IPSEC packets
  7821. * ipsec_valid = 0 for IP Packets
  7822. * b'7:1 - operation: This indicates types of FSE operation.
  7823. * Refer to htt_rx_fse_operation enumeration:
  7824. * 0 - No Cache Invalidation required
  7825. * 1 - Cache invalidate only one entry given by IP
  7826. * src/dest address at DWORD[2:9]
  7827. * 2 - Complete FSE Cache Invalidation
  7828. * 3 - FSE Disable
  7829. * 4 - FSE Enable
  7830. * b'31:8 - reserved: Reserved for future use
  7831. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7832. * for per flow addition/deletion
  7833. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7834. * and the subsequent 3 A_UINT32 will be padding bytes.
  7835. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7836. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7837. * from 0 to 65535 but only 0 to 1023 are designated as
  7838. * well-known ports. Refer to [RFC1700] for more details.
  7839. * This field is valid only if
  7840. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7841. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7842. * range from 0 to 65535 but only 0 to 1023 are designated
  7843. * as well-known ports. Refer to [RFC1700] for more details.
  7844. * This field is valid only if
  7845. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7846. * - SPI (31:0): Security Parameters Index is an
  7847. * identification tag added to the header while using IPsec
  7848. * for tunneling the IP traffici.
  7849. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7850. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7851. * Assigned Internet Protocol Numbers.
  7852. * l4_proto numbers for standard protocol like UDP/TCP
  7853. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7854. * l4_proto = 17 for UDP etc.
  7855. * b'31:8 - reserved: Reserved for future use.
  7856. *
  7857. */
  7858. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7859. A_UINT32 msg_type:8,
  7860. pdev_id:8,
  7861. reserved0:16;
  7862. A_UINT32 ipsec_valid:1,
  7863. operation:7,
  7864. reserved1:24;
  7865. A_UINT32 ip_src_addr_31_0;
  7866. A_UINT32 ip_src_addr_63_32;
  7867. A_UINT32 ip_src_addr_95_64;
  7868. A_UINT32 ip_src_addr_127_96;
  7869. A_UINT32 ip_dest_addr_31_0;
  7870. A_UINT32 ip_dest_addr_63_32;
  7871. A_UINT32 ip_dest_addr_95_64;
  7872. A_UINT32 ip_dest_addr_127_96;
  7873. union {
  7874. A_UINT32 spi;
  7875. struct {
  7876. A_UINT32 l4_src_port:16,
  7877. l4_dest_port:16;
  7878. } ip;
  7879. } u;
  7880. A_UINT32 l4_proto:8,
  7881. reserved:24;
  7882. } POSTPACK;
  7883. /**
  7884. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7885. *
  7886. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7887. *
  7888. * @details
  7889. * The host will send this Full monitor mode register configuration message.
  7890. * This message can be sent per SOC or per PDEV which is differentiated
  7891. * by pdev id values.
  7892. *
  7893. * |31 16|15 11|10 8|7 3|2|1|0|
  7894. * |-------------------------------------------------------------|
  7895. * | reserved | pdev_id | MSG_TYPE |
  7896. * |-------------------------------------------------------------|
  7897. * | reserved |Release Ring |N|Z|E|
  7898. * |-------------------------------------------------------------|
  7899. *
  7900. * where E is 1-bit full monitor mode enable/disable.
  7901. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7902. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7903. *
  7904. * The following field definitions describe the format of the full monitor
  7905. * mode configuration message sent from the host to target for each pdev.
  7906. *
  7907. * Header fields:
  7908. * dword0 - b'7:0 - msg_type: This will be set to
  7909. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7910. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7911. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7912. * specified pdev's LMAC ring.
  7913. * b'31:16 - reserved : Reserved for future use.
  7914. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7915. * monitor mode rxdma register is to be enabled or disabled.
  7916. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7917. * additional descriptors at ppdu end for zero mpdus
  7918. * enabled or disabled.
  7919. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7920. * additional descriptors at ppdu end for non zero mpdus
  7921. * enabled or disabled.
  7922. * b'10:3 - release_ring: This indicates the destination ring
  7923. * selection for the descriptor at the end of PPDU
  7924. * 0 - REO ring select
  7925. * 1 - FW ring select
  7926. * 2 - SW ring select
  7927. * 3 - Release ring select
  7928. * Refer to htt_rx_full_mon_release_ring.
  7929. * b'31:11 - reserved for future use
  7930. */
  7931. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7932. A_UINT32 msg_type:8,
  7933. pdev_id:8,
  7934. reserved0:16;
  7935. A_UINT32 full_monitor_mode_enable:1,
  7936. addnl_descs_zero_mpdus_end:1,
  7937. addnl_descs_non_zero_mpdus_end:1,
  7938. release_ring:8,
  7939. reserved1:21;
  7940. } POSTPACK;
  7941. /**
  7942. * Enumeration for full monitor mode destination ring select
  7943. * 0 - REO destination ring select
  7944. * 1 - FW destination ring select
  7945. * 2 - SW destination ring select
  7946. * 3 - Release destination ring select
  7947. */
  7948. enum htt_rx_full_mon_release_ring {
  7949. HTT_RX_MON_RING_REO,
  7950. HTT_RX_MON_RING_FW,
  7951. HTT_RX_MON_RING_SW,
  7952. HTT_RX_MON_RING_RELEASE,
  7953. };
  7954. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7955. /* DWORD 0: Pdev ID */
  7956. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7957. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7958. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7959. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7960. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7961. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7962. do { \
  7963. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7964. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7965. } while (0)
  7966. /* DWORD 1:ENABLE */
  7967. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7968. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7969. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7970. do { \
  7971. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7972. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7973. } while (0)
  7974. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7975. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7976. /* DWORD 1:ZERO_MPDU */
  7977. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7978. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7979. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7980. do { \
  7981. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7982. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7983. } while (0)
  7984. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7985. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7986. /* DWORD 1:NON_ZERO_MPDU */
  7987. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7988. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7989. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7990. do { \
  7991. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7992. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7993. } while (0)
  7994. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7995. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7996. /* DWORD 1:RELEASE_RINGS */
  7997. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7998. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7999. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8000. do { \
  8001. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8002. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8003. } while (0)
  8004. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8005. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8006. /**
  8007. * Enumeration for IP Protocol or IPSEC Protocol
  8008. * IPsec describes the framework for providing security at IP layer.
  8009. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8010. */
  8011. enum htt_rx_flow_proto {
  8012. HTT_RX_FLOW_IP_PROTO,
  8013. HTT_RX_FLOW_IPSEC_PROTO,
  8014. };
  8015. /**
  8016. * Enumeration for FSE Cache Invalidation
  8017. * 0 - No Cache Invalidation required
  8018. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8019. * 2 - Complete FSE Cache Invalidation
  8020. * 3 - FSE Disable
  8021. * 4 - FSE Enable
  8022. */
  8023. enum htt_rx_fse_operation {
  8024. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8025. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8026. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8027. HTT_RX_FSE_DISABLE,
  8028. HTT_RX_FSE_ENABLE,
  8029. };
  8030. /* DWORD 0: Pdev ID */
  8031. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8032. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8033. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8034. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8035. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8036. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8037. do { \
  8038. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8039. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8040. } while (0)
  8041. /* DWORD 1:IP PROTO or IPSEC */
  8042. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8043. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8044. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8045. do { \
  8046. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8047. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8048. } while (0)
  8049. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8050. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8051. /* DWORD 1:FSE Operation */
  8052. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8053. #define HTT_RX_FSE_OPERATION_S 1
  8054. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8055. do { \
  8056. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8057. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8058. } while (0)
  8059. #define HTT_RX_FSE_OPERATION_GET(word) \
  8060. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8061. /* DWORD 2-9:IP Address */
  8062. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8063. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8064. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8065. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8066. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8067. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8068. do { \
  8069. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8070. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8071. } while (0)
  8072. /* DWORD 10:Source Port Number */
  8073. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8074. #define HTT_RX_FSE_SOURCEPORT_S 0
  8075. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8076. do { \
  8077. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8078. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8079. } while (0)
  8080. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8081. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8082. /* DWORD 11:Destination Port Number */
  8083. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8084. #define HTT_RX_FSE_DESTPORT_S 16
  8085. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8086. do { \
  8087. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8088. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8089. } while (0)
  8090. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8091. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8092. /* DWORD 10-11:SPI (In case of IPSEC) */
  8093. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8094. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8095. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8096. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8097. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8098. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8099. do { \
  8100. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8101. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8102. } while (0)
  8103. /* DWORD 12:L4 PROTO */
  8104. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8105. #define HTT_RX_FSE_L4_PROTO_S 0
  8106. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8107. do { \
  8108. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8109. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8110. } while (0)
  8111. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8112. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8113. /**
  8114. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8115. *
  8116. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8117. *
  8118. * |31 24|23 |15 8|7 2|1|0|
  8119. * |----------------+----------------+----------------+----------------|
  8120. * | reserved | pdev_id | msg_type |
  8121. * |---------------------------------+----------------+----------------|
  8122. * | reserved |E|F|
  8123. * |---------------------------------+----------------+----------------|
  8124. * Where E = Configure the target to provide the 3-tuple hash value in
  8125. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8126. * F = Configure the target to provide the 3-tuple hash value in
  8127. * flow_id_toeplitz field of rx_msdu_start tlv
  8128. *
  8129. * The following field definitions describe the format of the 3 tuple hash value
  8130. * message sent from the host to target as part of initialization sequence.
  8131. *
  8132. * Header fields:
  8133. * dword0 - b'7:0 - msg_type: This will be set to
  8134. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8135. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8136. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8137. * specified pdev's LMAC ring.
  8138. * b'31:16 - reserved : Reserved for future use
  8139. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8140. * b'1 - toeplitz_hash_2_or_4_field_enable
  8141. * b'31:2 - reserved : Reserved for future use
  8142. * ---------+------+----------------------------------------------------------
  8143. * bit1 | bit0 | Functionality
  8144. * ---------+------+----------------------------------------------------------
  8145. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8146. * | | in flow_id_toeplitz field
  8147. * ---------+------+----------------------------------------------------------
  8148. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8149. * | | in toeplitz_hash_2_or_4 field
  8150. * ---------+------+----------------------------------------------------------
  8151. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8152. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8153. * ---------+------+----------------------------------------------------------
  8154. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8155. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8156. * | | toeplitz_hash_2_or_4 field
  8157. *----------------------------------------------------------------------------
  8158. */
  8159. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8160. A_UINT32 msg_type :8,
  8161. pdev_id :8,
  8162. reserved0 :16;
  8163. A_UINT32 flow_id_toeplitz_field_enable :1,
  8164. toeplitz_hash_2_or_4_field_enable :1,
  8165. reserved1 :30;
  8166. } POSTPACK;
  8167. /* DWORD0 : pdev_id configuration Macros */
  8168. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8169. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8170. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8171. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8172. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8173. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8174. do { \
  8175. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8176. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8177. } while (0)
  8178. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8179. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8180. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8181. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8182. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8183. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8184. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8185. do { \
  8186. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8187. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8188. } while (0)
  8189. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8190. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8191. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8192. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8193. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8194. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8195. do { \
  8196. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8197. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8198. } while (0)
  8199. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8200. /**
  8201. * @brief host --> target Host PA Address Size
  8202. *
  8203. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8204. *
  8205. * @details
  8206. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8207. * provide the physical start address and size of each of the memory
  8208. * areas within host DDR that the target FW may need to access.
  8209. *
  8210. * For example, the host can use this message to allow the target FW
  8211. * to set up access to the host's pools of TQM link descriptors.
  8212. * The message would appear as follows:
  8213. *
  8214. * |31 24|23 16|15 8|7 0|
  8215. * |----------------+----------------+----------------+----------------|
  8216. * | reserved | num_entries | msg_type |
  8217. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8218. * | mem area 0 size |
  8219. * |----------------+----------------+----------------+----------------|
  8220. * | mem area 0 physical_address_lo |
  8221. * |----------------+----------------+----------------+----------------|
  8222. * | mem area 0 physical_address_hi |
  8223. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8224. * | mem area 1 size |
  8225. * |----------------+----------------+----------------+----------------|
  8226. * | mem area 1 physical_address_lo |
  8227. * |----------------+----------------+----------------+----------------|
  8228. * | mem area 1 physical_address_hi |
  8229. * |----------------+----------------+----------------+----------------|
  8230. * ...
  8231. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8232. * | mem area N size |
  8233. * |----------------+----------------+----------------+----------------|
  8234. * | mem area N physical_address_lo |
  8235. * |----------------+----------------+----------------+----------------|
  8236. * | mem area N physical_address_hi |
  8237. * |----------------+----------------+----------------+----------------|
  8238. *
  8239. * The message is interpreted as follows:
  8240. * dword0 - b'0:7 - msg_type: This will be set to
  8241. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8242. * b'8:15 - number_entries: Indicated the number of host memory
  8243. * areas specified within the remainder of the message
  8244. * b'16:31 - reserved.
  8245. * dword1 - b'0:31 - memory area 0 size in bytes
  8246. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8247. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8248. * and similar for memory area 1 through memory area N.
  8249. */
  8250. PREPACK struct htt_h2t_host_paddr_size {
  8251. A_UINT32 msg_type: 8,
  8252. num_entries: 8,
  8253. reserved: 16;
  8254. } POSTPACK;
  8255. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8256. A_UINT32 size;
  8257. A_UINT32 physical_address_lo;
  8258. A_UINT32 physical_address_hi;
  8259. } POSTPACK;
  8260. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8261. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8262. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8263. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8264. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8265. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8266. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8267. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8268. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8269. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8270. do { \
  8271. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8272. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8273. } while (0)
  8274. /**
  8275. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8276. *
  8277. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8278. *
  8279. * @details
  8280. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8281. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8282. *
  8283. * The message would appear as follows:
  8284. *
  8285. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8286. * |---------------------------------+---+---+----------+-+-----------|
  8287. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8288. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8289. *
  8290. *
  8291. * The message is interpreted as follows:
  8292. * dword0 - b'0:7 - msg_type: This will be set to
  8293. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8294. * b'8 - override bit to drive MSDUs to PPE ring
  8295. * b'9:13 - REO destination ring indication
  8296. * b'14 - Multi buffer msdu override enable bit
  8297. * b'15 - Intra BSS override
  8298. * b'16 - Decap raw override
  8299. * b'17 - Decap Native wifi override
  8300. * b'18 - IP frag override
  8301. * b'19:31 - reserved
  8302. */
  8303. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8304. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8305. override: 1,
  8306. reo_destination_indication: 5,
  8307. multi_buffer_msdu_override_en: 1,
  8308. intra_bss_override: 1,
  8309. decap_raw_override: 1,
  8310. decap_nwifi_override: 1,
  8311. ip_frag_override: 1,
  8312. reserved: 13;
  8313. } POSTPACK;
  8314. /* DWORD 0: Override */
  8315. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8316. #define HTT_PPE_CFG_OVERRIDE_S 8
  8317. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8318. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8319. HTT_PPE_CFG_OVERRIDE_S)
  8320. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8321. do { \
  8322. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8323. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8324. } while (0)
  8325. /* DWORD 0: REO Destination Indication*/
  8326. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8327. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8328. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8329. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8330. HTT_PPE_CFG_REO_DEST_IND_S)
  8331. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8332. do { \
  8333. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8334. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8335. } while (0)
  8336. /* DWORD 0: Multi buffer MSDU override */
  8337. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8338. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8339. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8340. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8341. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8342. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8343. do { \
  8344. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8345. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8346. } while (0)
  8347. /* DWORD 0: Intra BSS override */
  8348. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8349. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8350. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8351. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8352. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8353. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8354. do { \
  8355. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8356. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8357. } while (0)
  8358. /* DWORD 0: Decap RAW override */
  8359. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8360. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8361. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8362. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8363. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8364. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8365. do { \
  8366. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8367. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8368. } while (0)
  8369. /* DWORD 0: Decap NWIFI override */
  8370. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8371. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8372. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8373. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8374. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8375. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8376. do { \
  8377. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8378. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8379. } while (0)
  8380. /* DWORD 0: IP frag override */
  8381. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8382. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8383. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8384. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8385. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8386. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8387. do { \
  8388. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8389. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8390. } while (0)
  8391. /*
  8392. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8393. *
  8394. * @details
  8395. * The following field definitions describe the format of the HTT host
  8396. * to target FW VDEV TX RX stats retrieve message.
  8397. * The message specifies the type of stats the host wants to retrieve.
  8398. *
  8399. * |31 27|26 25|24 17|16|15 8|7 0|
  8400. * |-----------------------------------------------------------|
  8401. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8402. * |-----------------------------------------------------------|
  8403. * | vdev_id lower bitmask |
  8404. * |-----------------------------------------------------------|
  8405. * | vdev_id upper bitmask |
  8406. * |-----------------------------------------------------------|
  8407. * Header fields:
  8408. * Where:
  8409. * dword0 - b'7:0 - msg_type: This will be set to
  8410. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8411. * b'15:8 - pdev id
  8412. * b'16(E) - Enable/Disable the vdev HW stats
  8413. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8414. * b'25:26(R) - Reset stats bits
  8415. * 0: don't reset stats
  8416. * 1: reset stats once
  8417. * 2: reset stats at the start of each periodic interval
  8418. * b'27:31 - reserved for future use
  8419. * dword1 - b'0:31 - vdev_id lower bitmask
  8420. * dword2 - b'0:31 - vdev_id upper bitmask
  8421. */
  8422. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8423. A_UINT32 msg_type :8,
  8424. pdev_id :8,
  8425. enable :1,
  8426. periodic_interval :8,
  8427. reset_stats_bits :2,
  8428. reserved0 :5;
  8429. A_UINT32 vdev_id_lower_bitmask;
  8430. A_UINT32 vdev_id_upper_bitmask;
  8431. } POSTPACK;
  8432. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8433. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8434. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8435. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8436. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8437. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8438. do { \
  8439. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8440. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8441. } while (0)
  8442. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8443. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8444. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8445. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8446. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8447. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8448. do { \
  8449. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8450. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8451. } while (0)
  8452. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8453. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8454. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8455. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8456. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8457. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8458. do { \
  8459. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8460. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8461. } while (0)
  8462. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8463. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8464. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8465. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8466. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8467. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8468. do { \
  8469. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8470. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8471. } while (0)
  8472. /*
  8473. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8474. *
  8475. * @details
  8476. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8477. * the default MSDU queues for one of the TIDs within the specified peer
  8478. * to the specified service class.
  8479. * The TID is indirectly specified - each service class is associated
  8480. * with a TID. All default MSDU queues for this peer-TID will be
  8481. * linked to the service class in question.
  8482. *
  8483. * |31 16|15 8|7 0|
  8484. * |------------------------------+--------------+--------------|
  8485. * | peer ID | svc class ID | msg type |
  8486. * |------------------------------------------------------------|
  8487. * Header fields:
  8488. * dword0 - b'7:0 - msg_type: This will be set to
  8489. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8490. * b'15:8 - service class ID
  8491. * b'31:16 - peer ID
  8492. */
  8493. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8494. A_UINT32 msg_type :8,
  8495. svc_class_id :8,
  8496. peer_id :16;
  8497. } POSTPACK;
  8498. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8499. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8500. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8501. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8502. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8503. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8504. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8505. do { \
  8506. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8507. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8508. } while (0)
  8509. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8510. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8511. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8512. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8513. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8514. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8515. do { \
  8516. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8517. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8518. } while (0)
  8519. /*
  8520. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8521. *
  8522. * @details
  8523. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8524. * remove the linkage of the specified peer-TID's MSDU queues to
  8525. * service classes.
  8526. *
  8527. * |31 16|15 8|7 0|
  8528. * |------------------------------+--------------+--------------|
  8529. * | peer ID | svc class ID | msg type |
  8530. * |------------------------------------------------------------|
  8531. * Header fields:
  8532. * dword0 - b'7:0 - msg_type: This will be set to
  8533. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8534. * b'15:8 - service class ID
  8535. * b'31:16 - peer ID
  8536. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8537. * value for peer ID indicates that the target should
  8538. * apply the UNMAP_REQ to all peers.
  8539. */
  8540. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8541. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8542. A_UINT32 msg_type :8,
  8543. svc_class_id :8,
  8544. peer_id :16;
  8545. } POSTPACK;
  8546. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8547. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8548. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8549. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8550. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8551. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8552. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8553. do { \
  8554. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8555. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8556. } while (0)
  8557. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8558. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8559. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8560. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8561. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8562. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8563. do { \
  8564. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8565. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8566. } while (0)
  8567. /*
  8568. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8569. *
  8570. * @details
  8571. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8572. * request the target to report what service class the default MSDU queues
  8573. * of the specified TIDs within the peer are linked to.
  8574. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8575. * to report what service class (if any) the default MSDU queues for
  8576. * each of the specified TIDs are linked to.
  8577. *
  8578. * |31 16|15 8|7 1| 0|
  8579. * |------------------------------+--------------+--------------|
  8580. * | peer ID | TID mask | msg type |
  8581. * |------------------------------------------------------------|
  8582. * | reserved |ETO|
  8583. * |------------------------------------------------------------|
  8584. * Header fields:
  8585. * dword0 - b'7:0 - msg_type: This will be set to
  8586. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8587. * b'15:8 - TID mask
  8588. * b'31:16 - peer ID
  8589. * dword1 - b'0 - "Existing Tids Only" flag
  8590. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8591. * message generated by this REQ will only show the
  8592. * mapping for TIDs that actually exist in the target's
  8593. * peer object.
  8594. * Any TIDs that are covered by a MAP_REQ but which
  8595. * do not actually exist will be shown as being
  8596. * unmapped (i.e. svc class ID 0xff).
  8597. * If this flag is cleared, the MAP_REPORT_CONF message
  8598. * will consider not only the mapping of TIDs currently
  8599. * existing in the peer, but also the mapping that will
  8600. * be applied for any TID objects created within this
  8601. * peer in the future.
  8602. * b'31:1 - reserved for future use
  8603. */
  8604. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8605. A_UINT32 msg_type :8,
  8606. tid_mask :8,
  8607. peer_id :16;
  8608. A_UINT32 existing_tids_only:1,
  8609. reserved :31;
  8610. } POSTPACK;
  8611. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8612. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8613. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8614. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8615. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8616. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8617. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8618. do { \
  8619. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8620. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8621. } while (0)
  8622. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8623. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8624. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8625. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8626. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8627. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8628. do { \
  8629. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8630. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8631. } while (0)
  8632. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8633. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8634. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8635. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8636. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8637. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8638. do { \
  8639. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8640. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8641. } while (0)
  8642. /**
  8643. * @brief Format of shared memory between Host and Target
  8644. * for UMAC hang recovery feature messaging.
  8645. * @details
  8646. * This is shared memory between Host and Target allocated
  8647. * and used in chips where UMAC hang recovery feature is supported.
  8648. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8649. * then host interprets it as a new message from target.
  8650. * Host clears that particular read bit in t2h_msg after each read
  8651. * operation. It is vice versa for h2t_msg. At any given point
  8652. * of time there is expected to be only one bit set
  8653. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8654. *
  8655. * The message is interpreted as follows:
  8656. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8657. * added for debuggability purpose.
  8658. * dword1 - b'0 - do_pre_reset
  8659. * b'1 - do_post_reset_start
  8660. * b'2 - do_post_reset_complete
  8661. * b'3:31 - rsvd_t2h
  8662. * dword2 - b'0 - pre_reset_done
  8663. * b'1 - post_reset_start_done
  8664. * b'2 - post_reset_complete_done
  8665. * b'3:31 - rsvd_h2t
  8666. */
  8667. PREPACK typedef struct {
  8668. /** Magic number added for debuggability. */
  8669. A_UINT32 magic_num;
  8670. union {
  8671. /*
  8672. * BIT [0] :- T2H msg to do pre-reset
  8673. * BIT [1] :- T2H msg to do post-reset start
  8674. * BIT [2] :- T2H msg to do post-reset complete
  8675. * BIT [31 : 3] :- reserved
  8676. */
  8677. A_UINT32 t2h_msg;
  8678. struct {
  8679. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8680. do_post_reset_start : 1, /* BIT [1] */
  8681. do_post_reset_complete : 1, /* BIT [2] */
  8682. rsvd_t2h : 29; /* BIT [31 : 3] */
  8683. };
  8684. };
  8685. union {
  8686. /*
  8687. * BIT [0] :- H2T msg to send pre-reset done
  8688. * BIT [1] :- H2T msg to send post-reset start done
  8689. * BIT [2] :- H2T msg to send post-reset complete done
  8690. * BIT [31 : 3] :- reserved
  8691. */
  8692. A_UINT32 h2t_msg;
  8693. struct {
  8694. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8695. post_reset_start_done : 1, /* BIT [1] */
  8696. post_reset_complete_done : 1, /* BIT [2] */
  8697. rsvd_h2t : 29; /* BIT [31 : 3] */
  8698. };
  8699. };
  8700. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8701. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8702. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8703. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8704. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8705. /* dword1 - b'0 - do_pre_reset */
  8706. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8707. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8708. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8709. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8710. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8711. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8712. do { \
  8713. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8714. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8715. } while (0)
  8716. /* dword1 - b'1 - do_post_reset_start */
  8717. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8718. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8719. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8720. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8721. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8722. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8723. do { \
  8724. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8725. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8726. } while (0)
  8727. /* dword1 - b'2 - do_post_reset_complete */
  8728. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8729. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8730. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8731. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8732. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8733. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8734. do { \
  8735. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8736. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8737. } while (0)
  8738. /* dword2 - b'0 - pre_reset_done */
  8739. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8740. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8741. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8742. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8743. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8744. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8745. do { \
  8746. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8747. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8748. } while (0)
  8749. /* dword2 - b'1 - post_reset_start_done */
  8750. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8751. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8752. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8753. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8754. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8755. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8756. do { \
  8757. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8758. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8759. } while (0)
  8760. /* dword2 - b'2 - post_reset_complete_done */
  8761. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8762. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8763. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8764. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8765. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8766. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8767. do { \
  8768. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8769. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8770. } while (0)
  8771. /**
  8772. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8773. *
  8774. * @details
  8775. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8776. * by the host to provide prerequisite info to target for the UMAC hang
  8777. * recovery feature.
  8778. * The info sent in this H2T message are T2H message method, H2T message
  8779. * method, T2H MSI interrupt number and physical start address, size of
  8780. * the shared memory (refers to the shared memory dedicated for messaging
  8781. * between host and target when the DUT is in UMAC hang recovery mode).
  8782. * This H2T message is expected to be only sent if the WMI service bit
  8783. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8784. *
  8785. * |31 16|15 12|11 8|7 0|
  8786. * |-------------------------------+--------------+--------------+------------|
  8787. * | reserved |h2t msg method|t2h msg method| msg_type |
  8788. * |--------------------------------------------------------------------------|
  8789. * | t2h msi interrupt number |
  8790. * |--------------------------------------------------------------------------|
  8791. * | shared memory area size |
  8792. * |--------------------------------------------------------------------------|
  8793. * | shared memory area physical address low |
  8794. * |--------------------------------------------------------------------------|
  8795. * | shared memory area physical address high |
  8796. * |--------------------------------------------------------------------------|
  8797. *
  8798. * The message is interpreted as follows:
  8799. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8800. * b'8:11 - t2h_msg_method: indicates method to be used for
  8801. * T2H communication in UMAC hang recovery mode.
  8802. * Value zero indicates MSI interrupt (default method).
  8803. * Refer to htt_umac_hang_recovery_msg_method enum.
  8804. * b'12:15 - h2t_msg_method: indicates method to be used for
  8805. * H2T communication in UMAC hang recovery mode.
  8806. * Value zero indicates polling by target for this h2t msg
  8807. * during UMAC hang recovery mode.
  8808. * Refer to htt_umac_hang_recovery_msg_method enum.
  8809. * b'16:31 - reserved.
  8810. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8811. * T2H communication in UMAC hang recovery mode.
  8812. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8813. * only when in UMAC hang recovery mode.
  8814. * This refers to size in bytes.
  8815. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8816. * of the shared memory dedicated for messaging only when
  8817. * in UMAC hang recovery mode.
  8818. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8819. * of the shared memory dedicated for messaging only when
  8820. * in UMAC hang recovery mode.
  8821. */
  8822. /* t2h_msg_method and h2t_msg_method */
  8823. enum htt_umac_hang_recovery_msg_method {
  8824. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8825. };
  8826. PREPACK typedef struct {
  8827. A_UINT32 msg_type : 8,
  8828. t2h_msg_method : 4,
  8829. h2t_msg_method : 4,
  8830. reserved : 16;
  8831. A_UINT32 t2h_msi_data;
  8832. /* size bytes and physical address of shared memory. */
  8833. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8834. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8835. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8836. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8837. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8838. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8839. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8840. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8841. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8842. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8843. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8844. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8845. do { \
  8846. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8847. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8848. } while (0)
  8849. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8850. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8851. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8852. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8853. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8854. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8855. do { \
  8856. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8857. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8858. } while (0)
  8859. /*=== target -> host messages ===============================================*/
  8860. enum htt_t2h_msg_type {
  8861. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8862. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8863. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8864. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8865. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8866. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8867. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8868. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8869. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8870. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8871. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8872. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8873. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8874. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8875. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8876. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8877. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8878. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8879. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8880. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8881. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8882. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8883. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8884. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8885. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8886. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8887. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8888. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8889. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8890. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8891. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8892. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8893. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8894. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8895. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8896. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8897. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8898. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8899. /* TX_OFFLOAD_DELIVER_IND:
  8900. * Forward the target's locally-generated packets to the host,
  8901. * to provide to the monitor mode interface.
  8902. */
  8903. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8904. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8905. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8906. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8907. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8908. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8909. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8910. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8911. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8912. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8913. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8914. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8915. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8916. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8917. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  8918. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  8919. HTT_T2H_MSG_TYPE_TEST,
  8920. /* keep this last */
  8921. HTT_T2H_NUM_MSGS
  8922. };
  8923. /*
  8924. * HTT target to host message type -
  8925. * stored in bits 7:0 of the first word of the message
  8926. */
  8927. #define HTT_T2H_MSG_TYPE_M 0xff
  8928. #define HTT_T2H_MSG_TYPE_S 0
  8929. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8930. do { \
  8931. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8932. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8933. } while (0)
  8934. #define HTT_T2H_MSG_TYPE_GET(word) \
  8935. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8936. /**
  8937. * @brief target -> host version number confirmation message definition
  8938. *
  8939. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8940. *
  8941. * |31 24|23 16|15 8|7 0|
  8942. * |----------------+----------------+----------------+----------------|
  8943. * | reserved | major number | minor number | msg type |
  8944. * |-------------------------------------------------------------------|
  8945. * : option request TLV (optional) |
  8946. * :...................................................................:
  8947. *
  8948. * The VER_CONF message may consist of a single 4-byte word, or may be
  8949. * extended with TLVs that specify HTT options selected by the target.
  8950. * The following option TLVs may be appended to the VER_CONF message:
  8951. * - LL_BUS_ADDR_SIZE
  8952. * - HL_SUPPRESS_TX_COMPL_IND
  8953. * - MAX_TX_QUEUE_GROUPS
  8954. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8955. * may be appended to the VER_CONF message (but only one TLV of each type).
  8956. *
  8957. * Header fields:
  8958. * - MSG_TYPE
  8959. * Bits 7:0
  8960. * Purpose: identifies this as a version number confirmation message
  8961. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8962. * - VER_MINOR
  8963. * Bits 15:8
  8964. * Purpose: Specify the minor number of the HTT message library version
  8965. * in use by the target firmware.
  8966. * The minor number specifies the specific revision within a range
  8967. * of fundamentally compatible HTT message definition revisions.
  8968. * Compatible revisions involve adding new messages or perhaps
  8969. * adding new fields to existing messages, in a backwards-compatible
  8970. * manner.
  8971. * Incompatible revisions involve changing the message type values,
  8972. * or redefining existing messages.
  8973. * Value: minor number
  8974. * - VER_MAJOR
  8975. * Bits 15:8
  8976. * Purpose: Specify the major number of the HTT message library version
  8977. * in use by the target firmware.
  8978. * The major number specifies the family of minor revisions that are
  8979. * fundamentally compatible with each other, but not with prior or
  8980. * later families.
  8981. * Value: major number
  8982. */
  8983. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8984. #define HTT_VER_CONF_MINOR_S 8
  8985. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8986. #define HTT_VER_CONF_MAJOR_S 16
  8987. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8988. do { \
  8989. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8990. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8991. } while (0)
  8992. #define HTT_VER_CONF_MINOR_GET(word) \
  8993. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8994. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8995. do { \
  8996. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8997. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8998. } while (0)
  8999. #define HTT_VER_CONF_MAJOR_GET(word) \
  9000. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9001. #define HTT_VER_CONF_BYTES 4
  9002. /**
  9003. * @brief - target -> host HTT Rx In order indication message
  9004. *
  9005. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9006. *
  9007. * @details
  9008. *
  9009. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9010. * |----------------+-------------------+---------------------+---------------|
  9011. * | peer ID | P| F| O| ext TID | msg type |
  9012. * |--------------------------------------------------------------------------|
  9013. * | MSDU count | Reserved | vdev id |
  9014. * |--------------------------------------------------------------------------|
  9015. * | MSDU 0 bus address (bits 31:0) |
  9016. #if HTT_PADDR64
  9017. * | MSDU 0 bus address (bits 63:32) |
  9018. #endif
  9019. * |--------------------------------------------------------------------------|
  9020. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9021. * |--------------------------------------------------------------------------|
  9022. * | MSDU 1 bus address (bits 31:0) |
  9023. #if HTT_PADDR64
  9024. * | MSDU 1 bus address (bits 63:32) |
  9025. #endif
  9026. * |--------------------------------------------------------------------------|
  9027. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9028. * |--------------------------------------------------------------------------|
  9029. */
  9030. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9031. *
  9032. * @details
  9033. * bits
  9034. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9035. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9036. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9037. * | | frag | | | | fail |chksum fail|
  9038. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9039. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9040. */
  9041. struct htt_rx_in_ord_paddr_ind_hdr_t
  9042. {
  9043. A_UINT32 /* word 0 */
  9044. msg_type: 8,
  9045. ext_tid: 5,
  9046. offload: 1,
  9047. frag: 1,
  9048. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9049. peer_id: 16;
  9050. A_UINT32 /* word 1 */
  9051. vap_id: 8,
  9052. /* NOTE:
  9053. * This reserved_1 field is not truly reserved - certain targets use
  9054. * this field internally to store debug information, and do not zero
  9055. * out the contents of the field before uploading the message to the
  9056. * host. Thus, any host-target communication supported by this field
  9057. * is limited to using values that are never used by the debug
  9058. * information stored by certain targets in the reserved_1 field.
  9059. * In particular, the targets in question don't use the value 0x3
  9060. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9061. * so this previously-unused value within these bits is available to
  9062. * use as the host / target PKT_CAPTURE_MODE flag.
  9063. */
  9064. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9065. /* if pkt_capture_mode == 0x3, host should
  9066. * send rx frames to monitor mode interface
  9067. */
  9068. msdu_cnt: 16;
  9069. };
  9070. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9071. {
  9072. A_UINT32 dma_addr;
  9073. A_UINT32
  9074. length: 16,
  9075. fw_desc: 8,
  9076. msdu_info:8;
  9077. };
  9078. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9079. {
  9080. A_UINT32 dma_addr_lo;
  9081. A_UINT32 dma_addr_hi;
  9082. A_UINT32
  9083. length: 16,
  9084. fw_desc: 8,
  9085. msdu_info:8;
  9086. };
  9087. #if HTT_PADDR64
  9088. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9089. #else
  9090. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9091. #endif
  9092. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9093. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9094. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9095. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9096. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9097. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9098. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9099. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9100. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9101. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9102. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9103. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9104. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9105. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9106. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9107. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9108. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9109. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9110. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9111. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9112. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9113. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9114. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9115. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9116. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9117. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9118. /* for systems using 64-bit format for bus addresses */
  9119. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9120. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9121. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9122. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9123. /* for systems using 32-bit format for bus addresses */
  9124. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9125. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9126. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9127. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9128. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9129. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9130. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9131. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9132. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9133. do { \
  9134. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9135. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9136. } while (0)
  9137. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9138. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9139. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9140. do { \
  9141. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9142. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9143. } while (0)
  9144. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9145. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9146. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9147. do { \
  9148. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9149. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9150. } while (0)
  9151. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9152. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9153. /*
  9154. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9155. * deliver the rx frames to the monitor mode interface.
  9156. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9157. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9158. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9159. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9160. */
  9161. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9162. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9163. do { \
  9164. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9165. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9166. } while (0)
  9167. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9168. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9169. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9170. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9171. do { \
  9172. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9173. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9174. } while (0)
  9175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9176. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9177. /* for systems using 64-bit format for bus addresses */
  9178. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9179. do { \
  9180. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9181. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9182. } while (0)
  9183. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9184. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9185. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9186. do { \
  9187. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9188. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9189. } while (0)
  9190. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9191. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9192. /* for systems using 32-bit format for bus addresses */
  9193. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9194. do { \
  9195. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9196. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9197. } while (0)
  9198. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9199. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9200. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9201. do { \
  9202. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9203. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9204. } while (0)
  9205. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9206. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9207. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9208. do { \
  9209. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9210. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9211. } while (0)
  9212. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9213. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9214. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9217. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9218. } while (0)
  9219. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9220. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9221. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9222. do { \
  9223. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9224. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9225. } while (0)
  9226. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9227. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9228. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9231. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9232. } while (0)
  9233. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9234. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9235. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9236. do { \
  9237. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9238. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9239. } while (0)
  9240. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9241. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9242. /* definitions used within target -> host rx indication message */
  9243. PREPACK struct htt_rx_ind_hdr_prefix_t
  9244. {
  9245. A_UINT32 /* word 0 */
  9246. msg_type: 8,
  9247. ext_tid: 5,
  9248. release_valid: 1,
  9249. flush_valid: 1,
  9250. reserved0: 1,
  9251. peer_id: 16;
  9252. A_UINT32 /* word 1 */
  9253. flush_start_seq_num: 6,
  9254. flush_end_seq_num: 6,
  9255. release_start_seq_num: 6,
  9256. release_end_seq_num: 6,
  9257. num_mpdu_ranges: 8;
  9258. } POSTPACK;
  9259. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9260. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9261. #define HTT_TGT_RSSI_INVALID 0x80
  9262. PREPACK struct htt_rx_ppdu_desc_t
  9263. {
  9264. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9265. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9266. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9267. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9268. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9269. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9270. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9271. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9272. A_UINT32 /* word 0 */
  9273. rssi_cmb: 8,
  9274. timestamp_submicrosec: 8,
  9275. phy_err_code: 8,
  9276. phy_err: 1,
  9277. legacy_rate: 4,
  9278. legacy_rate_sel: 1,
  9279. end_valid: 1,
  9280. start_valid: 1;
  9281. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9282. union {
  9283. A_UINT32 /* word 1 */
  9284. rssi0_pri20: 8,
  9285. rssi0_ext20: 8,
  9286. rssi0_ext40: 8,
  9287. rssi0_ext80: 8;
  9288. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9289. } u0;
  9290. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9291. union {
  9292. A_UINT32 /* word 2 */
  9293. rssi1_pri20: 8,
  9294. rssi1_ext20: 8,
  9295. rssi1_ext40: 8,
  9296. rssi1_ext80: 8;
  9297. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9298. } u1;
  9299. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9300. union {
  9301. A_UINT32 /* word 3 */
  9302. rssi2_pri20: 8,
  9303. rssi2_ext20: 8,
  9304. rssi2_ext40: 8,
  9305. rssi2_ext80: 8;
  9306. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9307. } u2;
  9308. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9309. union {
  9310. A_UINT32 /* word 4 */
  9311. rssi3_pri20: 8,
  9312. rssi3_ext20: 8,
  9313. rssi3_ext40: 8,
  9314. rssi3_ext80: 8;
  9315. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9316. } u3;
  9317. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9318. A_UINT32 tsf32; /* word 5 */
  9319. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9320. A_UINT32 timestamp_microsec; /* word 6 */
  9321. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9322. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9323. A_UINT32 /* word 7 */
  9324. vht_sig_a1: 24,
  9325. preamble_type: 8;
  9326. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9327. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9328. A_UINT32 /* word 8 */
  9329. vht_sig_a2: 24,
  9330. /* sa_ant_matrix
  9331. * For cases where a single rx chain has options to be connected to
  9332. * different rx antennas, show which rx antennas were in use during
  9333. * receipt of a given PPDU.
  9334. * This sa_ant_matrix provides a bitmask of the antennas used while
  9335. * receiving this frame.
  9336. */
  9337. sa_ant_matrix: 8;
  9338. } POSTPACK;
  9339. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9340. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9341. PREPACK struct htt_rx_ind_hdr_suffix_t
  9342. {
  9343. A_UINT32 /* word 0 */
  9344. fw_rx_desc_bytes: 16,
  9345. reserved0: 16;
  9346. } POSTPACK;
  9347. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9348. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9349. PREPACK struct htt_rx_ind_hdr_t
  9350. {
  9351. struct htt_rx_ind_hdr_prefix_t prefix;
  9352. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9353. struct htt_rx_ind_hdr_suffix_t suffix;
  9354. } POSTPACK;
  9355. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9356. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9357. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9358. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9359. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9360. /*
  9361. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9362. * the offset into the HTT rx indication message at which the
  9363. * FW rx PPDU descriptor resides
  9364. */
  9365. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9366. /*
  9367. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9368. * the offset into the HTT rx indication message at which the
  9369. * header suffix (FW rx MSDU byte count) resides
  9370. */
  9371. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9372. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9373. /*
  9374. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9375. * the offset into the HTT rx indication message at which the per-MSDU
  9376. * information starts
  9377. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9378. * per-MSDU information portion of the message. The per-MSDU info itself
  9379. * starts at byte 12.
  9380. */
  9381. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9382. /**
  9383. * @brief target -> host rx indication message definition
  9384. *
  9385. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9386. *
  9387. * @details
  9388. * The following field definitions describe the format of the rx indication
  9389. * message sent from the target to the host.
  9390. * The message consists of three major sections:
  9391. * 1. a fixed-length header
  9392. * 2. a variable-length list of firmware rx MSDU descriptors
  9393. * 3. one or more 4-octet MPDU range information elements
  9394. * The fixed length header itself has two sub-sections
  9395. * 1. the message meta-information, including identification of the
  9396. * sender and type of the received data, and a 4-octet flush/release IE
  9397. * 2. the firmware rx PPDU descriptor
  9398. *
  9399. * The format of the message is depicted below.
  9400. * in this depiction, the following abbreviations are used for information
  9401. * elements within the message:
  9402. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9403. * elements associated with the PPDU start are valid.
  9404. * Specifically, the following fields are valid only if SV is set:
  9405. * RSSI (all variants), L, legacy rate, preamble type, service,
  9406. * VHT-SIG-A
  9407. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9408. * elements associated with the PPDU end are valid.
  9409. * Specifically, the following fields are valid only if EV is set:
  9410. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9411. * - L - Legacy rate selector - if legacy rates are used, this flag
  9412. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9413. * (L == 0) PHY.
  9414. * - P - PHY error flag - boolean indication of whether the rx frame had
  9415. * a PHY error
  9416. *
  9417. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9418. * |----------------+-------------------+---------------------+---------------|
  9419. * | peer ID | |RV|FV| ext TID | msg type |
  9420. * |--------------------------------------------------------------------------|
  9421. * | num | release | release | flush | flush |
  9422. * | MPDU | end | start | end | start |
  9423. * | ranges | seq num | seq num | seq num | seq num |
  9424. * |==========================================================================|
  9425. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9426. * |V|V| | rate | | | timestamp | RSSI |
  9427. * |--------------------------------------------------------------------------|
  9428. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9429. * |--------------------------------------------------------------------------|
  9430. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9431. * |--------------------------------------------------------------------------|
  9432. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9433. * |--------------------------------------------------------------------------|
  9434. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9435. * |--------------------------------------------------------------------------|
  9436. * | TSF LSBs |
  9437. * |--------------------------------------------------------------------------|
  9438. * | microsec timestamp |
  9439. * |--------------------------------------------------------------------------|
  9440. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9441. * |--------------------------------------------------------------------------|
  9442. * | service | HT-SIG / VHT-SIG-A2 |
  9443. * |==========================================================================|
  9444. * | reserved | FW rx desc bytes |
  9445. * |--------------------------------------------------------------------------|
  9446. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9447. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9448. * |--------------------------------------------------------------------------|
  9449. * : : :
  9450. * |--------------------------------------------------------------------------|
  9451. * | alignment | MSDU Rx |
  9452. * | padding | desc Bn |
  9453. * |--------------------------------------------------------------------------|
  9454. * | reserved | MPDU range status | MPDU count |
  9455. * |--------------------------------------------------------------------------|
  9456. * : reserved : MPDU range status : MPDU count :
  9457. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9458. *
  9459. * Header fields:
  9460. * - MSG_TYPE
  9461. * Bits 7:0
  9462. * Purpose: identifies this as an rx indication message
  9463. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9464. * - EXT_TID
  9465. * Bits 12:8
  9466. * Purpose: identify the traffic ID of the rx data, including
  9467. * special "extended" TID values for multicast, broadcast, and
  9468. * non-QoS data frames
  9469. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9470. * - FLUSH_VALID (FV)
  9471. * Bit 13
  9472. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9473. * is valid
  9474. * Value:
  9475. * 1 -> flush IE is valid and needs to be processed
  9476. * 0 -> flush IE is not valid and should be ignored
  9477. * - REL_VALID (RV)
  9478. * Bit 13
  9479. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9480. * is valid
  9481. * Value:
  9482. * 1 -> release IE is valid and needs to be processed
  9483. * 0 -> release IE is not valid and should be ignored
  9484. * - PEER_ID
  9485. * Bits 31:16
  9486. * Purpose: Identify, by ID, which peer sent the rx data
  9487. * Value: ID of the peer who sent the rx data
  9488. * - FLUSH_SEQ_NUM_START
  9489. * Bits 5:0
  9490. * Purpose: Indicate the start of a series of MPDUs to flush
  9491. * Not all MPDUs within this series are necessarily valid - the host
  9492. * must check each sequence number within this range to see if the
  9493. * corresponding MPDU is actually present.
  9494. * This field is only valid if the FV bit is set.
  9495. * Value:
  9496. * The sequence number for the first MPDUs to check to flush.
  9497. * The sequence number is masked by 0x3f.
  9498. * - FLUSH_SEQ_NUM_END
  9499. * Bits 11:6
  9500. * Purpose: Indicate the end of a series of MPDUs to flush
  9501. * Value:
  9502. * The sequence number one larger than the sequence number of the
  9503. * last MPDU to check to flush.
  9504. * The sequence number is masked by 0x3f.
  9505. * Not all MPDUs within this series are necessarily valid - the host
  9506. * must check each sequence number within this range to see if the
  9507. * corresponding MPDU is actually present.
  9508. * This field is only valid if the FV bit is set.
  9509. * - REL_SEQ_NUM_START
  9510. * Bits 17:12
  9511. * Purpose: Indicate the start of a series of MPDUs to release.
  9512. * All MPDUs within this series are present and valid - the host
  9513. * need not check each sequence number within this range to see if
  9514. * the corresponding MPDU is actually present.
  9515. * This field is only valid if the RV bit is set.
  9516. * Value:
  9517. * The sequence number for the first MPDUs to check to release.
  9518. * The sequence number is masked by 0x3f.
  9519. * - REL_SEQ_NUM_END
  9520. * Bits 23:18
  9521. * Purpose: Indicate the end of a series of MPDUs to release.
  9522. * Value:
  9523. * The sequence number one larger than the sequence number of the
  9524. * last MPDU to check to release.
  9525. * The sequence number is masked by 0x3f.
  9526. * All MPDUs within this series are present and valid - the host
  9527. * need not check each sequence number within this range to see if
  9528. * the corresponding MPDU is actually present.
  9529. * This field is only valid if the RV bit is set.
  9530. * - NUM_MPDU_RANGES
  9531. * Bits 31:24
  9532. * Purpose: Indicate how many ranges of MPDUs are present.
  9533. * Each MPDU range consists of a series of contiguous MPDUs within the
  9534. * rx frame sequence which all have the same MPDU status.
  9535. * Value: 1-63 (typically a small number, like 1-3)
  9536. *
  9537. * Rx PPDU descriptor fields:
  9538. * - RSSI_CMB
  9539. * Bits 7:0
  9540. * Purpose: Combined RSSI from all active rx chains, across the active
  9541. * bandwidth.
  9542. * Value: RSSI dB units w.r.t. noise floor
  9543. * - TIMESTAMP_SUBMICROSEC
  9544. * Bits 15:8
  9545. * Purpose: high-resolution timestamp
  9546. * Value:
  9547. * Sub-microsecond time of PPDU reception.
  9548. * This timestamp ranges from [0,MAC clock MHz).
  9549. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9550. * to form a high-resolution, large range rx timestamp.
  9551. * - PHY_ERR_CODE
  9552. * Bits 23:16
  9553. * Purpose:
  9554. * If the rx frame processing resulted in a PHY error, indicate what
  9555. * type of rx PHY error occurred.
  9556. * Value:
  9557. * This field is valid if the "P" (PHY_ERR) flag is set.
  9558. * TBD: document/specify the values for this field
  9559. * - PHY_ERR
  9560. * Bit 24
  9561. * Purpose: indicate whether the rx PPDU had a PHY error
  9562. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9563. * - LEGACY_RATE
  9564. * Bits 28:25
  9565. * Purpose:
  9566. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9567. * specify which rate was used.
  9568. * Value:
  9569. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9570. * flag.
  9571. * If LEGACY_RATE_SEL is 0:
  9572. * 0x8: OFDM 48 Mbps
  9573. * 0x9: OFDM 24 Mbps
  9574. * 0xA: OFDM 12 Mbps
  9575. * 0xB: OFDM 6 Mbps
  9576. * 0xC: OFDM 54 Mbps
  9577. * 0xD: OFDM 36 Mbps
  9578. * 0xE: OFDM 18 Mbps
  9579. * 0xF: OFDM 9 Mbps
  9580. * If LEGACY_RATE_SEL is 1:
  9581. * 0x8: CCK 11 Mbps long preamble
  9582. * 0x9: CCK 5.5 Mbps long preamble
  9583. * 0xA: CCK 2 Mbps long preamble
  9584. * 0xB: CCK 1 Mbps long preamble
  9585. * 0xC: CCK 11 Mbps short preamble
  9586. * 0xD: CCK 5.5 Mbps short preamble
  9587. * 0xE: CCK 2 Mbps short preamble
  9588. * - LEGACY_RATE_SEL
  9589. * Bit 29
  9590. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9591. * Value:
  9592. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9593. * used a legacy rate.
  9594. * 0 -> OFDM, 1 -> CCK
  9595. * - END_VALID
  9596. * Bit 30
  9597. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9598. * the start of the PPDU are valid. Specifically, the following
  9599. * fields are only valid if END_VALID is set:
  9600. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9601. * TIMESTAMP_SUBMICROSEC
  9602. * Value:
  9603. * 0 -> rx PPDU desc end fields are not valid
  9604. * 1 -> rx PPDU desc end fields are valid
  9605. * - START_VALID
  9606. * Bit 31
  9607. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9608. * the end of the PPDU are valid. Specifically, the following
  9609. * fields are only valid if START_VALID is set:
  9610. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9611. * VHT-SIG-A
  9612. * Value:
  9613. * 0 -> rx PPDU desc start fields are not valid
  9614. * 1 -> rx PPDU desc start fields are valid
  9615. * - RSSI0_PRI20
  9616. * Bits 7:0
  9617. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9618. * Value: RSSI dB units w.r.t. noise floor
  9619. *
  9620. * - RSSI0_EXT20
  9621. * Bits 7:0
  9622. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9623. * (if the rx bandwidth was >= 40 MHz)
  9624. * Value: RSSI dB units w.r.t. noise floor
  9625. * - RSSI0_EXT40
  9626. * Bits 7:0
  9627. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9628. * (if the rx bandwidth was >= 80 MHz)
  9629. * Value: RSSI dB units w.r.t. noise floor
  9630. * - RSSI0_EXT80
  9631. * Bits 7:0
  9632. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9633. * (if the rx bandwidth was >= 160 MHz)
  9634. * Value: RSSI dB units w.r.t. noise floor
  9635. *
  9636. * - RSSI1_PRI20
  9637. * Bits 7:0
  9638. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9639. * Value: RSSI dB units w.r.t. noise floor
  9640. * - RSSI1_EXT20
  9641. * Bits 7:0
  9642. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9643. * (if the rx bandwidth was >= 40 MHz)
  9644. * Value: RSSI dB units w.r.t. noise floor
  9645. * - RSSI1_EXT40
  9646. * Bits 7:0
  9647. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9648. * (if the rx bandwidth was >= 80 MHz)
  9649. * Value: RSSI dB units w.r.t. noise floor
  9650. * - RSSI1_EXT80
  9651. * Bits 7:0
  9652. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9653. * (if the rx bandwidth was >= 160 MHz)
  9654. * Value: RSSI dB units w.r.t. noise floor
  9655. *
  9656. * - RSSI2_PRI20
  9657. * Bits 7:0
  9658. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9659. * Value: RSSI dB units w.r.t. noise floor
  9660. * - RSSI2_EXT20
  9661. * Bits 7:0
  9662. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9663. * (if the rx bandwidth was >= 40 MHz)
  9664. * Value: RSSI dB units w.r.t. noise floor
  9665. * - RSSI2_EXT40
  9666. * Bits 7:0
  9667. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9668. * (if the rx bandwidth was >= 80 MHz)
  9669. * Value: RSSI dB units w.r.t. noise floor
  9670. * - RSSI2_EXT80
  9671. * Bits 7:0
  9672. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9673. * (if the rx bandwidth was >= 160 MHz)
  9674. * Value: RSSI dB units w.r.t. noise floor
  9675. *
  9676. * - RSSI3_PRI20
  9677. * Bits 7:0
  9678. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9679. * Value: RSSI dB units w.r.t. noise floor
  9680. * - RSSI3_EXT20
  9681. * Bits 7:0
  9682. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9683. * (if the rx bandwidth was >= 40 MHz)
  9684. * Value: RSSI dB units w.r.t. noise floor
  9685. * - RSSI3_EXT40
  9686. * Bits 7:0
  9687. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9688. * (if the rx bandwidth was >= 80 MHz)
  9689. * Value: RSSI dB units w.r.t. noise floor
  9690. * - RSSI3_EXT80
  9691. * Bits 7:0
  9692. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9693. * (if the rx bandwidth was >= 160 MHz)
  9694. * Value: RSSI dB units w.r.t. noise floor
  9695. *
  9696. * - TSF32
  9697. * Bits 31:0
  9698. * Purpose: specify the time the rx PPDU was received, in TSF units
  9699. * Value: 32 LSBs of the TSF
  9700. * - TIMESTAMP_MICROSEC
  9701. * Bits 31:0
  9702. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9703. * Value: PPDU rx time, in microseconds
  9704. * - VHT_SIG_A1
  9705. * Bits 23:0
  9706. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9707. * from the rx PPDU
  9708. * Value:
  9709. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9710. * VHT-SIG-A1 data.
  9711. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9712. * first 24 bits of the HT-SIG data.
  9713. * Otherwise, this field is invalid.
  9714. * Refer to the the 802.11 protocol for the definition of the
  9715. * HT-SIG and VHT-SIG-A1 fields
  9716. * - VHT_SIG_A2
  9717. * Bits 23:0
  9718. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9719. * from the rx PPDU
  9720. * Value:
  9721. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9722. * VHT-SIG-A2 data.
  9723. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9724. * last 24 bits of the HT-SIG data.
  9725. * Otherwise, this field is invalid.
  9726. * Refer to the the 802.11 protocol for the definition of the
  9727. * HT-SIG and VHT-SIG-A2 fields
  9728. * - PREAMBLE_TYPE
  9729. * Bits 31:24
  9730. * Purpose: indicate the PHY format of the received burst
  9731. * Value:
  9732. * 0x4: Legacy (OFDM/CCK)
  9733. * 0x8: HT
  9734. * 0x9: HT with TxBF
  9735. * 0xC: VHT
  9736. * 0xD: VHT with TxBF
  9737. * - SERVICE
  9738. * Bits 31:24
  9739. * Purpose: TBD
  9740. * Value: TBD
  9741. *
  9742. * Rx MSDU descriptor fields:
  9743. * - FW_RX_DESC_BYTES
  9744. * Bits 15:0
  9745. * Purpose: Indicate how many bytes in the Rx indication are used for
  9746. * FW Rx descriptors
  9747. *
  9748. * Payload fields:
  9749. * - MPDU_COUNT
  9750. * Bits 7:0
  9751. * Purpose: Indicate how many sequential MPDUs share the same status.
  9752. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9753. * - MPDU_STATUS
  9754. * Bits 15:8
  9755. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9756. * received successfully.
  9757. * Value:
  9758. * 0x1: success
  9759. * 0x2: FCS error
  9760. * 0x3: duplicate error
  9761. * 0x4: replay error
  9762. * 0x5: invalid peer
  9763. */
  9764. /* header fields */
  9765. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9766. #define HTT_RX_IND_EXT_TID_S 8
  9767. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9768. #define HTT_RX_IND_FLUSH_VALID_S 13
  9769. #define HTT_RX_IND_REL_VALID_M 0x4000
  9770. #define HTT_RX_IND_REL_VALID_S 14
  9771. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9772. #define HTT_RX_IND_PEER_ID_S 16
  9773. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9774. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9775. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9776. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9777. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9778. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9779. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9780. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9781. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9782. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9783. /* rx PPDU descriptor fields */
  9784. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9785. #define HTT_RX_IND_RSSI_CMB_S 0
  9786. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9787. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9788. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9789. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9790. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9791. #define HTT_RX_IND_PHY_ERR_S 24
  9792. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9793. #define HTT_RX_IND_LEGACY_RATE_S 25
  9794. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9795. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9796. #define HTT_RX_IND_END_VALID_M 0x40000000
  9797. #define HTT_RX_IND_END_VALID_S 30
  9798. #define HTT_RX_IND_START_VALID_M 0x80000000
  9799. #define HTT_RX_IND_START_VALID_S 31
  9800. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9801. #define HTT_RX_IND_RSSI_PRI20_S 0
  9802. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9803. #define HTT_RX_IND_RSSI_EXT20_S 8
  9804. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9805. #define HTT_RX_IND_RSSI_EXT40_S 16
  9806. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9807. #define HTT_RX_IND_RSSI_EXT80_S 24
  9808. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9809. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9810. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9811. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9812. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9813. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9814. #define HTT_RX_IND_SERVICE_M 0xff000000
  9815. #define HTT_RX_IND_SERVICE_S 24
  9816. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9817. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9818. /* rx MSDU descriptor fields */
  9819. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9820. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9821. /* payload fields */
  9822. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9823. #define HTT_RX_IND_MPDU_COUNT_S 0
  9824. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9825. #define HTT_RX_IND_MPDU_STATUS_S 8
  9826. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9827. do { \
  9828. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9829. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9830. } while (0)
  9831. #define HTT_RX_IND_EXT_TID_GET(word) \
  9832. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9833. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9834. do { \
  9835. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9836. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9837. } while (0)
  9838. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9839. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9840. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9841. do { \
  9842. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9843. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9844. } while (0)
  9845. #define HTT_RX_IND_REL_VALID_GET(word) \
  9846. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9847. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9848. do { \
  9849. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9850. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9851. } while (0)
  9852. #define HTT_RX_IND_PEER_ID_GET(word) \
  9853. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9854. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9855. do { \
  9856. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9857. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9858. } while (0)
  9859. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9860. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9861. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9862. do { \
  9863. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9864. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9865. } while (0)
  9866. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9867. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9868. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9869. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9870. do { \
  9871. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9872. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9873. } while (0)
  9874. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9875. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9876. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9877. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9878. do { \
  9879. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9880. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9881. } while (0)
  9882. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9883. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9884. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9885. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9886. do { \
  9887. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9888. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9889. } while (0)
  9890. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9891. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9892. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9893. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9894. do { \
  9895. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9896. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9897. } while (0)
  9898. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9899. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9900. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9901. /* FW rx PPDU descriptor fields */
  9902. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9903. do { \
  9904. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9905. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9906. } while (0)
  9907. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9908. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9909. HTT_RX_IND_RSSI_CMB_S)
  9910. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9911. do { \
  9912. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9913. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9914. } while (0)
  9915. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9916. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9917. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9918. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9919. do { \
  9920. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9921. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9922. } while (0)
  9923. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9924. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9925. HTT_RX_IND_PHY_ERR_CODE_S)
  9926. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9927. do { \
  9928. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9929. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9930. } while (0)
  9931. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9932. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9933. HTT_RX_IND_PHY_ERR_S)
  9934. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9935. do { \
  9936. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9937. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9938. } while (0)
  9939. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9940. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9941. HTT_RX_IND_LEGACY_RATE_S)
  9942. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9943. do { \
  9944. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9945. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9946. } while (0)
  9947. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9948. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9949. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9950. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9953. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9954. } while (0)
  9955. #define HTT_RX_IND_END_VALID_GET(word) \
  9956. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9957. HTT_RX_IND_END_VALID_S)
  9958. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9959. do { \
  9960. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9961. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9962. } while (0)
  9963. #define HTT_RX_IND_START_VALID_GET(word) \
  9964. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9965. HTT_RX_IND_START_VALID_S)
  9966. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9967. do { \
  9968. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9969. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9970. } while (0)
  9971. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9972. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9973. HTT_RX_IND_RSSI_PRI20_S)
  9974. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9975. do { \
  9976. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9977. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9978. } while (0)
  9979. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9980. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9981. HTT_RX_IND_RSSI_EXT20_S)
  9982. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9983. do { \
  9984. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9985. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9986. } while (0)
  9987. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9988. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9989. HTT_RX_IND_RSSI_EXT40_S)
  9990. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9991. do { \
  9992. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9993. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9994. } while (0)
  9995. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9996. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9997. HTT_RX_IND_RSSI_EXT80_S)
  9998. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9999. do { \
  10000. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10001. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10002. } while (0)
  10003. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10004. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10005. HTT_RX_IND_VHT_SIG_A1_S)
  10006. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10007. do { \
  10008. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10009. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10010. } while (0)
  10011. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10012. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10013. HTT_RX_IND_VHT_SIG_A2_S)
  10014. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10015. do { \
  10016. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10017. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10018. } while (0)
  10019. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10020. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10021. HTT_RX_IND_PREAMBLE_TYPE_S)
  10022. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10023. do { \
  10024. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10025. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10026. } while (0)
  10027. #define HTT_RX_IND_SERVICE_GET(word) \
  10028. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10029. HTT_RX_IND_SERVICE_S)
  10030. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10031. do { \
  10032. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10033. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10034. } while (0)
  10035. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10036. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10037. HTT_RX_IND_SA_ANT_MATRIX_S)
  10038. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10039. do { \
  10040. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10041. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10042. } while (0)
  10043. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10044. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10045. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10046. do { \
  10047. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10048. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10049. } while (0)
  10050. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10051. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10052. #define HTT_RX_IND_HL_BYTES \
  10053. (HTT_RX_IND_HDR_BYTES + \
  10054. 4 /* single FW rx MSDU descriptor */ + \
  10055. 4 /* single MPDU range information element */)
  10056. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10057. /* Could we use one macro entry? */
  10058. #define HTT_WORD_SET(word, field, value) \
  10059. do { \
  10060. HTT_CHECK_SET_VAL(field, value); \
  10061. (word) |= ((value) << field ## _S); \
  10062. } while (0)
  10063. #define HTT_WORD_GET(word, field) \
  10064. (((word) & field ## _M) >> field ## _S)
  10065. PREPACK struct hl_htt_rx_ind_base {
  10066. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10067. } POSTPACK;
  10068. /*
  10069. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10070. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10071. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10072. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10073. * htt_rx_ind_hl_rx_desc_t.
  10074. */
  10075. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10076. struct htt_rx_ind_hl_rx_desc_t {
  10077. A_UINT8 ver;
  10078. A_UINT8 len;
  10079. struct {
  10080. A_UINT8
  10081. first_msdu: 1,
  10082. last_msdu: 1,
  10083. c3_failed: 1,
  10084. c4_failed: 1,
  10085. ipv6: 1,
  10086. tcp: 1,
  10087. udp: 1,
  10088. reserved: 1;
  10089. } flags;
  10090. /* NOTE: no reserved space - don't append any new fields here */
  10091. };
  10092. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10093. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10094. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10095. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10096. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10097. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10098. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10099. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10100. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10101. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10102. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10103. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10104. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10105. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10106. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10107. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10108. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10109. /* This structure is used in HL, the basic descriptor information
  10110. * used by host. the structure is translated by FW from HW desc
  10111. * or generated by FW. But in HL monitor mode, the host would use
  10112. * the same structure with LL.
  10113. */
  10114. PREPACK struct hl_htt_rx_desc_base {
  10115. A_UINT32
  10116. seq_num:12,
  10117. encrypted:1,
  10118. chan_info_present:1,
  10119. resv0:2,
  10120. mcast_bcast:1,
  10121. fragment:1,
  10122. key_id_oct:8,
  10123. resv1:6;
  10124. A_UINT32
  10125. pn_31_0;
  10126. union {
  10127. struct {
  10128. A_UINT16 pn_47_32;
  10129. A_UINT16 pn_63_48;
  10130. } pn16;
  10131. A_UINT32 pn_63_32;
  10132. } u0;
  10133. A_UINT32
  10134. pn_95_64;
  10135. A_UINT32
  10136. pn_127_96;
  10137. } POSTPACK;
  10138. /*
  10139. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10140. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10141. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10142. * Please see htt_chan_change_t for description of the fields.
  10143. */
  10144. PREPACK struct htt_chan_info_t
  10145. {
  10146. A_UINT32 primary_chan_center_freq_mhz: 16,
  10147. contig_chan1_center_freq_mhz: 16;
  10148. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10149. phy_mode: 8,
  10150. reserved: 8;
  10151. } POSTPACK;
  10152. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10153. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10154. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10155. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10156. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10157. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10158. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10159. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10160. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10161. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10162. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10163. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10164. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10165. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10166. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10167. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10168. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10169. /* Channel information */
  10170. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10171. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10172. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10173. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10174. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10175. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10176. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10177. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10178. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10179. do { \
  10180. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10181. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10182. } while (0)
  10183. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10184. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10185. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10186. do { \
  10187. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10188. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10189. } while (0)
  10190. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10191. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10192. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10193. do { \
  10194. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10195. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10196. } while (0)
  10197. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10198. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10199. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10200. do { \
  10201. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10202. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10203. } while (0)
  10204. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10205. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10206. /*
  10207. * @brief target -> host message definition for FW offloaded pkts
  10208. *
  10209. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10210. *
  10211. * @details
  10212. * The following field definitions describe the format of the firmware
  10213. * offload deliver message sent from the target to the host.
  10214. *
  10215. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10216. *
  10217. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10218. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10219. * | reserved_1 | msg type |
  10220. * |--------------------------------------------------------------------------|
  10221. * | phy_timestamp_l32 |
  10222. * |--------------------------------------------------------------------------|
  10223. * | WORD2 (see below) |
  10224. * |--------------------------------------------------------------------------|
  10225. * | seqno | framectrl |
  10226. * |--------------------------------------------------------------------------|
  10227. * | reserved_3 | vdev_id | tid_num|
  10228. * |--------------------------------------------------------------------------|
  10229. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10230. * |--------------------------------------------------------------------------|
  10231. *
  10232. * where:
  10233. * STAT = status
  10234. * F = format (802.3 vs. 802.11)
  10235. *
  10236. * definition for word 2
  10237. *
  10238. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10239. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10240. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10241. * |--------------------------------------------------------------------------|
  10242. *
  10243. * where:
  10244. * PR = preamble
  10245. * BF = beamformed
  10246. */
  10247. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10248. {
  10249. A_UINT32 /* word 0 */
  10250. msg_type:8, /* [ 7: 0] */
  10251. reserved_1:24; /* [31: 8] */
  10252. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10253. A_UINT32 /* word 2 */
  10254. /* preamble:
  10255. * 0-OFDM,
  10256. * 1-CCk,
  10257. * 2-HT,
  10258. * 3-VHT
  10259. */
  10260. preamble: 2, /* [1:0] */
  10261. /* mcs:
  10262. * In case of HT preamble interpret
  10263. * MCS along with NSS.
  10264. * Valid values for HT are 0 to 7.
  10265. * HT mcs 0 with NSS 2 is mcs 8.
  10266. * Valid values for VHT are 0 to 9.
  10267. */
  10268. mcs: 4, /* [5:2] */
  10269. /* rate:
  10270. * This is applicable only for
  10271. * CCK and OFDM preamble type
  10272. * rate 0: OFDM 48 Mbps,
  10273. * 1: OFDM 24 Mbps,
  10274. * 2: OFDM 12 Mbps
  10275. * 3: OFDM 6 Mbps
  10276. * 4: OFDM 54 Mbps
  10277. * 5: OFDM 36 Mbps
  10278. * 6: OFDM 18 Mbps
  10279. * 7: OFDM 9 Mbps
  10280. * rate 0: CCK 11 Mbps Long
  10281. * 1: CCK 5.5 Mbps Long
  10282. * 2: CCK 2 Mbps Long
  10283. * 3: CCK 1 Mbps Long
  10284. * 4: CCK 11 Mbps Short
  10285. * 5: CCK 5.5 Mbps Short
  10286. * 6: CCK 2 Mbps Short
  10287. */
  10288. rate : 3, /* [ 8: 6] */
  10289. rssi : 8, /* [16: 9] units=dBm */
  10290. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10291. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10292. stbc : 1, /* [22] */
  10293. sgi : 1, /* [23] */
  10294. ldpc : 1, /* [24] */
  10295. beamformed: 1, /* [25] */
  10296. reserved_2: 6; /* [31:26] */
  10297. A_UINT32 /* word 3 */
  10298. framectrl:16, /* [15: 0] */
  10299. seqno:16; /* [31:16] */
  10300. A_UINT32 /* word 4 */
  10301. tid_num:5, /* [ 4: 0] actual TID number */
  10302. vdev_id:8, /* [12: 5] */
  10303. reserved_3:19; /* [31:13] */
  10304. A_UINT32 /* word 5 */
  10305. /* status:
  10306. * 0: tx_ok
  10307. * 1: retry
  10308. * 2: drop
  10309. * 3: filtered
  10310. * 4: abort
  10311. * 5: tid delete
  10312. * 6: sw abort
  10313. * 7: dropped by peer migration
  10314. */
  10315. status:3, /* [2:0] */
  10316. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10317. tx_mpdu_bytes:16, /* [19:4] */
  10318. /* Indicates retry count of offloaded/local generated Data tx frames */
  10319. tx_retry_cnt:6, /* [25:20] */
  10320. reserved_4:6; /* [31:26] */
  10321. } POSTPACK;
  10322. /* FW offload deliver ind message header fields */
  10323. /* DWORD one */
  10324. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10325. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10326. /* DWORD two */
  10327. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10328. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10329. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10330. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10331. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10332. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10333. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10334. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10335. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10336. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10337. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10338. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10339. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10340. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10341. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10342. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10343. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10344. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10345. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10346. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10347. /* DWORD three*/
  10348. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10349. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10350. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10351. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10352. /* DWORD four */
  10353. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10354. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10355. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10356. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10357. /* DWORD five */
  10358. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10359. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10360. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10361. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10362. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10363. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10364. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10365. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10366. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10367. do { \
  10368. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10369. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10370. } while (0)
  10371. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10372. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10373. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10374. do { \
  10375. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10376. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10377. } while (0)
  10378. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10379. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10380. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10381. do { \
  10382. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10383. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10384. } while (0)
  10385. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10386. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10387. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10388. do { \
  10389. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10390. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10391. } while (0)
  10392. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10393. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10394. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10395. do { \
  10396. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10397. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10398. } while (0)
  10399. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10400. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10401. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10402. do { \
  10403. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10404. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10405. } while (0)
  10406. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10407. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10408. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10409. do { \
  10410. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10411. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10412. } while (0)
  10413. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10414. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10415. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10416. do { \
  10417. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10418. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10419. } while (0)
  10420. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10421. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10422. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10423. do { \
  10424. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10425. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10426. } while (0)
  10427. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10428. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10429. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10430. do { \
  10431. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10432. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10433. } while (0)
  10434. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10435. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10436. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10437. do { \
  10438. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10439. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10440. } while (0)
  10441. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10442. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10443. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10444. do { \
  10445. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10446. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10447. } while (0)
  10448. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10449. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10450. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10451. do { \
  10452. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10453. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10454. } while (0)
  10455. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10456. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10457. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10458. do { \
  10459. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10460. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10461. } while (0)
  10462. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10463. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10464. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10465. do { \
  10466. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10467. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10468. } while (0)
  10469. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10470. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10471. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10472. do { \
  10473. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10474. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10475. } while (0)
  10476. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10477. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10478. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10479. do { \
  10480. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10481. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10482. } while (0)
  10483. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10484. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10485. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10486. do { \
  10487. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10488. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10489. } while (0)
  10490. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10491. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10492. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10493. do { \
  10494. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10495. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10496. } while (0)
  10497. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10498. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10499. /*
  10500. * @brief target -> host rx reorder flush message definition
  10501. *
  10502. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10503. *
  10504. * @details
  10505. * The following field definitions describe the format of the rx flush
  10506. * message sent from the target to the host.
  10507. * The message consists of a 4-octet header, followed by one or more
  10508. * 4-octet payload information elements.
  10509. *
  10510. * |31 24|23 8|7 0|
  10511. * |--------------------------------------------------------------|
  10512. * | TID | peer ID | msg type |
  10513. * |--------------------------------------------------------------|
  10514. * | seq num end | seq num start | MPDU status | reserved |
  10515. * |--------------------------------------------------------------|
  10516. * First DWORD:
  10517. * - MSG_TYPE
  10518. * Bits 7:0
  10519. * Purpose: identifies this as an rx flush message
  10520. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10521. * - PEER_ID
  10522. * Bits 23:8 (only bits 18:8 actually used)
  10523. * Purpose: identify which peer's rx data is being flushed
  10524. * Value: (rx) peer ID
  10525. * - TID
  10526. * Bits 31:24 (only bits 27:24 actually used)
  10527. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10528. * Value: traffic identifier
  10529. * Second DWORD:
  10530. * - MPDU_STATUS
  10531. * Bits 15:8
  10532. * Purpose:
  10533. * Indicate whether the flushed MPDUs should be discarded or processed.
  10534. * Value:
  10535. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10536. * stages of rx processing
  10537. * other: discard the MPDUs
  10538. * It is anticipated that flush messages will always have
  10539. * MPDU status == 1, but the status flag is included for
  10540. * flexibility.
  10541. * - SEQ_NUM_START
  10542. * Bits 23:16
  10543. * Purpose:
  10544. * Indicate the start of a series of consecutive MPDUs being flushed.
  10545. * Not all MPDUs within this range are necessarily valid - the host
  10546. * must check each sequence number within this range to see if the
  10547. * corresponding MPDU is actually present.
  10548. * Value:
  10549. * The sequence number for the first MPDU in the sequence.
  10550. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10551. * - SEQ_NUM_END
  10552. * Bits 30:24
  10553. * Purpose:
  10554. * Indicate the end of a series of consecutive MPDUs being flushed.
  10555. * Value:
  10556. * The sequence number one larger than the sequence number of the
  10557. * last MPDU being flushed.
  10558. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10559. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10560. * are to be released for further rx processing.
  10561. * Not all MPDUs within this range are necessarily valid - the host
  10562. * must check each sequence number within this range to see if the
  10563. * corresponding MPDU is actually present.
  10564. */
  10565. /* first DWORD */
  10566. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10567. #define HTT_RX_FLUSH_PEER_ID_S 8
  10568. #define HTT_RX_FLUSH_TID_M 0xff000000
  10569. #define HTT_RX_FLUSH_TID_S 24
  10570. /* second DWORD */
  10571. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10572. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10573. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10574. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10575. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10576. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10577. #define HTT_RX_FLUSH_BYTES 8
  10578. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10579. do { \
  10580. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10581. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10582. } while (0)
  10583. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10584. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10585. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10586. do { \
  10587. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10588. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10589. } while (0)
  10590. #define HTT_RX_FLUSH_TID_GET(word) \
  10591. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10592. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10593. do { \
  10594. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10595. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10596. } while (0)
  10597. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10598. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10599. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10600. do { \
  10601. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10602. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10603. } while (0)
  10604. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10605. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10606. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10607. do { \
  10608. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10609. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10610. } while (0)
  10611. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10612. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10613. /*
  10614. * @brief target -> host rx pn check indication message
  10615. *
  10616. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10617. *
  10618. * @details
  10619. * The following field definitions describe the format of the Rx PN check
  10620. * indication message sent from the target to the host.
  10621. * The message consists of a 4-octet header, followed by the start and
  10622. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10623. * IE is one octet containing the sequence number that failed the PN
  10624. * check.
  10625. *
  10626. * |31 24|23 8|7 0|
  10627. * |--------------------------------------------------------------|
  10628. * | TID | peer ID | msg type |
  10629. * |--------------------------------------------------------------|
  10630. * | Reserved | PN IE count | seq num end | seq num start|
  10631. * |--------------------------------------------------------------|
  10632. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10633. * |--------------------------------------------------------------|
  10634. * First DWORD:
  10635. * - MSG_TYPE
  10636. * Bits 7:0
  10637. * Purpose: Identifies this as an rx pn check indication message
  10638. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10639. * - PEER_ID
  10640. * Bits 23:8 (only bits 18:8 actually used)
  10641. * Purpose: identify which peer
  10642. * Value: (rx) peer ID
  10643. * - TID
  10644. * Bits 31:24 (only bits 27:24 actually used)
  10645. * Purpose: identify traffic identifier
  10646. * Value: traffic identifier
  10647. * Second DWORD:
  10648. * - SEQ_NUM_START
  10649. * Bits 7:0
  10650. * Purpose:
  10651. * Indicates the starting sequence number of the MPDU in this
  10652. * series of MPDUs that went though PN check.
  10653. * Value:
  10654. * The sequence number for the first MPDU in the sequence.
  10655. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10656. * - SEQ_NUM_END
  10657. * Bits 15:8
  10658. * Purpose:
  10659. * Indicates the ending sequence number of the MPDU in this
  10660. * series of MPDUs that went though PN check.
  10661. * Value:
  10662. * The sequence number one larger then the sequence number of the last
  10663. * MPDU being flushed.
  10664. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10665. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10666. * for invalid PN numbers and are ready to be released for further processing.
  10667. * Not all MPDUs within this range are necessarily valid - the host
  10668. * must check each sequence number within this range to see if the
  10669. * corresponding MPDU is actually present.
  10670. * - PN_IE_COUNT
  10671. * Bits 23:16
  10672. * Purpose:
  10673. * Used to determine the variable number of PN information elements in this
  10674. * message
  10675. *
  10676. * PN information elements:
  10677. * - PN_IE_x-
  10678. * Purpose:
  10679. * Each PN information element contains the sequence number of the MPDU that
  10680. * has failed the target PN check.
  10681. * Value:
  10682. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10683. * that failed the PN check.
  10684. */
  10685. /* first DWORD */
  10686. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10687. #define HTT_RX_PN_IND_PEER_ID_S 8
  10688. #define HTT_RX_PN_IND_TID_M 0xff000000
  10689. #define HTT_RX_PN_IND_TID_S 24
  10690. /* second DWORD */
  10691. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10692. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10693. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10694. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10695. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10696. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10697. #define HTT_RX_PN_IND_BYTES 8
  10698. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10699. do { \
  10700. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10701. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10702. } while (0)
  10703. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10704. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10705. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10706. do { \
  10707. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10708. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10709. } while (0)
  10710. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10711. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10712. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10713. do { \
  10714. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10715. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10716. } while (0)
  10717. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10718. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10719. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10720. do { \
  10721. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10722. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10723. } while (0)
  10724. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10725. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10726. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10727. do { \
  10728. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10729. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10730. } while (0)
  10731. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10732. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10733. /*
  10734. * @brief target -> host rx offload deliver message for LL system
  10735. *
  10736. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10737. *
  10738. * @details
  10739. * In a low latency system this message is sent whenever the offload
  10740. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10741. * The DMA of the actual packets into host memory is done before sending out
  10742. * this message. This message indicates only how many MSDUs to reap. The
  10743. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10744. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10745. * DMA'd by the MAC directly into host memory these packets do not contain
  10746. * the MAC descriptors in the header portion of the packet. Instead they contain
  10747. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10748. * message, the packets are delivered directly to the NW stack without going
  10749. * through the regular reorder buffering and PN checking path since it has
  10750. * already been done in target.
  10751. *
  10752. * |31 24|23 16|15 8|7 0|
  10753. * |-----------------------------------------------------------------------|
  10754. * | Total MSDU count | reserved | msg type |
  10755. * |-----------------------------------------------------------------------|
  10756. *
  10757. * @brief target -> host rx offload deliver message for HL system
  10758. *
  10759. * @details
  10760. * In a high latency system this message is sent whenever the offload manager
  10761. * flushes out the packets it has coalesced in its coalescing buffer. The
  10762. * actual packets are also carried along with this message. When the host
  10763. * receives this message, it is expected to deliver these packets to the NW
  10764. * stack directly instead of routing them through the reorder buffering and
  10765. * PN checking path since it has already been done in target.
  10766. *
  10767. * |31 24|23 16|15 8|7 0|
  10768. * |-----------------------------------------------------------------------|
  10769. * | Total MSDU count | reserved | msg type |
  10770. * |-----------------------------------------------------------------------|
  10771. * | peer ID | MSDU length |
  10772. * |-----------------------------------------------------------------------|
  10773. * | MSDU payload | FW Desc | tid | vdev ID |
  10774. * |-----------------------------------------------------------------------|
  10775. * | MSDU payload contd. |
  10776. * |-----------------------------------------------------------------------|
  10777. * | peer ID | MSDU length |
  10778. * |-----------------------------------------------------------------------|
  10779. * | MSDU payload | FW Desc | tid | vdev ID |
  10780. * |-----------------------------------------------------------------------|
  10781. * | MSDU payload contd. |
  10782. * |-----------------------------------------------------------------------|
  10783. *
  10784. */
  10785. /* first DWORD */
  10786. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10787. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10788. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10789. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10790. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10791. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10792. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10793. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10794. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10795. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10796. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10797. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10798. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10799. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10800. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10801. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10802. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10803. do { \
  10804. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10805. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10806. } while (0)
  10807. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10808. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10809. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10810. do { \
  10811. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10812. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10813. } while (0)
  10814. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10815. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10816. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10817. do { \
  10818. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10819. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10820. } while (0)
  10821. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10822. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10823. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10824. do { \
  10825. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10826. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10827. } while (0)
  10828. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10829. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10830. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10831. do { \
  10832. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10833. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10834. } while (0)
  10835. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10836. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10837. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10838. do { \
  10839. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10840. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10841. } while (0)
  10842. /**
  10843. * @brief target -> host rx peer map/unmap message definition
  10844. *
  10845. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10846. *
  10847. * @details
  10848. * The following diagram shows the format of the rx peer map message sent
  10849. * from the target to the host. This layout assumes the target operates
  10850. * as little-endian.
  10851. *
  10852. * This message always contains a SW peer ID. The main purpose of the
  10853. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10854. * with, so that the host can use that peer ID to determine which peer
  10855. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10856. * other purposes, such as identifying during tx completions which peer
  10857. * the tx frames in question were transmitted to.
  10858. *
  10859. * In certain generations of chips, the peer map message also contains
  10860. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10861. * to identify which peer the frame needs to be forwarded to (i.e. the
  10862. * peer assocated with the Destination MAC Address within the packet),
  10863. * and particularly which vdev needs to transmit the frame (for cases
  10864. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10865. * meaning as AST_INDEX_0.
  10866. * This DA-based peer ID that is provided for certain rx frames
  10867. * (the rx frames that need to be re-transmitted as tx frames)
  10868. * is the ID that the HW uses for referring to the peer in question,
  10869. * rather than the peer ID that the SW+FW use to refer to the peer.
  10870. *
  10871. *
  10872. * |31 24|23 16|15 8|7 0|
  10873. * |-----------------------------------------------------------------------|
  10874. * | SW peer ID | VDEV ID | msg type |
  10875. * |-----------------------------------------------------------------------|
  10876. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10877. * |-----------------------------------------------------------------------|
  10878. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10879. * |-----------------------------------------------------------------------|
  10880. *
  10881. *
  10882. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10883. *
  10884. * The following diagram shows the format of the rx peer unmap message sent
  10885. * from the target to the host.
  10886. *
  10887. * |31 24|23 16|15 8|7 0|
  10888. * |-----------------------------------------------------------------------|
  10889. * | SW peer ID | VDEV ID | msg type |
  10890. * |-----------------------------------------------------------------------|
  10891. *
  10892. * The following field definitions describe the format of the rx peer map
  10893. * and peer unmap messages sent from the target to the host.
  10894. * - MSG_TYPE
  10895. * Bits 7:0
  10896. * Purpose: identifies this as an rx peer map or peer unmap message
  10897. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10898. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10899. * - VDEV_ID
  10900. * Bits 15:8
  10901. * Purpose: Indicates which virtual device the peer is associated
  10902. * with.
  10903. * Value: vdev ID (used in the host to look up the vdev object)
  10904. * - PEER_ID (a.k.a. SW_PEER_ID)
  10905. * Bits 31:16
  10906. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10907. * freeing (unmap)
  10908. * Value: (rx) peer ID
  10909. * - MAC_ADDR_L32 (peer map only)
  10910. * Bits 31:0
  10911. * Purpose: Identifies which peer node the peer ID is for.
  10912. * Value: lower 4 bytes of peer node's MAC address
  10913. * - MAC_ADDR_U16 (peer map only)
  10914. * Bits 15:0
  10915. * Purpose: Identifies which peer node the peer ID is for.
  10916. * Value: upper 2 bytes of peer node's MAC address
  10917. * - HW_PEER_ID
  10918. * Bits 31:16
  10919. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10920. * address, so for rx frames marked for rx --> tx forwarding, the
  10921. * host can determine from the HW peer ID provided as meta-data with
  10922. * the rx frame which peer the frame is supposed to be forwarded to.
  10923. * Value: ID used by the MAC HW to identify the peer
  10924. */
  10925. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10926. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10927. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10928. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10929. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10930. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10931. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10932. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10933. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10934. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10935. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10936. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10937. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10938. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10939. do { \
  10940. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10941. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10942. } while (0)
  10943. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10944. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10945. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10946. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10947. do { \
  10948. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10949. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10950. } while (0)
  10951. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10952. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10953. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10954. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10955. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10956. do { \
  10957. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10958. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10959. } while (0)
  10960. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10961. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10962. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10963. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10964. #define HTT_RX_PEER_MAP_BYTES 12
  10965. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10966. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10967. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10968. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10969. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10970. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10971. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10972. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10973. #define HTT_RX_PEER_UNMAP_BYTES 4
  10974. /**
  10975. * @brief target -> host rx peer map V2 message definition
  10976. *
  10977. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10978. *
  10979. * @details
  10980. * The following diagram shows the format of the rx peer map v2 message sent
  10981. * from the target to the host. This layout assumes the target operates
  10982. * as little-endian.
  10983. *
  10984. * This message always contains a SW peer ID. The main purpose of the
  10985. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10986. * with, so that the host can use that peer ID to determine which peer
  10987. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10988. * other purposes, such as identifying during tx completions which peer
  10989. * the tx frames in question were transmitted to.
  10990. *
  10991. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10992. * is used during rx --> tx frame forwarding to identify which peer the
  10993. * frame needs to be forwarded to (i.e. the peer assocated with the
  10994. * Destination MAC Address within the packet), and particularly which vdev
  10995. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10996. * This DA-based peer ID that is provided for certain rx frames
  10997. * (the rx frames that need to be re-transmitted as tx frames)
  10998. * is the ID that the HW uses for referring to the peer in question,
  10999. * rather than the peer ID that the SW+FW use to refer to the peer.
  11000. *
  11001. * The HW peer id here is the same meaning as AST_INDEX_0.
  11002. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11003. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11004. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11005. * AST is valid.
  11006. *
  11007. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11008. * |-------------------------------------------------------------------------|
  11009. * | SW peer ID | VDEV ID | msg type |
  11010. * |-------------------------------------------------------------------------|
  11011. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11012. * |-------------------------------------------------------------------------|
  11013. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11014. * |-------------------------------------------------------------------------|
  11015. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11016. * |-------------------------------------------------------------------------|
  11017. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11018. * |-------------------------------------------------------------------------|
  11019. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11020. * |-------------------------------------------------------------------------|
  11021. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11022. * |-------------------------------------------------------------------------|
  11023. * | Reserved_2 |
  11024. * |-------------------------------------------------------------------------|
  11025. * Where:
  11026. * NH = Next Hop
  11027. * ASTVM = AST valid mask
  11028. * OA = on-chip AST valid bit
  11029. * ASTFM = AST flow mask
  11030. *
  11031. * The following field definitions describe the format of the rx peer map v2
  11032. * messages sent from the target to the host.
  11033. * - MSG_TYPE
  11034. * Bits 7:0
  11035. * Purpose: identifies this as an rx peer map v2 message
  11036. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11037. * - VDEV_ID
  11038. * Bits 15:8
  11039. * Purpose: Indicates which virtual device the peer is associated with.
  11040. * Value: vdev ID (used in the host to look up the vdev object)
  11041. * - SW_PEER_ID
  11042. * Bits 31:16
  11043. * Purpose: The peer ID (index) that WAL is allocating
  11044. * Value: (rx) peer ID
  11045. * - MAC_ADDR_L32
  11046. * Bits 31:0
  11047. * Purpose: Identifies which peer node the peer ID is for.
  11048. * Value: lower 4 bytes of peer node's MAC address
  11049. * - MAC_ADDR_U16
  11050. * Bits 15:0
  11051. * Purpose: Identifies which peer node the peer ID is for.
  11052. * Value: upper 2 bytes of peer node's MAC address
  11053. * - HW_PEER_ID / AST_INDEX_0
  11054. * Bits 31:16
  11055. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11056. * address, so for rx frames marked for rx --> tx forwarding, the
  11057. * host can determine from the HW peer ID provided as meta-data with
  11058. * the rx frame which peer the frame is supposed to be forwarded to.
  11059. * Value: ID used by the MAC HW to identify the peer
  11060. * - AST_HASH_VALUE
  11061. * Bits 15:0
  11062. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11063. * override feature.
  11064. * - NEXT_HOP
  11065. * Bit 16
  11066. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11067. * (Wireless Distribution System).
  11068. * - AST_VALID_MASK
  11069. * Bits 19:17
  11070. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11071. * - ONCHIP_AST_VALID_FLAG
  11072. * Bit 20
  11073. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11074. * is valid.
  11075. * - AST_INDEX_1
  11076. * Bits 15:0
  11077. * Purpose: indicate the second AST index for this peer
  11078. * - AST_0_FLOW_MASK
  11079. * Bits 19:16
  11080. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11081. * - AST_1_FLOW_MASK
  11082. * Bits 23:20
  11083. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11084. * - AST_2_FLOW_MASK
  11085. * Bits 27:24
  11086. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11087. * - AST_3_FLOW_MASK
  11088. * Bits 31:28
  11089. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11090. * - AST_INDEX_2
  11091. * Bits 15:0
  11092. * Purpose: indicate the third AST index for this peer
  11093. * - TID_VALID_HI_PRI
  11094. * Bits 23:16
  11095. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11096. * - TID_VALID_LOW_PRI
  11097. * Bits 31:24
  11098. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11099. * - AST_INDEX_3
  11100. * Bits 15:0
  11101. * Purpose: indicate the fourth AST index for this peer
  11102. * - ONCHIP_AST_IDX / RESERVED
  11103. * Bits 31:16
  11104. * Purpose: This field is valid only when split AST feature is enabled.
  11105. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11106. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11107. * address, this ast_idx is used for LMAC modules for RXPCU.
  11108. * Value: ID used by the LMAC HW to identify the peer
  11109. */
  11110. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11111. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11112. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11113. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11114. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11115. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11116. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11117. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11118. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11119. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11120. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11121. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11122. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11123. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11124. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11125. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11126. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11127. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11128. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11129. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11130. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11131. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11132. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11133. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11134. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11135. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11136. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11137. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11138. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11139. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11140. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11141. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11142. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11143. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11144. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11145. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11146. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11147. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11148. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11149. do { \
  11150. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11151. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11152. } while (0)
  11153. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11154. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11155. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11156. do { \
  11157. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11158. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11159. } while (0)
  11160. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11161. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11162. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11163. do { \
  11164. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11165. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11166. } while (0)
  11167. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11168. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11169. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11170. do { \
  11171. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11172. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11173. } while (0)
  11174. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11175. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11176. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11177. do { \
  11178. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11179. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11180. } while (0)
  11181. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11182. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11183. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11184. do { \
  11185. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11186. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11187. } while (0)
  11188. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11189. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11190. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11191. do { \
  11192. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11193. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11194. } while (0)
  11195. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11196. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11197. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11198. do { \
  11199. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11200. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11201. } while (0)
  11202. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11203. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11204. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11205. do { \
  11206. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11207. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11208. } while (0)
  11209. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11210. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11211. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11212. do { \
  11213. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11214. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11215. } while (0)
  11216. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11217. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11218. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11219. do { \
  11220. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11221. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11222. } while (0)
  11223. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11224. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11225. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11226. do { \
  11227. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11228. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11229. } while (0)
  11230. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11231. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11232. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11233. do { \
  11234. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11235. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11236. } while (0)
  11237. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11238. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11239. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11240. do { \
  11241. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11242. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11243. } while (0)
  11244. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11245. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11246. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11247. do { \
  11248. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11249. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11250. } while (0)
  11251. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11252. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11253. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11254. do { \
  11255. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11256. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11257. } while (0)
  11258. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11259. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11260. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11261. do { \
  11262. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11263. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11264. } while (0)
  11265. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11266. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11267. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11268. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11269. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11270. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11271. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11272. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11273. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11274. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11275. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11276. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11277. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11278. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11279. /**
  11280. * @brief target -> host rx peer map V3 message definition
  11281. *
  11282. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11283. *
  11284. * @details
  11285. * The following diagram shows the format of the rx peer map v3 message sent
  11286. * from the target to the host.
  11287. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11288. * This layout assumes the target operates as little-endian.
  11289. *
  11290. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11291. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11292. * | SW peer ID | VDEV ID | msg type |
  11293. * |-----------------+--------------------+-----------------+-----------------|
  11294. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11295. * |-----------------+--------------------+-----------------+-----------------|
  11296. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11297. * |-----------------+--------+-----------+-----------------+-----------------|
  11298. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11299. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11300. * | (8bits) | | (4bits) | |
  11301. * |-----------------+--------+--+--+--+--------------------------------------|
  11302. * | RESERVED |E |O | | |
  11303. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11304. * | |V |V | | |
  11305. * |-----------------+--------------------+-----------------------------------|
  11306. * | HTT_MSDU_IDX_ | RESERVED | |
  11307. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11308. * | (8bits) | | |
  11309. * |-----------------+--------------------+-----------------------------------|
  11310. * | Reserved_2 |
  11311. * |--------------------------------------------------------------------------|
  11312. * | Reserved_3 |
  11313. * |--------------------------------------------------------------------------|
  11314. *
  11315. * Where:
  11316. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11317. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11318. * NH = Next Hop
  11319. * The following field definitions describe the format of the rx peer map v3
  11320. * messages sent from the target to the host.
  11321. * - MSG_TYPE
  11322. * Bits 7:0
  11323. * Purpose: identifies this as a peer map v3 message
  11324. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11325. * - VDEV_ID
  11326. * Bits 15:8
  11327. * Purpose: Indicates which virtual device the peer is associated with.
  11328. * - SW_PEER_ID
  11329. * Bits 31:16
  11330. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11331. * - MAC_ADDR_L32
  11332. * Bits 31:0
  11333. * Purpose: Identifies which peer node the peer ID is for.
  11334. * Value: lower 4 bytes of peer node's MAC address
  11335. * - MAC_ADDR_U16
  11336. * Bits 15:0
  11337. * Purpose: Identifies which peer node the peer ID is for.
  11338. * Value: upper 2 bytes of peer node's MAC address
  11339. * - MULTICAST_SW_PEER_ID
  11340. * Bits 31:16
  11341. * Purpose: The multicast peer ID (index)
  11342. * Value: set to HTT_INVALID_PEER if not valid
  11343. * - HW_PEER_ID / AST_INDEX
  11344. * Bits 15:0
  11345. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11346. * address, so for rx frames marked for rx --> tx forwarding, the
  11347. * host can determine from the HW peer ID provided as meta-data with
  11348. * the rx frame which peer the frame is supposed to be forwarded to.
  11349. * - CACHE_SET_NUM
  11350. * Bits 19:16
  11351. * Purpose: Cache Set Number for AST_INDEX
  11352. * Cache set number that should be used to cache the index based
  11353. * search results, for address and flow search.
  11354. * This value should be equal to LSB 4 bits of the hash value
  11355. * of match data, in case of search index points to an entry which
  11356. * may be used in content based search also. The value can be
  11357. * anything when the entry pointed by search index will not be
  11358. * used for content based search.
  11359. * - HTT_MSDU_IDX_VALID_MASK
  11360. * Bits 31:24
  11361. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11362. * - ONCHIP_AST_IDX / RESERVED
  11363. * Bits 15:0
  11364. * Purpose: This field is valid only when split AST feature is enabled.
  11365. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11366. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11367. * address, this ast_idx is used for LMAC modules for RXPCU.
  11368. * - NEXT_HOP
  11369. * Bits 16
  11370. * Purpose: Flag indicates next_hop AST entry used for WDS
  11371. * (Wireless Distribution System).
  11372. * - ONCHIP_AST_VALID
  11373. * Bits 17
  11374. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11375. * - EXT_AST_VALID
  11376. * Bits 18
  11377. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11378. * - EXT_AST_INDEX
  11379. * Bits 15:0
  11380. * Purpose: This field describes Extended AST index
  11381. * Valid if EXT_AST_VALID flag set
  11382. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11383. * Bits 31:24
  11384. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11385. */
  11386. /* dword 0 */
  11387. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11388. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11389. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11390. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11391. /* dword 1 */
  11392. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11393. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11394. /* dword 2 */
  11395. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11396. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11397. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11398. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11399. /* dword 3 */
  11400. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11401. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11402. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11403. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11404. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11405. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11406. /* dword 4 */
  11407. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11408. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11409. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11410. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11411. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11412. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11413. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11414. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11415. /* dword 5 */
  11416. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11417. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11418. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11419. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11420. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11421. do { \
  11422. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11423. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11424. } while (0)
  11425. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11426. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11427. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11428. do { \
  11429. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11430. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11431. } while (0)
  11432. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11433. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11434. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11435. do { \
  11436. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11437. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11438. } while (0)
  11439. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11440. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11441. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11442. do { \
  11443. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11444. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11445. } while (0)
  11446. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11447. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11448. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11449. do { \
  11450. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11451. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11452. } while (0)
  11453. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11454. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11455. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11456. do { \
  11457. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11458. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11459. } while (0)
  11460. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11461. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11462. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11463. do { \
  11464. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11465. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11466. } while (0)
  11467. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11468. (((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)
  11469. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11470. do { \
  11471. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11472. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11473. } while (0)
  11474. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11475. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11476. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11477. do { \
  11478. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11479. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11480. } while (0)
  11481. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11482. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11483. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11484. do { \
  11485. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11486. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11487. } while (0)
  11488. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11489. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11490. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11491. do { \
  11492. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11493. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11494. } while (0)
  11495. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11496. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11497. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11498. do { \
  11499. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11500. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11501. } while (0)
  11502. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11503. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11504. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11505. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11506. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11507. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11508. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11509. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11510. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11511. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11512. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11513. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11514. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11515. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11516. /**
  11517. * @brief target -> host rx peer unmap V2 message definition
  11518. *
  11519. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11520. *
  11521. * The following diagram shows the format of the rx peer unmap message sent
  11522. * from the target to the host.
  11523. *
  11524. * |31 24|23 16|15 8|7 0|
  11525. * |-----------------------------------------------------------------------|
  11526. * | SW peer ID | VDEV ID | msg type |
  11527. * |-----------------------------------------------------------------------|
  11528. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11529. * |-----------------------------------------------------------------------|
  11530. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11531. * |-----------------------------------------------------------------------|
  11532. * | Peer Delete Duration |
  11533. * |-----------------------------------------------------------------------|
  11534. * | Reserved_0 | WDS Free Count |
  11535. * |-----------------------------------------------------------------------|
  11536. * | Reserved_1 |
  11537. * |-----------------------------------------------------------------------|
  11538. * | Reserved_2 |
  11539. * |-----------------------------------------------------------------------|
  11540. *
  11541. *
  11542. * The following field definitions describe the format of the rx peer unmap
  11543. * messages sent from the target to the host.
  11544. * - MSG_TYPE
  11545. * Bits 7:0
  11546. * Purpose: identifies this as an rx peer unmap v2 message
  11547. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11548. * - VDEV_ID
  11549. * Bits 15:8
  11550. * Purpose: Indicates which virtual device the peer is associated
  11551. * with.
  11552. * Value: vdev ID (used in the host to look up the vdev object)
  11553. * - SW_PEER_ID
  11554. * Bits 31:16
  11555. * Purpose: The peer ID (index) that WAL is freeing
  11556. * Value: (rx) peer ID
  11557. * - MAC_ADDR_L32
  11558. * Bits 31:0
  11559. * Purpose: Identifies which peer node the peer ID is for.
  11560. * Value: lower 4 bytes of peer node's MAC address
  11561. * - MAC_ADDR_U16
  11562. * Bits 15:0
  11563. * Purpose: Identifies which peer node the peer ID is for.
  11564. * Value: upper 2 bytes of peer node's MAC address
  11565. * - NEXT_HOP
  11566. * Bits 16
  11567. * Purpose: Bit indicates next_hop AST entry used for WDS
  11568. * (Wireless Distribution System).
  11569. * - PEER_DELETE_DURATION
  11570. * Bits 31:0
  11571. * Purpose: Time taken to delete peer, in msec,
  11572. * Used for monitoring / debugging PEER delete response delay
  11573. * - PEER_WDS_FREE_COUNT
  11574. * Bits 15:0
  11575. * Purpose: Count of WDS entries deleted associated to peer deleted
  11576. */
  11577. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11578. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11579. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11580. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11581. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11582. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11583. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11584. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11585. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11586. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11587. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11588. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11589. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11590. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11591. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11592. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11593. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11594. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11595. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11596. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11597. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11598. do { \
  11599. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11600. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11601. } while (0)
  11602. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11603. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11604. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11605. do { \
  11606. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11607. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11608. } while (0)
  11609. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11610. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11611. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11612. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11613. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11614. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11615. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11616. /**
  11617. * @brief target -> host rx peer mlo map message definition
  11618. *
  11619. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11620. *
  11621. * @details
  11622. * The following diagram shows the format of the rx mlo peer map message sent
  11623. * from the target to the host. This layout assumes the target operates
  11624. * as little-endian.
  11625. *
  11626. * MCC:
  11627. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11628. *
  11629. * WIN:
  11630. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11631. * It will be sent on the Assoc Link.
  11632. *
  11633. * This message always contains a MLO peer ID. The main purpose of the
  11634. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11635. * with, so that the host can use that MLO peer ID to determine which peer
  11636. * transmitted the rx frame.
  11637. *
  11638. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11639. * |-------------------------------------------------------------------------|
  11640. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11641. * |-------------------------------------------------------------------------|
  11642. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11643. * |-------------------------------------------------------------------------|
  11644. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11645. * |-------------------------------------------------------------------------|
  11646. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11647. * |-------------------------------------------------------------------------|
  11648. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11649. * |-------------------------------------------------------------------------|
  11650. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11651. * |-------------------------------------------------------------------------|
  11652. * |RSVD |
  11653. * |-------------------------------------------------------------------------|
  11654. * |RSVD |
  11655. * |-------------------------------------------------------------------------|
  11656. * | htt_tlv_hdr_t |
  11657. * |-------------------------------------------------------------------------|
  11658. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11659. * |-------------------------------------------------------------------------|
  11660. * | htt_tlv_hdr_t |
  11661. * |-------------------------------------------------------------------------|
  11662. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11663. * |-------------------------------------------------------------------------|
  11664. * | htt_tlv_hdr_t |
  11665. * |-------------------------------------------------------------------------|
  11666. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11667. * |-------------------------------------------------------------------------|
  11668. *
  11669. * Where:
  11670. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11671. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11672. * V (valid) - 1 Bit Bit17
  11673. * CHIPID - 3 Bits
  11674. * TIDMASK - 8 Bits
  11675. * CACHE_SET_NUM - 8 Bits
  11676. *
  11677. * The following field definitions describe the format of the rx MLO peer map
  11678. * messages sent from the target to the host.
  11679. * - MSG_TYPE
  11680. * Bits 7:0
  11681. * Purpose: identifies this as an rx mlo peer map message
  11682. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11683. *
  11684. * - MLO_PEER_ID
  11685. * Bits 23:8
  11686. * Purpose: The MLO peer ID (index).
  11687. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11688. * Value: MLO peer ID
  11689. *
  11690. * - NUMLINK
  11691. * Bits: 26:24 (3Bits)
  11692. * Purpose: Indicate the max number of logical links supported per client.
  11693. * Value: number of logical links
  11694. *
  11695. * - PRC
  11696. * Bits: 29:27 (3Bits)
  11697. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11698. * if there is migration of the primary chip.
  11699. * Value: Primary REO CHIPID
  11700. *
  11701. * - MAC_ADDR_L32
  11702. * Bits 31:0
  11703. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11704. * Value: lower 4 bytes of peer node's MAC address
  11705. *
  11706. * - MAC_ADDR_U16
  11707. * Bits 15:0
  11708. * Purpose: Identifies which peer node the peer ID is for.
  11709. * Value: upper 2 bytes of peer node's MAC address
  11710. *
  11711. * - PRIMARY_TCL_AST_IDX
  11712. * Bits 15:0
  11713. * Purpose: Primary TCL AST index for this peer.
  11714. *
  11715. * - V
  11716. * 1 Bit Position 16
  11717. * Purpose: If the ast idx is valid.
  11718. *
  11719. * - CHIPID
  11720. * Bits 19:17
  11721. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11722. *
  11723. * - TIDMASK
  11724. * Bits 27:20
  11725. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11726. *
  11727. * - CACHE_SET_NUM
  11728. * Bits 31:28
  11729. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11730. * Cache set number that should be used to cache the index based
  11731. * search results, for address and flow search.
  11732. * This value should be equal to LSB four bits of the hash value
  11733. * of match data, in case of search index points to an entry which
  11734. * may be used in content based search also. The value can be
  11735. * anything when the entry pointed by search index will not be
  11736. * used for content based search.
  11737. *
  11738. * - htt_tlv_hdr_t
  11739. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11740. *
  11741. * Bits 11:0
  11742. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11743. *
  11744. * Bits 23:12
  11745. * Purpose: Length, Length of the value that follows the header
  11746. *
  11747. * Bits 31:28
  11748. * Purpose: Reserved.
  11749. *
  11750. *
  11751. * - SW_PEER_ID
  11752. * Bits 15:0
  11753. * Purpose: The peer ID (index) that WAL is allocating
  11754. * Value: (rx) peer ID
  11755. *
  11756. * - VDEV_ID
  11757. * Bits 23:16
  11758. * Purpose: Indicates which virtual device the peer is associated with.
  11759. * Value: vdev ID (used in the host to look up the vdev object)
  11760. *
  11761. * - CHIPID
  11762. * Bits 26:24
  11763. * Purpose: Indicates which Chip id the peer is associated with.
  11764. * Value: chip ID (Provided by Host as part of QMI exchange)
  11765. */
  11766. typedef enum {
  11767. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11768. } MLO_PEER_MAP_TLV_TAG_ID;
  11769. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11770. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11771. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11772. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11773. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11774. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11775. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11776. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11777. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11778. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11779. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11780. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11781. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11782. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11783. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11784. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11785. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11786. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11787. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11788. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11789. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11790. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11791. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11792. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11793. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11794. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11795. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11796. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11797. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11798. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11799. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11800. do { \
  11801. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11802. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11803. } while (0)
  11804. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11805. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11806. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11807. do { \
  11808. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11809. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11810. } while (0)
  11811. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11812. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11813. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11814. do { \
  11815. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11816. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11817. } while (0)
  11818. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11819. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11820. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11821. do { \
  11822. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11823. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11824. } while (0)
  11825. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11826. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11827. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11828. do { \
  11829. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11830. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11831. } while (0)
  11832. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11833. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11834. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11835. do { \
  11836. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11837. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11838. } while (0)
  11839. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11840. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11841. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11842. do { \
  11843. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11844. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11845. } while (0)
  11846. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11847. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11848. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11849. do { \
  11850. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11851. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11852. } while (0)
  11853. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11854. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11855. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11856. do { \
  11857. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11858. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11859. } while (0)
  11860. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11861. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11862. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11863. do { \
  11864. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11865. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11866. } while (0)
  11867. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11868. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11869. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11870. do { \
  11871. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11872. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11873. } while (0)
  11874. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11875. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11876. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11877. do { \
  11878. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11879. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11880. } while (0)
  11881. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11882. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11883. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11884. do { \
  11885. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11886. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11887. } while (0)
  11888. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11889. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11890. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11891. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11892. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11893. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11894. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11895. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11896. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11897. *
  11898. * The following diagram shows the format of the rx mlo peer unmap message sent
  11899. * from the target to the host.
  11900. *
  11901. * |31 24|23 16|15 8|7 0|
  11902. * |-----------------------------------------------------------------------|
  11903. * | RSVD_24_31 | MLO peer ID | msg type |
  11904. * |-----------------------------------------------------------------------|
  11905. */
  11906. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11907. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11908. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11909. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11910. /**
  11911. * @brief target -> host message specifying security parameters
  11912. *
  11913. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11914. *
  11915. * @details
  11916. * The following diagram shows the format of the security specification
  11917. * message sent from the target to the host.
  11918. * This security specification message tells the host whether a PN check is
  11919. * necessary on rx data frames, and if so, how large the PN counter is.
  11920. * This message also tells the host about the security processing to apply
  11921. * to defragmented rx frames - specifically, whether a Message Integrity
  11922. * Check is required, and the Michael key to use.
  11923. *
  11924. * |31 24|23 16|15|14 8|7 0|
  11925. * |-----------------------------------------------------------------------|
  11926. * | peer ID | U| security type | msg type |
  11927. * |-----------------------------------------------------------------------|
  11928. * | Michael Key K0 |
  11929. * |-----------------------------------------------------------------------|
  11930. * | Michael Key K1 |
  11931. * |-----------------------------------------------------------------------|
  11932. * | WAPI RSC Low0 |
  11933. * |-----------------------------------------------------------------------|
  11934. * | WAPI RSC Low1 |
  11935. * |-----------------------------------------------------------------------|
  11936. * | WAPI RSC Hi0 |
  11937. * |-----------------------------------------------------------------------|
  11938. * | WAPI RSC Hi1 |
  11939. * |-----------------------------------------------------------------------|
  11940. *
  11941. * The following field definitions describe the format of the security
  11942. * indication message sent from the target to the host.
  11943. * - MSG_TYPE
  11944. * Bits 7:0
  11945. * Purpose: identifies this as a security specification message
  11946. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11947. * - SEC_TYPE
  11948. * Bits 14:8
  11949. * Purpose: specifies which type of security applies to the peer
  11950. * Value: htt_sec_type enum value
  11951. * - UNICAST
  11952. * Bit 15
  11953. * Purpose: whether this security is applied to unicast or multicast data
  11954. * Value: 1 -> unicast, 0 -> multicast
  11955. * - PEER_ID
  11956. * Bits 31:16
  11957. * Purpose: The ID number for the peer the security specification is for
  11958. * Value: peer ID
  11959. * - MICHAEL_KEY_K0
  11960. * Bits 31:0
  11961. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11962. * Value: Michael Key K0 (if security type is TKIP)
  11963. * - MICHAEL_KEY_K1
  11964. * Bits 31:0
  11965. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11966. * Value: Michael Key K1 (if security type is TKIP)
  11967. * - WAPI_RSC_LOW0
  11968. * Bits 31:0
  11969. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11970. * Value: WAPI RSC Low0 (if security type is WAPI)
  11971. * - WAPI_RSC_LOW1
  11972. * Bits 31:0
  11973. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11974. * Value: WAPI RSC Low1 (if security type is WAPI)
  11975. * - WAPI_RSC_HI0
  11976. * Bits 31:0
  11977. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11978. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11979. * - WAPI_RSC_HI1
  11980. * Bits 31:0
  11981. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11982. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11983. */
  11984. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11985. #define HTT_SEC_IND_SEC_TYPE_S 8
  11986. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11987. #define HTT_SEC_IND_UNICAST_S 15
  11988. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11989. #define HTT_SEC_IND_PEER_ID_S 16
  11990. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11991. do { \
  11992. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11993. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11994. } while (0)
  11995. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11996. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11997. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11998. do { \
  11999. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12000. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12001. } while (0)
  12002. #define HTT_SEC_IND_UNICAST_GET(word) \
  12003. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12004. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12005. do { \
  12006. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12007. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12008. } while (0)
  12009. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12010. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12011. #define HTT_SEC_IND_BYTES 28
  12012. /**
  12013. * @brief target -> host rx ADDBA / DELBA message definitions
  12014. *
  12015. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12016. *
  12017. * @details
  12018. * The following diagram shows the format of the rx ADDBA message sent
  12019. * from the target to the host:
  12020. *
  12021. * |31 20|19 16|15 8|7 0|
  12022. * |---------------------------------------------------------------------|
  12023. * | peer ID | TID | window size | msg type |
  12024. * |---------------------------------------------------------------------|
  12025. *
  12026. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12027. *
  12028. * The following diagram shows the format of the rx DELBA message sent
  12029. * from the target to the host:
  12030. *
  12031. * |31 20|19 16|15 10|9 8|7 0|
  12032. * |---------------------------------------------------------------------|
  12033. * | peer ID | TID | window size | IR| msg type |
  12034. * |---------------------------------------------------------------------|
  12035. *
  12036. * The following field definitions describe the format of the rx ADDBA
  12037. * and DELBA messages sent from the target to the host.
  12038. * - MSG_TYPE
  12039. * Bits 7:0
  12040. * Purpose: identifies this as an rx ADDBA or DELBA message
  12041. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12042. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12043. * - IR (initiator / recipient)
  12044. * Bits 9:8 (DELBA only)
  12045. * Purpose: specify whether the DELBA handshake was initiated by the
  12046. * local STA/AP, or by the peer STA/AP
  12047. * Value:
  12048. * 0 - unspecified
  12049. * 1 - initiator (a.k.a. originator)
  12050. * 2 - recipient (a.k.a. responder)
  12051. * 3 - unused / reserved
  12052. * - WIN_SIZE
  12053. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12054. * Purpose: Specifies the length of the block ack window (max = 64).
  12055. * Value:
  12056. * block ack window length specified by the received ADDBA/DELBA
  12057. * management message.
  12058. * - TID
  12059. * Bits 19:16
  12060. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12061. * Value:
  12062. * TID specified by the received ADDBA or DELBA management message.
  12063. * - PEER_ID
  12064. * Bits 31:20
  12065. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12066. * Value:
  12067. * ID (hash value) used by the host for fast, direct lookup of
  12068. * host SW peer info, including rx reorder states.
  12069. */
  12070. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12071. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12072. #define HTT_RX_ADDBA_TID_M 0xf0000
  12073. #define HTT_RX_ADDBA_TID_S 16
  12074. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12075. #define HTT_RX_ADDBA_PEER_ID_S 20
  12076. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12077. do { \
  12078. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12079. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12080. } while (0)
  12081. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12082. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12083. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12084. do { \
  12085. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12086. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12087. } while (0)
  12088. #define HTT_RX_ADDBA_TID_GET(word) \
  12089. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12090. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12093. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12094. } while (0)
  12095. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12096. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12097. #define HTT_RX_ADDBA_BYTES 4
  12098. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12099. #define HTT_RX_DELBA_INITIATOR_S 8
  12100. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12101. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12102. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12103. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12104. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12105. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12106. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12107. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12108. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12109. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12110. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12111. do { \
  12112. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12113. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12114. } while (0)
  12115. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12116. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12117. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12118. do { \
  12119. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12120. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12121. } while (0)
  12122. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12123. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12124. #define HTT_RX_DELBA_BYTES 4
  12125. /**
  12126. * @brief target -> host rx ADDBA / DELBA message definitions
  12127. *
  12128. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12129. *
  12130. * @details
  12131. * The following diagram shows the format of the rx ADDBA extn message sent
  12132. * from the target to the host:
  12133. *
  12134. * |31 20|19 16|15 13|12 8|7 0|
  12135. * |---------------------------------------------------------------------|
  12136. * | peer ID | TID | reserved | msg type |
  12137. * |---------------------------------------------------------------------|
  12138. * | reserved | window size |
  12139. * |---------------------------------------------------------------------|
  12140. *
  12141. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12142. *
  12143. * The following diagram shows the format of the rx DELBA message sent
  12144. * from the target to the host:
  12145. *
  12146. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12147. * |---------------------------------------------------------------------|
  12148. * | peer ID | TID | reserved | IR| msg type |
  12149. * |---------------------------------------------------------------------|
  12150. * | reserved | window size |
  12151. * |---------------------------------------------------------------------|
  12152. *
  12153. * The following field definitions describe the format of the rx ADDBA
  12154. * and DELBA messages sent from the target to the host.
  12155. * - MSG_TYPE
  12156. * Bits 7:0
  12157. * Purpose: identifies this as an rx ADDBA or DELBA message
  12158. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12159. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12160. * - IR (initiator / recipient)
  12161. * Bits 9:8 (DELBA only)
  12162. * Purpose: specify whether the DELBA handshake was initiated by the
  12163. * local STA/AP, or by the peer STA/AP
  12164. * Value:
  12165. * 0 - unspecified
  12166. * 1 - initiator (a.k.a. originator)
  12167. * 2 - recipient (a.k.a. responder)
  12168. * 3 - unused / reserved
  12169. * Value:
  12170. * block ack window length specified by the received ADDBA/DELBA
  12171. * management message.
  12172. * - TID
  12173. * Bits 19:16
  12174. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12175. * Value:
  12176. * TID specified by the received ADDBA or DELBA management message.
  12177. * - PEER_ID
  12178. * Bits 31:20
  12179. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12180. * Value:
  12181. * ID (hash value) used by the host for fast, direct lookup of
  12182. * host SW peer info, including rx reorder states.
  12183. * == DWORD 1
  12184. * - WIN_SIZE
  12185. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12186. * Purpose: Specifies the length of the block ack window (max = 8191).
  12187. */
  12188. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12189. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12190. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12191. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12192. /*--- Dword 0 ---*/
  12193. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12194. do { \
  12195. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12196. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12197. } while (0)
  12198. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12199. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12200. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12201. do { \
  12202. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12203. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12204. } while (0)
  12205. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12206. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12207. /*--- Dword 1 ---*/
  12208. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12209. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12210. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12211. do { \
  12212. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12213. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12214. } while (0)
  12215. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12216. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12217. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12218. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12219. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12220. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12221. #define HTT_RX_DELBA_EXTN_TID_S 16
  12222. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12223. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12224. /*--- Dword 0 ---*/
  12225. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12226. do { \
  12227. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12228. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12229. } while (0)
  12230. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12231. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12232. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12233. do { \
  12234. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12235. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12236. } while (0)
  12237. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12238. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12239. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12240. do { \
  12241. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12242. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12243. } while (0)
  12244. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12245. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12246. /*--- Dword 1 ---*/
  12247. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12248. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12249. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12250. do { \
  12251. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12252. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12253. } while (0)
  12254. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12255. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12256. #define HTT_RX_DELBA_EXTN_BYTES 8
  12257. /**
  12258. * @brief tx queue group information element definition
  12259. *
  12260. * @details
  12261. * The following diagram shows the format of the tx queue group
  12262. * information element, which can be included in target --> host
  12263. * messages to specify the number of tx "credits" (tx descriptors
  12264. * for LL, or tx buffers for HL) available to a particular group
  12265. * of host-side tx queues, and which host-side tx queues belong to
  12266. * the group.
  12267. *
  12268. * |31|30 24|23 16|15|14|13 0|
  12269. * |------------------------------------------------------------------------|
  12270. * | X| reserved | tx queue grp ID | A| S| credit count |
  12271. * |------------------------------------------------------------------------|
  12272. * | vdev ID mask | AC mask |
  12273. * |------------------------------------------------------------------------|
  12274. *
  12275. * The following definitions describe the fields within the tx queue group
  12276. * information element:
  12277. * - credit_count
  12278. * Bits 13:1
  12279. * Purpose: specify how many tx credits are available to the tx queue group
  12280. * Value: An absolute or relative, positive or negative credit value
  12281. * The 'A' bit specifies whether the value is absolute or relative.
  12282. * The 'S' bit specifies whether the value is positive or negative.
  12283. * A negative value can only be relative, not absolute.
  12284. * An absolute value replaces any prior credit value the host has for
  12285. * the tx queue group in question.
  12286. * A relative value is added to the prior credit value the host has for
  12287. * the tx queue group in question.
  12288. * - sign
  12289. * Bit 14
  12290. * Purpose: specify whether the credit count is positive or negative
  12291. * Value: 0 -> positive, 1 -> negative
  12292. * - absolute
  12293. * Bit 15
  12294. * Purpose: specify whether the credit count is absolute or relative
  12295. * Value: 0 -> relative, 1 -> absolute
  12296. * - txq_group_id
  12297. * Bits 23:16
  12298. * Purpose: indicate which tx queue group's credit and/or membership are
  12299. * being specified
  12300. * Value: 0 to max_tx_queue_groups-1
  12301. * - reserved
  12302. * Bits 30:16
  12303. * Value: 0x0
  12304. * - eXtension
  12305. * Bit 31
  12306. * Purpose: specify whether another tx queue group info element follows
  12307. * Value: 0 -> no more tx queue group information elements
  12308. * 1 -> another tx queue group information element immediately follows
  12309. * - ac_mask
  12310. * Bits 15:0
  12311. * Purpose: specify which Access Categories belong to the tx queue group
  12312. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12313. * the tx queue group.
  12314. * The AC bit-mask values are obtained by left-shifting by the
  12315. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12316. * - vdev_id_mask
  12317. * Bits 31:16
  12318. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12319. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12320. * belong to the tx queue group.
  12321. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12322. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12323. */
  12324. PREPACK struct htt_txq_group {
  12325. A_UINT32
  12326. credit_count: 14,
  12327. sign: 1,
  12328. absolute: 1,
  12329. tx_queue_group_id: 8,
  12330. reserved0: 7,
  12331. extension: 1;
  12332. A_UINT32
  12333. ac_mask: 16,
  12334. vdev_id_mask: 16;
  12335. } POSTPACK;
  12336. /* first word */
  12337. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12338. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12339. #define HTT_TXQ_GROUP_SIGN_S 14
  12340. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12341. #define HTT_TXQ_GROUP_ABS_S 15
  12342. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12343. #define HTT_TXQ_GROUP_ID_S 16
  12344. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12345. #define HTT_TXQ_GROUP_EXT_S 31
  12346. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12347. /* second word */
  12348. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12349. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12350. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12351. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12352. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12353. do { \
  12354. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12355. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12356. } while (0)
  12357. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12358. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12359. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12360. do { \
  12361. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12362. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12363. } while (0)
  12364. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12365. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12366. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12367. do { \
  12368. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12369. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12370. } while (0)
  12371. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12372. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12373. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12374. do { \
  12375. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12376. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12377. } while (0)
  12378. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12379. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12380. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12381. do { \
  12382. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12383. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12384. } while (0)
  12385. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12386. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12387. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12388. do { \
  12389. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12390. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12391. } while (0)
  12392. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12393. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12394. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12395. do { \
  12396. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12397. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12398. } while (0)
  12399. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12400. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12401. /**
  12402. * @brief target -> host TX completion indication message definition
  12403. *
  12404. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12405. *
  12406. * @details
  12407. * The following diagram shows the format of the TX completion indication sent
  12408. * from the target to the host
  12409. *
  12410. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12411. * |-------------------------------------------------------------------|
  12412. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12413. * |-------------------------------------------------------------------|
  12414. * payload:| MSDU1 ID | MSDU0 ID |
  12415. * |-------------------------------------------------------------------|
  12416. * : MSDU3 ID | MSDU2 ID :
  12417. * |-------------------------------------------------------------------|
  12418. * | struct htt_tx_compl_ind_append_retries |
  12419. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12420. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12421. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12422. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12423. * |-------------------------------------------------------------------|
  12424. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12425. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12426. * | MSDU0 tx_tsf64_low |
  12427. * |-------------------------------------------------------------------|
  12428. * | MSDU0 tx_tsf64_high |
  12429. * |-------------------------------------------------------------------|
  12430. * | MSDU1 tx_tsf64_low |
  12431. * |-------------------------------------------------------------------|
  12432. * | MSDU1 tx_tsf64_high |
  12433. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12434. * | phy_timestamp |
  12435. * |-------------------------------------------------------------------|
  12436. * | rate specs (see below) |
  12437. * |-------------------------------------------------------------------|
  12438. * | seqctrl | framectrl |
  12439. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12440. * Where:
  12441. * A0 = append (a.k.a. append0)
  12442. * A1 = append1
  12443. * TP = MSDU tx power presence
  12444. * A2 = append2
  12445. * A3 = append3
  12446. * A4 = append4
  12447. *
  12448. * The following field definitions describe the format of the TX completion
  12449. * indication sent from the target to the host
  12450. * Header fields:
  12451. * - msg_type
  12452. * Bits 7:0
  12453. * Purpose: identifies this as HTT TX completion indication
  12454. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12455. * - status
  12456. * Bits 10:8
  12457. * Purpose: the TX completion status of payload fragmentations descriptors
  12458. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12459. * - tid
  12460. * Bits 14:11
  12461. * Purpose: the tid associated with those fragmentation descriptors. It is
  12462. * valid or not, depending on the tid_invalid bit.
  12463. * Value: 0 to 15
  12464. * - tid_invalid
  12465. * Bits 15:15
  12466. * Purpose: this bit indicates whether the tid field is valid or not
  12467. * Value: 0 indicates valid; 1 indicates invalid
  12468. * - num
  12469. * Bits 23:16
  12470. * Purpose: the number of payload in this indication
  12471. * Value: 1 to 255
  12472. * - append (a.k.a. append0)
  12473. * Bits 24:24
  12474. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12475. * the number of tx retries for one MSDU at the end of this message
  12476. * Value: 0 indicates no appending; 1 indicates appending
  12477. * - append1
  12478. * Bits 25:25
  12479. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12480. * contains the timestamp info for each TX msdu id in payload.
  12481. * The order of the timestamps matches the order of the MSDU IDs.
  12482. * Note that a big-endian host needs to account for the reordering
  12483. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12484. * conversion) when determining which tx timestamp corresponds to
  12485. * which MSDU ID.
  12486. * Value: 0 indicates no appending; 1 indicates appending
  12487. * - msdu_tx_power_presence
  12488. * Bits 26:26
  12489. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12490. * for each MSDU referenced by the TX_COMPL_IND message.
  12491. * The tx power is reported in 0.5 dBm units.
  12492. * The order of the per-MSDU tx power reports matches the order
  12493. * of the MSDU IDs.
  12494. * Note that a big-endian host needs to account for the reordering
  12495. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12496. * conversion) when determining which Tx Power corresponds to
  12497. * which MSDU ID.
  12498. * Value: 0 indicates MSDU tx power reports are not appended,
  12499. * 1 indicates MSDU tx power reports are appended
  12500. * - append2
  12501. * Bits 27:27
  12502. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12503. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12504. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12505. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12506. * for each MSDU, for convenience.
  12507. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12508. * this append2 bit is set).
  12509. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12510. * dB above the noise floor.
  12511. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12512. * 1 indicates MSDU ACK RSSI values are appended.
  12513. * - append3
  12514. * Bits 28:28
  12515. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12516. * contains the tx tsf info based on wlan global TSF for
  12517. * each TX msdu id in payload.
  12518. * The order of the tx tsf matches the order of the MSDU IDs.
  12519. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12520. * values to indicate the the lower 32 bits and higher 32 bits of
  12521. * the tx tsf.
  12522. * The tx_tsf64 here represents the time MSDU was acked and the
  12523. * tx_tsf64 has microseconds units.
  12524. * Value: 0 indicates no appending; 1 indicates appending
  12525. * - append4
  12526. * Bits 29:29
  12527. * Purpose: Indicate whether data frame control fields and fields required
  12528. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12529. * message. The order of the this message matches the order of
  12530. * the MSDU IDs.
  12531. * Value: 0 indicates frame control fields and fields required for
  12532. * radio tap header values are not appended,
  12533. * 1 indicates frame control fields and fields required for
  12534. * radio tap header values are appended.
  12535. * Payload fields:
  12536. * - hmsdu_id
  12537. * Bits 15:0
  12538. * Purpose: this ID is used to track the Tx buffer in host
  12539. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12540. */
  12541. PREPACK struct htt_tx_data_hdr_information {
  12542. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12543. A_UINT32 /* word 1 */
  12544. /* preamble:
  12545. * 0-OFDM,
  12546. * 1-CCk,
  12547. * 2-HT,
  12548. * 3-VHT
  12549. */
  12550. preamble: 2, /* [1:0] */
  12551. /* mcs:
  12552. * In case of HT preamble interpret
  12553. * MCS along with NSS.
  12554. * Valid values for HT are 0 to 7.
  12555. * HT mcs 0 with NSS 2 is mcs 8.
  12556. * Valid values for VHT are 0 to 9.
  12557. */
  12558. mcs: 4, /* [5:2] */
  12559. /* rate:
  12560. * This is applicable only for
  12561. * CCK and OFDM preamble type
  12562. * rate 0: OFDM 48 Mbps,
  12563. * 1: OFDM 24 Mbps,
  12564. * 2: OFDM 12 Mbps
  12565. * 3: OFDM 6 Mbps
  12566. * 4: OFDM 54 Mbps
  12567. * 5: OFDM 36 Mbps
  12568. * 6: OFDM 18 Mbps
  12569. * 7: OFDM 9 Mbps
  12570. * rate 0: CCK 11 Mbps Long
  12571. * 1: CCK 5.5 Mbps Long
  12572. * 2: CCK 2 Mbps Long
  12573. * 3: CCK 1 Mbps Long
  12574. * 4: CCK 11 Mbps Short
  12575. * 5: CCK 5.5 Mbps Short
  12576. * 6: CCK 2 Mbps Short
  12577. */
  12578. rate : 3, /* [ 8: 6] */
  12579. rssi : 8, /* [16: 9] units=dBm */
  12580. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12581. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12582. stbc : 1, /* [22] */
  12583. sgi : 1, /* [23] */
  12584. ldpc : 1, /* [24] */
  12585. beamformed: 1, /* [25] */
  12586. /* tx_retry_cnt:
  12587. * Indicates retry count of data tx frames provided by the host.
  12588. */
  12589. tx_retry_cnt: 6; /* [31:26] */
  12590. A_UINT32 /* word 2 */
  12591. framectrl:16, /* [15: 0] */
  12592. seqno:16; /* [31:16] */
  12593. } POSTPACK;
  12594. #define HTT_TX_COMPL_IND_STATUS_S 8
  12595. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12596. #define HTT_TX_COMPL_IND_TID_S 11
  12597. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12598. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12599. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12600. #define HTT_TX_COMPL_IND_NUM_S 16
  12601. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12602. #define HTT_TX_COMPL_IND_APPEND_S 24
  12603. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12604. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12605. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12606. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12607. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12608. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12609. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12610. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12611. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12612. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12613. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12614. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12615. do { \
  12616. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12617. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12618. } while (0)
  12619. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12620. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12621. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12622. do { \
  12623. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12624. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12625. } while (0)
  12626. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12627. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12628. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12629. do { \
  12630. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12631. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12632. } while (0)
  12633. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12634. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12635. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12636. do { \
  12637. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12638. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12639. } while (0)
  12640. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12641. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12642. HTT_TX_COMPL_IND_TID_INV_S)
  12643. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12644. do { \
  12645. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12646. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12647. } while (0)
  12648. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12649. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12650. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12651. do { \
  12652. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12653. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12654. } while (0)
  12655. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12656. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12657. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12658. do { \
  12659. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12660. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12661. } while (0)
  12662. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12663. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12664. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12665. do { \
  12666. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12667. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12668. } while (0)
  12669. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12670. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12671. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12672. do { \
  12673. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12674. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12675. } while (0)
  12676. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12677. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12678. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12679. do { \
  12680. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12681. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12682. } while (0)
  12683. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12684. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12685. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12686. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12687. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12688. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12689. #define HTT_TX_COMPL_IND_STAT_OK 0
  12690. /* DISCARD:
  12691. * current meaning:
  12692. * MSDUs were queued for transmission but filtered by HW or SW
  12693. * without any over the air attempts
  12694. * legacy meaning (HL Rome):
  12695. * MSDUs were discarded by the target FW without any over the air
  12696. * attempts due to lack of space
  12697. */
  12698. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12699. /* NO_ACK:
  12700. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12701. */
  12702. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12703. /* POSTPONE:
  12704. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12705. * be downloaded again later (in the appropriate order), when they are
  12706. * deliverable.
  12707. */
  12708. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12709. /*
  12710. * The PEER_DEL tx completion status is used for HL cases
  12711. * where the peer the frame is for has been deleted.
  12712. * The host has already discarded its copy of the frame, but
  12713. * it still needs the tx completion to restore its credit.
  12714. */
  12715. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12716. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12717. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12718. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12719. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12720. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12721. PREPACK struct htt_tx_compl_ind_base {
  12722. A_UINT32 hdr;
  12723. A_UINT16 payload[1/*or more*/];
  12724. } POSTPACK;
  12725. PREPACK struct htt_tx_compl_ind_append_retries {
  12726. A_UINT16 msdu_id;
  12727. A_UINT8 tx_retries;
  12728. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12729. 0: this is the last append_retries struct */
  12730. } POSTPACK;
  12731. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12732. A_UINT32 timestamp[1/*or more*/];
  12733. } POSTPACK;
  12734. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12735. A_UINT32 tx_tsf64_low;
  12736. A_UINT32 tx_tsf64_high;
  12737. } POSTPACK;
  12738. /* htt_tx_data_hdr_information payload extension fields: */
  12739. /* DWORD zero */
  12740. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12741. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12742. /* DWORD one */
  12743. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12744. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12745. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12746. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12747. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12748. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12749. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12750. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12751. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12752. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12753. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12754. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12755. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12756. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12757. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12758. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12759. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12760. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12761. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12762. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12763. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12764. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12765. /* DWORD two */
  12766. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12767. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12768. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12769. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12770. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12771. do { \
  12772. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12773. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12774. } while (0)
  12775. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12776. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12777. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12778. do { \
  12779. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12780. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12781. } while (0)
  12782. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12783. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12784. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12785. do { \
  12786. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12787. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12788. } while (0)
  12789. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12790. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12791. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12792. do { \
  12793. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12794. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12795. } while (0)
  12796. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12797. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12798. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12799. do { \
  12800. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12801. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12802. } while (0)
  12803. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12804. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12805. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12806. do { \
  12807. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12808. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12809. } while (0)
  12810. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12811. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12812. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12813. do { \
  12814. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12815. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12816. } while (0)
  12817. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12818. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12819. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12820. do { \
  12821. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12822. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12823. } while (0)
  12824. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12825. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12826. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12827. do { \
  12828. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12829. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12830. } while (0)
  12831. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12832. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12833. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12834. do { \
  12835. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12836. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12837. } while (0)
  12838. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12839. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12840. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12841. do { \
  12842. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12843. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12844. } while (0)
  12845. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12846. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12847. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12848. do { \
  12849. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12850. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12851. } while (0)
  12852. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12853. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12854. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12855. do { \
  12856. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12857. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12858. } while (0)
  12859. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12860. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12861. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12862. do { \
  12863. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12864. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12865. } while (0)
  12866. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12867. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12868. /**
  12869. * @brief target -> host rate-control update indication message
  12870. *
  12871. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12872. *
  12873. * @details
  12874. * The following diagram shows the format of the RC Update message
  12875. * sent from the target to the host, while processing the tx-completion
  12876. * of a transmitted PPDU.
  12877. *
  12878. * |31 24|23 16|15 8|7 0|
  12879. * |-------------------------------------------------------------|
  12880. * | peer ID | vdev ID | msg_type |
  12881. * |-------------------------------------------------------------|
  12882. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12883. * |-------------------------------------------------------------|
  12884. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12885. * |-------------------------------------------------------------|
  12886. * | : |
  12887. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12888. * | : |
  12889. * |-------------------------------------------------------------|
  12890. * | : |
  12891. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12892. * | : |
  12893. * |-------------------------------------------------------------|
  12894. * : :
  12895. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12896. *
  12897. */
  12898. typedef struct {
  12899. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12900. A_UINT32 rate_code_flags;
  12901. A_UINT32 flags; /* Encodes information such as excessive
  12902. retransmission, aggregate, some info
  12903. from .11 frame control,
  12904. STBC, LDPC, (SGI and Tx Chain Mask
  12905. are encoded in ptx_rc->flags field),
  12906. AMPDU truncation (BT/time based etc.),
  12907. RTS/CTS attempt */
  12908. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12909. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12910. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12911. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12912. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12913. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12914. } HTT_RC_TX_DONE_PARAMS;
  12915. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12916. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12917. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12918. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12919. #define HTT_RC_UPDATE_VDEVID_S 8
  12920. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12921. #define HTT_RC_UPDATE_PEERID_S 16
  12922. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12923. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12924. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12925. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12926. do { \
  12927. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12928. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12929. } while (0)
  12930. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12931. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12932. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12933. do { \
  12934. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12935. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12936. } while (0)
  12937. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12938. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12939. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12940. do { \
  12941. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12942. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12943. } while (0)
  12944. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12945. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12946. /**
  12947. * @brief target -> host rx fragment indication message definition
  12948. *
  12949. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12950. *
  12951. * @details
  12952. * The following field definitions describe the format of the rx fragment
  12953. * indication message sent from the target to the host.
  12954. * The rx fragment indication message shares the format of the
  12955. * rx indication message, but not all fields from the rx indication message
  12956. * are relevant to the rx fragment indication message.
  12957. *
  12958. *
  12959. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12960. * |-----------+-------------------+---------------------+-------------|
  12961. * | peer ID | |FV| ext TID | msg type |
  12962. * |-------------------------------------------------------------------|
  12963. * | | flush | flush |
  12964. * | | end | start |
  12965. * | | seq num | seq num |
  12966. * |-------------------------------------------------------------------|
  12967. * | reserved | FW rx desc bytes |
  12968. * |-------------------------------------------------------------------|
  12969. * | | FW MSDU Rx |
  12970. * | | desc B0 |
  12971. * |-------------------------------------------------------------------|
  12972. * Header fields:
  12973. * - MSG_TYPE
  12974. * Bits 7:0
  12975. * Purpose: identifies this as an rx fragment indication message
  12976. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12977. * - EXT_TID
  12978. * Bits 12:8
  12979. * Purpose: identify the traffic ID of the rx data, including
  12980. * special "extended" TID values for multicast, broadcast, and
  12981. * non-QoS data frames
  12982. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12983. * - FLUSH_VALID (FV)
  12984. * Bit 13
  12985. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12986. * is valid
  12987. * Value:
  12988. * 1 -> flush IE is valid and needs to be processed
  12989. * 0 -> flush IE is not valid and should be ignored
  12990. * - PEER_ID
  12991. * Bits 31:16
  12992. * Purpose: Identify, by ID, which peer sent the rx data
  12993. * Value: ID of the peer who sent the rx data
  12994. * - FLUSH_SEQ_NUM_START
  12995. * Bits 5:0
  12996. * Purpose: Indicate the start of a series of MPDUs to flush
  12997. * Not all MPDUs within this series are necessarily valid - the host
  12998. * must check each sequence number within this range to see if the
  12999. * corresponding MPDU is actually present.
  13000. * This field is only valid if the FV bit is set.
  13001. * Value:
  13002. * The sequence number for the first MPDUs to check to flush.
  13003. * The sequence number is masked by 0x3f.
  13004. * - FLUSH_SEQ_NUM_END
  13005. * Bits 11:6
  13006. * Purpose: Indicate the end of a series of MPDUs to flush
  13007. * Value:
  13008. * The sequence number one larger than the sequence number of the
  13009. * last MPDU to check to flush.
  13010. * The sequence number is masked by 0x3f.
  13011. * Not all MPDUs within this series are necessarily valid - the host
  13012. * must check each sequence number within this range to see if the
  13013. * corresponding MPDU is actually present.
  13014. * This field is only valid if the FV bit is set.
  13015. * Rx descriptor fields:
  13016. * - FW_RX_DESC_BYTES
  13017. * Bits 15:0
  13018. * Purpose: Indicate how many bytes in the Rx indication are used for
  13019. * FW Rx descriptors
  13020. * Value: 1
  13021. */
  13022. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13023. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13024. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13025. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13026. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13027. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13028. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13029. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13030. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13031. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13032. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13033. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13034. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13035. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13036. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13037. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13038. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13039. #define HTT_RX_FRAG_IND_BYTES \
  13040. (4 /* msg hdr */ + \
  13041. 4 /* flush spec */ + \
  13042. 4 /* (unused) FW rx desc bytes spec */ + \
  13043. 4 /* FW rx desc */)
  13044. /**
  13045. * @brief target -> host test message definition
  13046. *
  13047. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13048. *
  13049. * @details
  13050. * The following field definitions describe the format of the test
  13051. * message sent from the target to the host.
  13052. * The message consists of a 4-octet header, followed by a variable
  13053. * number of 32-bit integer values, followed by a variable number
  13054. * of 8-bit character values.
  13055. *
  13056. * |31 16|15 8|7 0|
  13057. * |-----------------------------------------------------------|
  13058. * | num chars | num ints | msg type |
  13059. * |-----------------------------------------------------------|
  13060. * | int 0 |
  13061. * |-----------------------------------------------------------|
  13062. * | int 1 |
  13063. * |-----------------------------------------------------------|
  13064. * | ... |
  13065. * |-----------------------------------------------------------|
  13066. * | char 3 | char 2 | char 1 | char 0 |
  13067. * |-----------------------------------------------------------|
  13068. * | | | ... | char 4 |
  13069. * |-----------------------------------------------------------|
  13070. * - MSG_TYPE
  13071. * Bits 7:0
  13072. * Purpose: identifies this as a test message
  13073. * Value: HTT_MSG_TYPE_TEST
  13074. * - NUM_INTS
  13075. * Bits 15:8
  13076. * Purpose: indicate how many 32-bit integers follow the message header
  13077. * - NUM_CHARS
  13078. * Bits 31:16
  13079. * Purpose: indicate how many 8-bit charaters follow the series of integers
  13080. */
  13081. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13082. #define HTT_RX_TEST_NUM_INTS_S 8
  13083. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13084. #define HTT_RX_TEST_NUM_CHARS_S 16
  13085. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13086. do { \
  13087. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13088. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13089. } while (0)
  13090. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13091. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13092. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13093. do { \
  13094. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13095. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13096. } while (0)
  13097. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13098. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13099. /**
  13100. * @brief target -> host packet log message
  13101. *
  13102. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13103. *
  13104. * @details
  13105. * The following field definitions describe the format of the packet log
  13106. * message sent from the target to the host.
  13107. * The message consists of a 4-octet header,followed by a variable number
  13108. * of 32-bit character values.
  13109. *
  13110. * |31 16|15 12|11 10|9 8|7 0|
  13111. * |------------------------------------------------------------------|
  13112. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13113. * |------------------------------------------------------------------|
  13114. * | payload |
  13115. * |------------------------------------------------------------------|
  13116. * - MSG_TYPE
  13117. * Bits 7:0
  13118. * Purpose: identifies this as a pktlog message
  13119. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13120. * - mac_id
  13121. * Bits 9:8
  13122. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13123. * Value: 0-3
  13124. * - pdev_id
  13125. * Bits 11:10
  13126. * Purpose: pdev_id
  13127. * Value: 0-3
  13128. * 0 (for rings at SOC level),
  13129. * 1/2/3 PDEV -> 0/1/2
  13130. * - payload_size
  13131. * Bits 31:16
  13132. * Purpose: explicitly specify the payload size
  13133. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13134. */
  13135. PREPACK struct htt_pktlog_msg {
  13136. A_UINT32 header;
  13137. A_UINT32 payload[1/* or more */];
  13138. } POSTPACK;
  13139. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13140. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13141. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13142. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13143. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13144. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13145. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13146. do { \
  13147. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13148. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13149. } while (0)
  13150. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13151. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13152. HTT_T2H_PKTLOG_MAC_ID_S)
  13153. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13154. do { \
  13155. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13156. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13157. } while (0)
  13158. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13159. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13160. HTT_T2H_PKTLOG_PDEV_ID_S)
  13161. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13162. do { \
  13163. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13164. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13165. } while (0)
  13166. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13167. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13168. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13169. /*
  13170. * Rx reorder statistics
  13171. * NB: all the fields must be defined in 4 octets size.
  13172. */
  13173. struct rx_reorder_stats {
  13174. /* Non QoS MPDUs received */
  13175. A_UINT32 deliver_non_qos;
  13176. /* MPDUs received in-order */
  13177. A_UINT32 deliver_in_order;
  13178. /* Flush due to reorder timer expired */
  13179. A_UINT32 deliver_flush_timeout;
  13180. /* Flush due to move out of window */
  13181. A_UINT32 deliver_flush_oow;
  13182. /* Flush due to DELBA */
  13183. A_UINT32 deliver_flush_delba;
  13184. /* MPDUs dropped due to FCS error */
  13185. A_UINT32 fcs_error;
  13186. /* MPDUs dropped due to monitor mode non-data packet */
  13187. A_UINT32 mgmt_ctrl;
  13188. /* Unicast-data MPDUs dropped due to invalid peer */
  13189. A_UINT32 invalid_peer;
  13190. /* MPDUs dropped due to duplication (non aggregation) */
  13191. A_UINT32 dup_non_aggr;
  13192. /* MPDUs dropped due to processed before */
  13193. A_UINT32 dup_past;
  13194. /* MPDUs dropped due to duplicate in reorder queue */
  13195. A_UINT32 dup_in_reorder;
  13196. /* Reorder timeout happened */
  13197. A_UINT32 reorder_timeout;
  13198. /* invalid bar ssn */
  13199. A_UINT32 invalid_bar_ssn;
  13200. /* reorder reset due to bar ssn */
  13201. A_UINT32 ssn_reset;
  13202. /* Flush due to delete peer */
  13203. A_UINT32 deliver_flush_delpeer;
  13204. /* Flush due to offload*/
  13205. A_UINT32 deliver_flush_offload;
  13206. /* Flush due to out of buffer*/
  13207. A_UINT32 deliver_flush_oob;
  13208. /* MPDUs dropped due to PN check fail */
  13209. A_UINT32 pn_fail;
  13210. /* MPDUs dropped due to unable to allocate memory */
  13211. A_UINT32 store_fail;
  13212. /* Number of times the tid pool alloc succeeded */
  13213. A_UINT32 tid_pool_alloc_succ;
  13214. /* Number of times the MPDU pool alloc succeeded */
  13215. A_UINT32 mpdu_pool_alloc_succ;
  13216. /* Number of times the MSDU pool alloc succeeded */
  13217. A_UINT32 msdu_pool_alloc_succ;
  13218. /* Number of times the tid pool alloc failed */
  13219. A_UINT32 tid_pool_alloc_fail;
  13220. /* Number of times the MPDU pool alloc failed */
  13221. A_UINT32 mpdu_pool_alloc_fail;
  13222. /* Number of times the MSDU pool alloc failed */
  13223. A_UINT32 msdu_pool_alloc_fail;
  13224. /* Number of times the tid pool freed */
  13225. A_UINT32 tid_pool_free;
  13226. /* Number of times the MPDU pool freed */
  13227. A_UINT32 mpdu_pool_free;
  13228. /* Number of times the MSDU pool freed */
  13229. A_UINT32 msdu_pool_free;
  13230. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13231. A_UINT32 msdu_queued;
  13232. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13233. A_UINT32 msdu_recycled;
  13234. /* Number of MPDUs with invalid peer but A2 found in AST */
  13235. A_UINT32 invalid_peer_a2_in_ast;
  13236. /* Number of MPDUs with invalid peer but A3 found in AST */
  13237. A_UINT32 invalid_peer_a3_in_ast;
  13238. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13239. A_UINT32 invalid_peer_bmc_mpdus;
  13240. /* Number of MSDUs with err attention word */
  13241. A_UINT32 rxdesc_err_att;
  13242. /* Number of MSDUs with flag of peer_idx_invalid */
  13243. A_UINT32 rxdesc_err_peer_idx_inv;
  13244. /* Number of MSDUs with flag of peer_idx_timeout */
  13245. A_UINT32 rxdesc_err_peer_idx_to;
  13246. /* Number of MSDUs with flag of overflow */
  13247. A_UINT32 rxdesc_err_ov;
  13248. /* Number of MSDUs with flag of msdu_length_err */
  13249. A_UINT32 rxdesc_err_msdu_len;
  13250. /* Number of MSDUs with flag of mpdu_length_err */
  13251. A_UINT32 rxdesc_err_mpdu_len;
  13252. /* Number of MSDUs with flag of tkip_mic_err */
  13253. A_UINT32 rxdesc_err_tkip_mic;
  13254. /* Number of MSDUs with flag of decrypt_err */
  13255. A_UINT32 rxdesc_err_decrypt;
  13256. /* Number of MSDUs with flag of fcs_err */
  13257. A_UINT32 rxdesc_err_fcs;
  13258. /* Number of Unicast (bc_mc bit is not set in attention word)
  13259. * frames with invalid peer handler
  13260. */
  13261. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13262. /* Number of unicast frame directly (direct bit is set in attention word)
  13263. * to DUT with invalid peer handler
  13264. */
  13265. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13266. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13267. * frames with invalid peer handler
  13268. */
  13269. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13270. /* Number of MSDUs dropped due to no first MSDU flag */
  13271. A_UINT32 rxdesc_no_1st_msdu;
  13272. /* Number of MSDUs droped due to ring overflow */
  13273. A_UINT32 msdu_drop_ring_ov;
  13274. /* Number of MSDUs dropped due to FC mismatch */
  13275. A_UINT32 msdu_drop_fc_mismatch;
  13276. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13277. A_UINT32 msdu_drop_mgmt_remote_ring;
  13278. /* Number of MSDUs dropped due to errors not reported in attention word */
  13279. A_UINT32 msdu_drop_misc;
  13280. /* Number of MSDUs go to offload before reorder */
  13281. A_UINT32 offload_msdu_wal;
  13282. /* Number of data frame dropped by offload after reorder */
  13283. A_UINT32 offload_msdu_reorder;
  13284. /* Number of MPDUs with sequence number in the past and within the BA window */
  13285. A_UINT32 dup_past_within_window;
  13286. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13287. A_UINT32 dup_past_outside_window;
  13288. /* Number of MSDUs with decrypt/MIC error */
  13289. A_UINT32 rxdesc_err_decrypt_mic;
  13290. /* Number of data MSDUs received on both local and remote rings */
  13291. A_UINT32 data_msdus_on_both_rings;
  13292. /* MPDUs never filled */
  13293. A_UINT32 holes_not_filled;
  13294. };
  13295. /*
  13296. * Rx Remote buffer statistics
  13297. * NB: all the fields must be defined in 4 octets size.
  13298. */
  13299. struct rx_remote_buffer_mgmt_stats {
  13300. /* Total number of MSDUs reaped for Rx processing */
  13301. A_UINT32 remote_reaped;
  13302. /* MSDUs recycled within firmware */
  13303. A_UINT32 remote_recycled;
  13304. /* MSDUs stored by Data Rx */
  13305. A_UINT32 data_rx_msdus_stored;
  13306. /* Number of HTT indications from WAL Rx MSDU */
  13307. A_UINT32 wal_rx_ind;
  13308. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13309. A_UINT32 wal_rx_ind_unconsumed;
  13310. /* Number of HTT indications from Data Rx MSDU */
  13311. A_UINT32 data_rx_ind;
  13312. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13313. A_UINT32 data_rx_ind_unconsumed;
  13314. /* Number of HTT indications from ATHBUF */
  13315. A_UINT32 athbuf_rx_ind;
  13316. /* Number of remote buffers requested for refill */
  13317. A_UINT32 refill_buf_req;
  13318. /* Number of remote buffers filled by the host */
  13319. A_UINT32 refill_buf_rsp;
  13320. /* Number of times MAC hw_index = f/w write_index */
  13321. A_INT32 mac_no_bufs;
  13322. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13323. A_INT32 fw_indices_equal;
  13324. /* Number of times f/w finds no buffers to post */
  13325. A_INT32 host_no_bufs;
  13326. };
  13327. /*
  13328. * TXBF MU/SU packets and NDPA statistics
  13329. * NB: all the fields must be defined in 4 octets size.
  13330. */
  13331. struct rx_txbf_musu_ndpa_pkts_stats {
  13332. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13333. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13334. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13335. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13336. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13337. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13338. };
  13339. /*
  13340. * htt_dbg_stats_status -
  13341. * present - The requested stats have been delivered in full.
  13342. * This indicates that either the stats information was contained
  13343. * in its entirety within this message, or else this message
  13344. * completes the delivery of the requested stats info that was
  13345. * partially delivered through earlier STATS_CONF messages.
  13346. * partial - The requested stats have been delivered in part.
  13347. * One or more subsequent STATS_CONF messages with the same
  13348. * cookie value will be sent to deliver the remainder of the
  13349. * information.
  13350. * error - The requested stats could not be delivered, for example due
  13351. * to a shortage of memory to construct a message holding the
  13352. * requested stats.
  13353. * invalid - The requested stat type is either not recognized, or the
  13354. * target is configured to not gather the stats type in question.
  13355. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13356. * series_done - This special value indicates that no further stats info
  13357. * elements are present within a series of stats info elems
  13358. * (within a stats upload confirmation message).
  13359. */
  13360. enum htt_dbg_stats_status {
  13361. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13362. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13363. HTT_DBG_STATS_STATUS_ERROR = 2,
  13364. HTT_DBG_STATS_STATUS_INVALID = 3,
  13365. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13366. };
  13367. /**
  13368. * @brief target -> host statistics upload
  13369. *
  13370. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13371. *
  13372. * @details
  13373. * The following field definitions describe the format of the HTT target
  13374. * to host stats upload confirmation message.
  13375. * The message contains a cookie echoed from the HTT host->target stats
  13376. * upload request, which identifies which request the confirmation is
  13377. * for, and a series of tag-length-value stats information elements.
  13378. * The tag-length header for each stats info element also includes a
  13379. * status field, to indicate whether the request for the stat type in
  13380. * question was fully met, partially met, unable to be met, or invalid
  13381. * (if the stat type in question is disabled in the target).
  13382. * A special value of all 1's in this status field is used to indicate
  13383. * the end of the series of stats info elements.
  13384. *
  13385. *
  13386. * |31 16|15 8|7 5|4 0|
  13387. * |------------------------------------------------------------|
  13388. * | reserved | msg type |
  13389. * |------------------------------------------------------------|
  13390. * | cookie LSBs |
  13391. * |------------------------------------------------------------|
  13392. * | cookie MSBs |
  13393. * |------------------------------------------------------------|
  13394. * | stats entry length | reserved | S |stat type|
  13395. * |------------------------------------------------------------|
  13396. * | |
  13397. * | type-specific stats info |
  13398. * | |
  13399. * |------------------------------------------------------------|
  13400. * | stats entry length | reserved | S |stat type|
  13401. * |------------------------------------------------------------|
  13402. * | |
  13403. * | type-specific stats info |
  13404. * | |
  13405. * |------------------------------------------------------------|
  13406. * | n/a | reserved | 111 | n/a |
  13407. * |------------------------------------------------------------|
  13408. * Header fields:
  13409. * - MSG_TYPE
  13410. * Bits 7:0
  13411. * Purpose: identifies this is a statistics upload confirmation message
  13412. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13413. * - COOKIE_LSBS
  13414. * Bits 31:0
  13415. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13416. * message with its preceding host->target stats request message.
  13417. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13418. * - COOKIE_MSBS
  13419. * Bits 31:0
  13420. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13421. * message with its preceding host->target stats request message.
  13422. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13423. *
  13424. * Stats Information Element tag-length header fields:
  13425. * - STAT_TYPE
  13426. * Bits 4:0
  13427. * Purpose: identifies the type of statistics info held in the
  13428. * following information element
  13429. * Value: htt_dbg_stats_type
  13430. * - STATUS
  13431. * Bits 7:5
  13432. * Purpose: indicate whether the requested stats are present
  13433. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13434. * the completion of the stats entry series
  13435. * - LENGTH
  13436. * Bits 31:16
  13437. * Purpose: indicate the stats information size
  13438. * Value: This field specifies the number of bytes of stats information
  13439. * that follows the element tag-length header.
  13440. * It is expected but not required that this length is a multiple of
  13441. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13442. * subsequent stats entry header will begin on a 4-byte aligned
  13443. * boundary.
  13444. */
  13445. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13446. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13447. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13448. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13449. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13450. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13451. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13452. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13453. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13454. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13455. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13456. do { \
  13457. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13458. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13459. } while (0)
  13460. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13461. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13462. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13463. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13464. do { \
  13465. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13466. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13467. } while (0)
  13468. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13469. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13470. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13471. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13472. do { \
  13473. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13474. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13475. } while (0)
  13476. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13477. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13478. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13479. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13480. #define HTT_MAX_AGGR 64
  13481. #define HTT_HL_MAX_AGGR 18
  13482. /**
  13483. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13484. *
  13485. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13486. *
  13487. * @details
  13488. * The following field definitions describe the format of the HTT host
  13489. * to target frag_desc/msdu_ext bank configuration message.
  13490. * The message contains the based address and the min and max id of the
  13491. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13492. * MSDU_EXT/FRAG_DESC.
  13493. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13494. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13495. * the hardware does the mapping/translation.
  13496. *
  13497. * Total banks that can be configured is configured to 16.
  13498. *
  13499. * This should be called before any TX has be initiated by the HTT
  13500. *
  13501. * |31 16|15 8|7 5|4 0|
  13502. * |------------------------------------------------------------|
  13503. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13504. * |------------------------------------------------------------|
  13505. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13506. #if HTT_PADDR64
  13507. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13508. #endif
  13509. * |------------------------------------------------------------|
  13510. * | ... |
  13511. * |------------------------------------------------------------|
  13512. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13513. #if HTT_PADDR64
  13514. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13515. #endif
  13516. * |------------------------------------------------------------|
  13517. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13518. * |------------------------------------------------------------|
  13519. * | ... |
  13520. * |------------------------------------------------------------|
  13521. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13522. * |------------------------------------------------------------|
  13523. * Header fields:
  13524. * - MSG_TYPE
  13525. * Bits 7:0
  13526. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13527. * for systems with 64-bit format for bus addresses:
  13528. * - BANKx_BASE_ADDRESS_LO
  13529. * Bits 31:0
  13530. * Purpose: Provide a mechanism to specify the base address of the
  13531. * MSDU_EXT bank physical/bus address.
  13532. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13533. * - BANKx_BASE_ADDRESS_HI
  13534. * Bits 31:0
  13535. * Purpose: Provide a mechanism to specify the base address of the
  13536. * MSDU_EXT bank physical/bus address.
  13537. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13538. * for systems with 32-bit format for bus addresses:
  13539. * - BANKx_BASE_ADDRESS
  13540. * Bits 31:0
  13541. * Purpose: Provide a mechanism to specify the base address of the
  13542. * MSDU_EXT bank physical/bus address.
  13543. * Value: MSDU_EXT bank physical / bus address
  13544. * - BANKx_MIN_ID
  13545. * Bits 15:0
  13546. * Purpose: Provide a mechanism to specify the min index that needs to
  13547. * mapped.
  13548. * - BANKx_MAX_ID
  13549. * Bits 31:16
  13550. * Purpose: Provide a mechanism to specify the max index that needs to
  13551. * mapped.
  13552. *
  13553. */
  13554. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13555. * safe value.
  13556. * @note MAX supported banks is 16.
  13557. */
  13558. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13559. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13560. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13561. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13562. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13563. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13564. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13565. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13566. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13567. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13568. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13569. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13570. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13571. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13572. do { \
  13573. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13574. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13575. } while (0)
  13576. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13577. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13578. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13579. do { \
  13580. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13581. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13582. } while (0)
  13583. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13584. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13585. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13586. do { \
  13587. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13588. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13589. } while (0)
  13590. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13591. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13592. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13593. do { \
  13594. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13595. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13596. } while (0)
  13597. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13598. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13599. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13600. do { \
  13601. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13602. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13603. } while (0)
  13604. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13605. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13606. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13607. do { \
  13608. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13609. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13610. } while (0)
  13611. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13612. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13613. /*
  13614. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13615. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13616. * addresses are stored in a XXX-bit field.
  13617. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13618. * htt_tx_frag_desc64_bank_cfg_t structs.
  13619. */
  13620. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13621. _paddr_bits_, \
  13622. _paddr__bank_base_address_) \
  13623. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13624. /** word 0 \
  13625. * msg_type: 8, \
  13626. * pdev_id: 2, \
  13627. * swap: 1, \
  13628. * reserved0: 5, \
  13629. * num_banks: 8, \
  13630. * desc_size: 8; \
  13631. */ \
  13632. A_UINT32 word0; \
  13633. /* \
  13634. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13635. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13636. * the second A_UINT32). \
  13637. */ \
  13638. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13639. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13640. } POSTPACK
  13641. /* define htt_tx_frag_desc32_bank_cfg_t */
  13642. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13643. /* define htt_tx_frag_desc64_bank_cfg_t */
  13644. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13645. /*
  13646. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13647. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13648. */
  13649. #if HTT_PADDR64
  13650. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13651. #else
  13652. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13653. #endif
  13654. /**
  13655. * @brief target -> host HTT TX Credit total count update message definition
  13656. *
  13657. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13658. *
  13659. *|31 16|15|14 9| 8 |7 0 |
  13660. *|---------------------+--+----------+-------+----------|
  13661. *|cur htt credit delta | Q| reserved | sign | msg type |
  13662. *|------------------------------------------------------|
  13663. *
  13664. * Header fields:
  13665. * - MSG_TYPE
  13666. * Bits 7:0
  13667. * Purpose: identifies this as a htt tx credit delta update message
  13668. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13669. * - SIGN
  13670. * Bits 8
  13671. * identifies whether credit delta is positive or negative
  13672. * Value:
  13673. * - 0x0: credit delta is positive, rebalance in some buffers
  13674. * - 0x1: credit delta is negative, rebalance out some buffers
  13675. * - reserved
  13676. * Bits 14:9
  13677. * Value: 0x0
  13678. * - TXQ_GRP
  13679. * Bit 15
  13680. * Purpose: indicates whether any tx queue group information elements
  13681. * are appended to the tx credit update message
  13682. * Value: 0 -> no tx queue group information element is present
  13683. * 1 -> a tx queue group information element immediately follows
  13684. * - DELTA_COUNT
  13685. * Bits 31:16
  13686. * Purpose: Specify current htt credit delta absolute count
  13687. */
  13688. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13689. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13690. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13691. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13692. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13693. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13694. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13695. do { \
  13696. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13697. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13698. } while (0)
  13699. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13700. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13701. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13702. do { \
  13703. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13704. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13705. } while (0)
  13706. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13707. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13708. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13709. do { \
  13710. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13711. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13712. } while (0)
  13713. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13714. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13715. #define HTT_TX_CREDIT_MSG_BYTES 4
  13716. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13717. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13718. /**
  13719. * @brief HTT WDI_IPA Operation Response Message
  13720. *
  13721. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13722. *
  13723. * @details
  13724. * HTT WDI_IPA Operation Response message is sent by target
  13725. * to host confirming suspend or resume operation.
  13726. * |31 24|23 16|15 8|7 0|
  13727. * |----------------+----------------+----------------+----------------|
  13728. * | op_code | Rsvd | msg_type |
  13729. * |-------------------------------------------------------------------|
  13730. * | Rsvd | Response len |
  13731. * |-------------------------------------------------------------------|
  13732. * | |
  13733. * | Response-type specific info |
  13734. * | |
  13735. * | |
  13736. * |-------------------------------------------------------------------|
  13737. * Header fields:
  13738. * - MSG_TYPE
  13739. * Bits 7:0
  13740. * Purpose: Identifies this as WDI_IPA Operation Response message
  13741. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13742. * - OP_CODE
  13743. * Bits 31:16
  13744. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13745. * value: = enum htt_wdi_ipa_op_code
  13746. * - RSP_LEN
  13747. * Bits 16:0
  13748. * Purpose: length for the response-type specific info
  13749. * value: = length in bytes for response-type specific info
  13750. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13751. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13752. */
  13753. PREPACK struct htt_wdi_ipa_op_response_t
  13754. {
  13755. /* DWORD 0: flags and meta-data */
  13756. A_UINT32
  13757. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13758. reserved1: 8,
  13759. op_code: 16;
  13760. A_UINT32
  13761. rsp_len: 16,
  13762. reserved2: 16;
  13763. } POSTPACK;
  13764. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13765. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13766. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13767. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13768. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13769. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13770. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13771. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13772. do { \
  13773. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13774. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13775. } while (0)
  13776. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13777. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13778. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13779. do { \
  13780. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13781. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13782. } while (0)
  13783. enum htt_phy_mode {
  13784. htt_phy_mode_11a = 0,
  13785. htt_phy_mode_11g = 1,
  13786. htt_phy_mode_11b = 2,
  13787. htt_phy_mode_11g_only = 3,
  13788. htt_phy_mode_11na_ht20 = 4,
  13789. htt_phy_mode_11ng_ht20 = 5,
  13790. htt_phy_mode_11na_ht40 = 6,
  13791. htt_phy_mode_11ng_ht40 = 7,
  13792. htt_phy_mode_11ac_vht20 = 8,
  13793. htt_phy_mode_11ac_vht40 = 9,
  13794. htt_phy_mode_11ac_vht80 = 10,
  13795. htt_phy_mode_11ac_vht20_2g = 11,
  13796. htt_phy_mode_11ac_vht40_2g = 12,
  13797. htt_phy_mode_11ac_vht80_2g = 13,
  13798. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13799. htt_phy_mode_11ac_vht160 = 15,
  13800. htt_phy_mode_max,
  13801. };
  13802. /**
  13803. * @brief target -> host HTT channel change indication
  13804. *
  13805. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13806. *
  13807. * @details
  13808. * Specify when a channel change occurs.
  13809. * This allows the host to precisely determine which rx frames arrived
  13810. * on the old channel and which rx frames arrived on the new channel.
  13811. *
  13812. *|31 |7 0 |
  13813. *|-------------------------------------------+----------|
  13814. *| reserved | msg type |
  13815. *|------------------------------------------------------|
  13816. *| primary_chan_center_freq_mhz |
  13817. *|------------------------------------------------------|
  13818. *| contiguous_chan1_center_freq_mhz |
  13819. *|------------------------------------------------------|
  13820. *| contiguous_chan2_center_freq_mhz |
  13821. *|------------------------------------------------------|
  13822. *| phy_mode |
  13823. *|------------------------------------------------------|
  13824. *
  13825. * Header fields:
  13826. * - MSG_TYPE
  13827. * Bits 7:0
  13828. * Purpose: identifies this as a htt channel change indication message
  13829. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13830. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13831. * Bits 31:0
  13832. * Purpose: identify the (center of the) new 20 MHz primary channel
  13833. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13834. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13835. * Bits 31:0
  13836. * Purpose: identify the (center of the) contiguous frequency range
  13837. * comprising the new channel.
  13838. * For example, if the new channel is a 80 MHz channel extending
  13839. * 60 MHz beyond the primary channel, this field would be 30 larger
  13840. * than the primary channel center frequency field.
  13841. * Value: center frequency of the contiguous frequency range comprising
  13842. * the full channel in MHz units
  13843. * (80+80 channels also use the CONTIG_CHAN2 field)
  13844. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13845. * Bits 31:0
  13846. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13847. * within a VHT 80+80 channel.
  13848. * This field is only relevant for VHT 80+80 channels.
  13849. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13850. * channel (arbitrary value for cases besides VHT 80+80)
  13851. * - PHY_MODE
  13852. * Bits 31:0
  13853. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13854. * and band
  13855. * Value: htt_phy_mode enum value
  13856. */
  13857. PREPACK struct htt_chan_change_t
  13858. {
  13859. /* DWORD 0: flags and meta-data */
  13860. A_UINT32
  13861. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13862. reserved1: 24;
  13863. A_UINT32 primary_chan_center_freq_mhz;
  13864. A_UINT32 contig_chan1_center_freq_mhz;
  13865. A_UINT32 contig_chan2_center_freq_mhz;
  13866. A_UINT32 phy_mode;
  13867. } POSTPACK;
  13868. /*
  13869. * Due to historical / backwards-compatibility reasons, maintain the
  13870. * below htt_chan_change_msg struct definition, which needs to be
  13871. * consistent with the above htt_chan_change_t struct definition
  13872. * (aside from the htt_chan_change_t definition including the msg_type
  13873. * dword within the message, and the htt_chan_change_msg only containing
  13874. * the payload of the message that follows the msg_type dword).
  13875. */
  13876. PREPACK struct htt_chan_change_msg {
  13877. A_UINT32 chan_mhz; /* frequency in mhz */
  13878. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13879. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13880. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13881. } POSTPACK;
  13882. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13883. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13884. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13885. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13886. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13887. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13888. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13889. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13890. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13891. do { \
  13892. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13893. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13894. } while (0)
  13895. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13896. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13897. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13898. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13899. do { \
  13900. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13901. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13902. } while (0)
  13903. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13904. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13905. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13906. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13907. do { \
  13908. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13909. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13910. } while (0)
  13911. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13912. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13913. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13914. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13915. do { \
  13916. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13917. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13918. } while (0)
  13919. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13920. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13921. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13922. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13923. /**
  13924. * @brief rx offload packet error message
  13925. *
  13926. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13927. *
  13928. * @details
  13929. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13930. * of target payload like mic err.
  13931. *
  13932. * |31 24|23 16|15 8|7 0|
  13933. * |----------------+----------------+----------------+----------------|
  13934. * | tid | vdev_id | msg_sub_type | msg_type |
  13935. * |-------------------------------------------------------------------|
  13936. * : (sub-type dependent content) :
  13937. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13938. * Header fields:
  13939. * - msg_type
  13940. * Bits 7:0
  13941. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13942. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13943. * - msg_sub_type
  13944. * Bits 15:8
  13945. * Purpose: Identifies which type of rx error is reported by this message
  13946. * value: htt_rx_ofld_pkt_err_type
  13947. * - vdev_id
  13948. * Bits 23:16
  13949. * Purpose: Identifies which vdev received the erroneous rx frame
  13950. * value:
  13951. * - tid
  13952. * Bits 31:24
  13953. * Purpose: Identifies the traffic type of the rx frame
  13954. * value:
  13955. *
  13956. * - The payload fields used if the sub-type == MIC error are shown below.
  13957. * Note - MIC err is per MSDU, while PN is per MPDU.
  13958. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13959. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13960. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13961. * instead of sending separate HTT messages for each wrong MSDU within
  13962. * the MPDU.
  13963. *
  13964. * |31 24|23 16|15 8|7 0|
  13965. * |----------------+----------------+----------------+----------------|
  13966. * | Rsvd | key_id | peer_id |
  13967. * |-------------------------------------------------------------------|
  13968. * | receiver MAC addr 31:0 |
  13969. * |-------------------------------------------------------------------|
  13970. * | Rsvd | receiver MAC addr 47:32 |
  13971. * |-------------------------------------------------------------------|
  13972. * | transmitter MAC addr 31:0 |
  13973. * |-------------------------------------------------------------------|
  13974. * | Rsvd | transmitter MAC addr 47:32 |
  13975. * |-------------------------------------------------------------------|
  13976. * | PN 31:0 |
  13977. * |-------------------------------------------------------------------|
  13978. * | Rsvd | PN 47:32 |
  13979. * |-------------------------------------------------------------------|
  13980. * - peer_id
  13981. * Bits 15:0
  13982. * Purpose: identifies which peer is frame is from
  13983. * value:
  13984. * - key_id
  13985. * Bits 23:16
  13986. * Purpose: identifies key_id of rx frame
  13987. * value:
  13988. * - RA_31_0 (receiver MAC addr 31:0)
  13989. * Bits 31:0
  13990. * Purpose: identifies by MAC address which vdev received the frame
  13991. * value: MAC address lower 4 bytes
  13992. * - RA_47_32 (receiver MAC addr 47:32)
  13993. * Bits 15:0
  13994. * Purpose: identifies by MAC address which vdev received the frame
  13995. * value: MAC address upper 2 bytes
  13996. * - TA_31_0 (transmitter MAC addr 31:0)
  13997. * Bits 31:0
  13998. * Purpose: identifies by MAC address which peer transmitted the frame
  13999. * value: MAC address lower 4 bytes
  14000. * - TA_47_32 (transmitter MAC addr 47:32)
  14001. * Bits 15:0
  14002. * Purpose: identifies by MAC address which peer transmitted the frame
  14003. * value: MAC address upper 2 bytes
  14004. * - PN_31_0
  14005. * Bits 31:0
  14006. * Purpose: Identifies pn of rx frame
  14007. * value: PN lower 4 bytes
  14008. * - PN_47_32
  14009. * Bits 15:0
  14010. * Purpose: Identifies pn of rx frame
  14011. * value:
  14012. * TKIP or CCMP: PN upper 2 bytes
  14013. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14014. */
  14015. enum htt_rx_ofld_pkt_err_type {
  14016. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14017. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14018. };
  14019. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14020. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14021. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14022. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14023. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14024. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14025. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14026. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14027. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14028. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14029. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14030. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14031. do { \
  14032. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14033. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14034. } while (0)
  14035. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14036. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14037. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14038. do { \
  14039. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14040. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14041. } while (0)
  14042. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14043. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14044. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14045. do { \
  14046. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14047. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14048. } while (0)
  14049. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14050. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14051. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14052. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14053. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14054. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14055. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14056. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14057. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14058. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14059. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14060. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14061. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14063. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14064. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14065. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14066. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14067. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14068. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14069. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14071. do { \
  14072. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14073. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14074. } while (0)
  14075. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14076. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14077. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14078. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14079. do { \
  14080. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14081. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14082. } while (0)
  14083. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14084. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14085. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14086. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14087. do { \
  14088. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14089. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14090. } while (0)
  14091. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14092. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14093. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14094. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14095. do { \
  14096. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14097. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14098. } while (0)
  14099. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14100. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14101. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14102. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14103. do { \
  14104. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14105. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14106. } while (0)
  14107. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14108. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14109. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14110. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14111. do { \
  14112. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14113. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14114. } while (0)
  14115. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14116. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14117. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14118. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14119. do { \
  14120. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14121. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14122. } while (0)
  14123. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14124. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14125. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14126. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14127. do { \
  14128. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14129. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14130. } while (0)
  14131. /**
  14132. * @brief target -> host peer rate report message
  14133. *
  14134. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14135. *
  14136. * @details
  14137. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14138. * justified rate of all the peers.
  14139. *
  14140. * |31 24|23 16|15 8|7 0|
  14141. * |----------------+----------------+----------------+----------------|
  14142. * | peer_count | | msg_type |
  14143. * |-------------------------------------------------------------------|
  14144. * : Payload (variant number of peer rate report) :
  14145. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14146. * Header fields:
  14147. * - msg_type
  14148. * Bits 7:0
  14149. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14150. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14151. * - reserved
  14152. * Bits 15:8
  14153. * Purpose:
  14154. * value:
  14155. * - peer_count
  14156. * Bits 31:16
  14157. * Purpose: Specify how many peer rate report elements are present in the payload.
  14158. * value:
  14159. *
  14160. * Payload:
  14161. * There are variant number of peer rate report follow the first 32 bits.
  14162. * The peer rate report is defined as follows.
  14163. *
  14164. * |31 20|19 16|15 0|
  14165. * |-----------------------+---------+---------------------------------|-
  14166. * | reserved | phy | peer_id | \
  14167. * |-------------------------------------------------------------------| -> report #0
  14168. * | rate | /
  14169. * |-----------------------+---------+---------------------------------|-
  14170. * | reserved | phy | peer_id | \
  14171. * |-------------------------------------------------------------------| -> report #1
  14172. * | rate | /
  14173. * |-----------------------+---------+---------------------------------|-
  14174. * | reserved | phy | peer_id | \
  14175. * |-------------------------------------------------------------------| -> report #2
  14176. * | rate | /
  14177. * |-------------------------------------------------------------------|-
  14178. * : :
  14179. * : :
  14180. * : :
  14181. * :-------------------------------------------------------------------:
  14182. *
  14183. * - peer_id
  14184. * Bits 15:0
  14185. * Purpose: identify the peer
  14186. * value:
  14187. * - phy
  14188. * Bits 19:16
  14189. * Purpose: identify which phy is in use
  14190. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14191. * Please see enum htt_peer_report_phy_type for detail.
  14192. * - reserved
  14193. * Bits 31:20
  14194. * Purpose:
  14195. * value:
  14196. * - rate
  14197. * Bits 31:0
  14198. * Purpose: represent the justified rate of the peer specified by peer_id
  14199. * value:
  14200. */
  14201. enum htt_peer_rate_report_phy_type {
  14202. HTT_PEER_RATE_REPORT_11B = 0,
  14203. HTT_PEER_RATE_REPORT_11A_G,
  14204. HTT_PEER_RATE_REPORT_11N,
  14205. HTT_PEER_RATE_REPORT_11AC,
  14206. };
  14207. #define HTT_PEER_RATE_REPORT_SIZE 8
  14208. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14209. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14210. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14211. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14212. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14213. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14214. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14215. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14216. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14217. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14218. do { \
  14219. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14220. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14221. } while (0)
  14222. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14223. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14224. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14225. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14226. do { \
  14227. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14228. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14229. } while (0)
  14230. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14231. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14232. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14233. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14234. do { \
  14235. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14236. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14237. } while (0)
  14238. /**
  14239. * @brief target -> host flow pool map message
  14240. *
  14241. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14242. *
  14243. * @details
  14244. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14245. * a flow of descriptors.
  14246. *
  14247. * This message is in TLV format and indicates the parameters to be setup a
  14248. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14249. * receive descriptors from a specified pool.
  14250. *
  14251. * The message would appear as follows:
  14252. *
  14253. * |31 24|23 16|15 8|7 0|
  14254. * |----------------+----------------+----------------+----------------|
  14255. * header | reserved | num_flows | msg_type |
  14256. * |-------------------------------------------------------------------|
  14257. * | |
  14258. * : payload :
  14259. * | |
  14260. * |-------------------------------------------------------------------|
  14261. *
  14262. * The header field is one DWORD long and is interpreted as follows:
  14263. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14264. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14265. * this message
  14266. * b'16-31 - reserved: These bits are reserved for future use
  14267. *
  14268. * Payload:
  14269. * The payload would contain multiple objects of the following structure. Each
  14270. * object represents a flow.
  14271. *
  14272. * |31 24|23 16|15 8|7 0|
  14273. * |----------------+----------------+----------------+----------------|
  14274. * header | reserved | num_flows | msg_type |
  14275. * |-------------------------------------------------------------------|
  14276. * payload0| flow_type |
  14277. * |-------------------------------------------------------------------|
  14278. * | flow_id |
  14279. * |-------------------------------------------------------------------|
  14280. * | reserved0 | flow_pool_id |
  14281. * |-------------------------------------------------------------------|
  14282. * | reserved1 | flow_pool_size |
  14283. * |-------------------------------------------------------------------|
  14284. * | reserved2 |
  14285. * |-------------------------------------------------------------------|
  14286. * payload1| flow_type |
  14287. * |-------------------------------------------------------------------|
  14288. * | flow_id |
  14289. * |-------------------------------------------------------------------|
  14290. * | reserved0 | flow_pool_id |
  14291. * |-------------------------------------------------------------------|
  14292. * | reserved1 | flow_pool_size |
  14293. * |-------------------------------------------------------------------|
  14294. * | reserved2 |
  14295. * |-------------------------------------------------------------------|
  14296. * | . |
  14297. * | . |
  14298. * | . |
  14299. * |-------------------------------------------------------------------|
  14300. *
  14301. * Each payload is 5 DWORDS long and is interpreted as follows:
  14302. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14303. * this flow is associated. It can be VDEV, peer,
  14304. * or tid (AC). Based on enum htt_flow_type.
  14305. *
  14306. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14307. * object. For flow_type vdev it is set to the
  14308. * vdevid, for peer it is peerid and for tid, it is
  14309. * tid_num.
  14310. *
  14311. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14312. * in the host for this flow
  14313. * b'16:31 - reserved0: This field in reserved for the future. In case
  14314. * we have a hierarchical implementation (HCM) of
  14315. * pools, it can be used to indicate the ID of the
  14316. * parent-pool.
  14317. *
  14318. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14319. * Descriptors for this flow will be
  14320. * allocated from this pool in the host.
  14321. * b'16:31 - reserved1: This field in reserved for the future. In case
  14322. * we have a hierarchical implementation of pools,
  14323. * it can be used to indicate the max number of
  14324. * descriptors in the pool. The b'0:15 can be used
  14325. * to indicate min number of descriptors in the
  14326. * HCM scheme.
  14327. *
  14328. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14329. * we have a hierarchical implementation of pools,
  14330. * b'0:15 can be used to indicate the
  14331. * priority-based borrowing (PBB) threshold of
  14332. * the flow's pool. The b'16:31 are still left
  14333. * reserved.
  14334. */
  14335. enum htt_flow_type {
  14336. FLOW_TYPE_VDEV = 0,
  14337. /* Insert new flow types above this line */
  14338. };
  14339. PREPACK struct htt_flow_pool_map_payload_t {
  14340. A_UINT32 flow_type;
  14341. A_UINT32 flow_id;
  14342. A_UINT32 flow_pool_id:16,
  14343. reserved0:16;
  14344. A_UINT32 flow_pool_size:16,
  14345. reserved1:16;
  14346. A_UINT32 reserved2;
  14347. } POSTPACK;
  14348. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14349. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14350. (sizeof(struct htt_flow_pool_map_payload_t))
  14351. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14352. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14353. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14354. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14355. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14356. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14357. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14358. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14359. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14360. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14361. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14362. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14363. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14364. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14365. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14366. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14367. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14368. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14369. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14370. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14371. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14372. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14373. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14374. do { \
  14375. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14376. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14377. } while (0)
  14378. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14379. do { \
  14380. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14381. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14382. } while (0)
  14383. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14384. do { \
  14385. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14386. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14387. } while (0)
  14388. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14389. do { \
  14390. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14391. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14392. } while (0)
  14393. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14394. do { \
  14395. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14396. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14397. } while (0)
  14398. /**
  14399. * @brief target -> host flow pool unmap message
  14400. *
  14401. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14402. *
  14403. * @details
  14404. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14405. * down a flow of descriptors.
  14406. * This message indicates that for the flow (whose ID is provided) is wanting
  14407. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14408. * pool of descriptors from where descriptors are being allocated for this
  14409. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14410. * be unmapped by the host.
  14411. *
  14412. * The message would appear as follows:
  14413. *
  14414. * |31 24|23 16|15 8|7 0|
  14415. * |----------------+----------------+----------------+----------------|
  14416. * | reserved0 | msg_type |
  14417. * |-------------------------------------------------------------------|
  14418. * | flow_type |
  14419. * |-------------------------------------------------------------------|
  14420. * | flow_id |
  14421. * |-------------------------------------------------------------------|
  14422. * | reserved1 | flow_pool_id |
  14423. * |-------------------------------------------------------------------|
  14424. *
  14425. * The message is interpreted as follows:
  14426. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14427. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14428. * b'8:31 - reserved0: Reserved for future use
  14429. *
  14430. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14431. * this flow is associated. It can be VDEV, peer,
  14432. * or tid (AC). Based on enum htt_flow_type.
  14433. *
  14434. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14435. * object. For flow_type vdev it is set to the
  14436. * vdevid, for peer it is peerid and for tid, it is
  14437. * tid_num.
  14438. *
  14439. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14440. * used in the host for this flow
  14441. * b'16:31 - reserved0: This field in reserved for the future.
  14442. *
  14443. */
  14444. PREPACK struct htt_flow_pool_unmap_t {
  14445. A_UINT32 msg_type:8,
  14446. reserved0:24;
  14447. A_UINT32 flow_type;
  14448. A_UINT32 flow_id;
  14449. A_UINT32 flow_pool_id:16,
  14450. reserved1:16;
  14451. } POSTPACK;
  14452. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14453. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14454. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14455. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14456. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14457. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14458. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14459. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14460. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14461. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14462. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14463. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14464. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14465. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14466. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14467. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14468. do { \
  14469. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14470. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14471. } while (0)
  14472. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14473. do { \
  14474. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14475. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14476. } while (0)
  14477. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14478. do { \
  14479. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14480. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14481. } while (0)
  14482. /**
  14483. * @brief target -> host SRING setup done message
  14484. *
  14485. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14486. *
  14487. * @details
  14488. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14489. * SRNG ring setup is done
  14490. *
  14491. * This message indicates whether the last setup operation is successful.
  14492. * It will be sent to host when host set respose_required bit in
  14493. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14494. * The message would appear as follows:
  14495. *
  14496. * |31 24|23 16|15 8|7 0|
  14497. * |--------------- +----------------+----------------+----------------|
  14498. * | setup_status | ring_id | pdev_id | msg_type |
  14499. * |-------------------------------------------------------------------|
  14500. *
  14501. * The message is interpreted as follows:
  14502. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14503. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14504. * b'8:15 - pdev_id:
  14505. * 0 (for rings at SOC/UMAC level),
  14506. * 1/2/3 mac id (for rings at LMAC level)
  14507. * b'16:23 - ring_id: Identify the ring which is set up
  14508. * More details can be got from enum htt_srng_ring_id
  14509. * b'24:31 - setup_status: Indicate status of setup operation
  14510. * Refer to htt_ring_setup_status
  14511. */
  14512. PREPACK struct htt_sring_setup_done_t {
  14513. A_UINT32 msg_type: 8,
  14514. pdev_id: 8,
  14515. ring_id: 8,
  14516. setup_status: 8;
  14517. } POSTPACK;
  14518. enum htt_ring_setup_status {
  14519. htt_ring_setup_status_ok = 0,
  14520. htt_ring_setup_status_error,
  14521. };
  14522. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14523. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14524. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14525. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14526. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14527. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14528. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14529. do { \
  14530. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14531. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14532. } while (0)
  14533. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14534. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14535. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14536. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14537. HTT_SRING_SETUP_DONE_RING_ID_S)
  14538. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14539. do { \
  14540. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14541. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14542. } while (0)
  14543. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14544. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14545. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14546. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14547. HTT_SRING_SETUP_DONE_STATUS_S)
  14548. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14549. do { \
  14550. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14551. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14552. } while (0)
  14553. /**
  14554. * @brief target -> flow map flow info
  14555. *
  14556. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14557. *
  14558. * @details
  14559. * HTT TX map flow entry with tqm flow pointer
  14560. * Sent from firmware to host to add tqm flow pointer in corresponding
  14561. * flow search entry. Flow metadata is replayed back to host as part of this
  14562. * struct to enable host to find the specific flow search entry
  14563. *
  14564. * The message would appear as follows:
  14565. *
  14566. * |31 28|27 18|17 14|13 8|7 0|
  14567. * |-------+------------------------------------------+----------------|
  14568. * | rsvd0 | fse_hsh_idx | msg_type |
  14569. * |-------------------------------------------------------------------|
  14570. * | rsvd1 | tid | peer_id |
  14571. * |-------------------------------------------------------------------|
  14572. * | tqm_flow_pntr_lo |
  14573. * |-------------------------------------------------------------------|
  14574. * | tqm_flow_pntr_hi |
  14575. * |-------------------------------------------------------------------|
  14576. * | fse_meta_data |
  14577. * |-------------------------------------------------------------------|
  14578. *
  14579. * The message is interpreted as follows:
  14580. *
  14581. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14582. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14583. *
  14584. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14585. * for this flow entry
  14586. *
  14587. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14588. *
  14589. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14590. *
  14591. * dword1 - b'14:17 - tid
  14592. *
  14593. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14594. *
  14595. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14596. *
  14597. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14598. *
  14599. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14600. * given by host
  14601. */
  14602. PREPACK struct htt_tx_map_flow_info {
  14603. A_UINT32
  14604. msg_type: 8,
  14605. fse_hsh_idx: 20,
  14606. rsvd0: 4;
  14607. A_UINT32
  14608. peer_id: 14,
  14609. tid: 4,
  14610. rsvd1: 14;
  14611. A_UINT32 tqm_flow_pntr_lo;
  14612. A_UINT32 tqm_flow_pntr_hi;
  14613. struct htt_tx_flow_metadata fse_meta_data;
  14614. } POSTPACK;
  14615. /* DWORD 0 */
  14616. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14617. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14618. /* DWORD 1 */
  14619. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14620. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14621. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14622. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14623. /* DWORD 0 */
  14624. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14625. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14626. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14627. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14628. do { \
  14629. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14630. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14631. } while (0)
  14632. /* DWORD 1 */
  14633. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14634. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14635. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14636. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14637. do { \
  14638. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14639. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14640. } while (0)
  14641. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14642. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14643. HTT_TX_MAP_FLOW_INFO_TID_S)
  14644. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14645. do { \
  14646. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14647. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14648. } while (0)
  14649. /*
  14650. * htt_dbg_ext_stats_status -
  14651. * present - The requested stats have been delivered in full.
  14652. * This indicates that either the stats information was contained
  14653. * in its entirety within this message, or else this message
  14654. * completes the delivery of the requested stats info that was
  14655. * partially delivered through earlier STATS_CONF messages.
  14656. * partial - The requested stats have been delivered in part.
  14657. * One or more subsequent STATS_CONF messages with the same
  14658. * cookie value will be sent to deliver the remainder of the
  14659. * information.
  14660. * error - The requested stats could not be delivered, for example due
  14661. * to a shortage of memory to construct a message holding the
  14662. * requested stats.
  14663. * invalid - The requested stat type is either not recognized, or the
  14664. * target is configured to not gather the stats type in question.
  14665. */
  14666. enum htt_dbg_ext_stats_status {
  14667. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14668. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14669. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14670. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14671. };
  14672. /**
  14673. * @brief target -> host ppdu stats upload
  14674. *
  14675. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14676. *
  14677. * @details
  14678. * The following field definitions describe the format of the HTT target
  14679. * to host ppdu stats indication message.
  14680. *
  14681. *
  14682. * |31 16|15 12|11 10|9 8|7 0 |
  14683. * |----------------------------------------------------------------------|
  14684. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14685. * |----------------------------------------------------------------------|
  14686. * | ppdu_id |
  14687. * |----------------------------------------------------------------------|
  14688. * | Timestamp in us |
  14689. * |----------------------------------------------------------------------|
  14690. * | reserved |
  14691. * |----------------------------------------------------------------------|
  14692. * | type-specific stats info |
  14693. * | (see htt_ppdu_stats.h) |
  14694. * |----------------------------------------------------------------------|
  14695. * Header fields:
  14696. * - MSG_TYPE
  14697. * Bits 7:0
  14698. * Purpose: Identifies this is a PPDU STATS indication
  14699. * message.
  14700. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14701. * - mac_id
  14702. * Bits 9:8
  14703. * Purpose: mac_id of this ppdu_id
  14704. * Value: 0-3
  14705. * - pdev_id
  14706. * Bits 11:10
  14707. * Purpose: pdev_id of this ppdu_id
  14708. * Value: 0-3
  14709. * 0 (for rings at SOC level),
  14710. * 1/2/3 PDEV -> 0/1/2
  14711. * - payload_size
  14712. * Bits 31:16
  14713. * Purpose: total tlv size
  14714. * Value: payload_size in bytes
  14715. */
  14716. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14717. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14718. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14719. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14720. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14721. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14722. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14723. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14724. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14725. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14726. do { \
  14727. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14728. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14729. } while (0)
  14730. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14731. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14732. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14733. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14734. do { \
  14735. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14736. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14737. } while (0)
  14738. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14739. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14740. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14741. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14742. do { \
  14743. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14744. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14745. } while (0)
  14746. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14747. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14748. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14749. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14750. do { \
  14751. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14752. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14753. } while (0)
  14754. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14755. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14756. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14757. /* htt_t2h_ppdu_stats_ind_hdr_t
  14758. * This struct contains the fields within the header of the
  14759. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14760. * stats info.
  14761. * This struct assumes little-endian layout, and thus is only
  14762. * suitable for use within processors known to be little-endian
  14763. * (such as the target).
  14764. * In contrast, the above macros provide endian-portable methods
  14765. * to get and set the bitfields within this PPDU_STATS_IND header.
  14766. */
  14767. typedef struct {
  14768. A_UINT32 msg_type: 8, /* bits 7:0 */
  14769. mac_id: 2, /* bits 9:8 */
  14770. pdev_id: 2, /* bits 11:10 */
  14771. reserved1: 4, /* bits 15:12 */
  14772. payload_size: 16; /* bits 31:16 */
  14773. A_UINT32 ppdu_id;
  14774. A_UINT32 timestamp_us;
  14775. A_UINT32 reserved2;
  14776. } htt_t2h_ppdu_stats_ind_hdr_t;
  14777. /**
  14778. * @brief target -> host extended statistics upload
  14779. *
  14780. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14781. *
  14782. * @details
  14783. * The following field definitions describe the format of the HTT target
  14784. * to host stats upload confirmation message.
  14785. * The message contains a cookie echoed from the HTT host->target stats
  14786. * upload request, which identifies which request the confirmation is
  14787. * for, and a single stats can span over multiple HTT stats indication
  14788. * due to the HTT message size limitation so every HTT ext stats indication
  14789. * will have tag-length-value stats information elements.
  14790. * The tag-length header for each HTT stats IND message also includes a
  14791. * status field, to indicate whether the request for the stat type in
  14792. * question was fully met, partially met, unable to be met, or invalid
  14793. * (if the stat type in question is disabled in the target).
  14794. * A Done bit 1's indicate the end of the of stats info elements.
  14795. *
  14796. *
  14797. * |31 16|15 12|11|10 8|7 5|4 0|
  14798. * |--------------------------------------------------------------|
  14799. * | reserved | msg type |
  14800. * |--------------------------------------------------------------|
  14801. * | cookie LSBs |
  14802. * |--------------------------------------------------------------|
  14803. * | cookie MSBs |
  14804. * |--------------------------------------------------------------|
  14805. * | stats entry length | rsvd | D| S | stat type |
  14806. * |--------------------------------------------------------------|
  14807. * | type-specific stats info |
  14808. * | (see htt_stats.h) |
  14809. * |--------------------------------------------------------------|
  14810. * Header fields:
  14811. * - MSG_TYPE
  14812. * Bits 7:0
  14813. * Purpose: Identifies this is a extended statistics upload confirmation
  14814. * message.
  14815. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14816. * - COOKIE_LSBS
  14817. * Bits 31:0
  14818. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14819. * message with its preceding host->target stats request message.
  14820. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14821. * - COOKIE_MSBS
  14822. * Bits 31:0
  14823. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14824. * message with its preceding host->target stats request message.
  14825. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14826. *
  14827. * Stats Information Element tag-length header fields:
  14828. * - STAT_TYPE
  14829. * Bits 7:0
  14830. * Purpose: identifies the type of statistics info held in the
  14831. * following information element
  14832. * Value: htt_dbg_ext_stats_type
  14833. * - STATUS
  14834. * Bits 10:8
  14835. * Purpose: indicate whether the requested stats are present
  14836. * Value: htt_dbg_ext_stats_status
  14837. * - DONE
  14838. * Bits 11
  14839. * Purpose:
  14840. * Indicates the completion of the stats entry, this will be the last
  14841. * stats conf HTT segment for the requested stats type.
  14842. * Value:
  14843. * 0 -> the stats retrieval is ongoing
  14844. * 1 -> the stats retrieval is complete
  14845. * - LENGTH
  14846. * Bits 31:16
  14847. * Purpose: indicate the stats information size
  14848. * Value: This field specifies the number of bytes of stats information
  14849. * that follows the element tag-length header.
  14850. * It is expected but not required that this length is a multiple of
  14851. * 4 bytes.
  14852. */
  14853. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14854. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14855. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14856. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14857. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14858. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14859. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14860. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14861. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14862. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14863. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14864. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14865. do { \
  14866. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14867. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14868. } while (0)
  14869. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14870. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14871. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14872. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14873. do { \
  14874. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14875. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14876. } while (0)
  14877. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14878. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14879. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14880. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14881. do { \
  14882. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14883. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14884. } while (0)
  14885. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14886. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14887. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14888. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14889. do { \
  14890. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14891. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14892. } while (0)
  14893. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14894. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14895. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14896. /**
  14897. * @brief target -> host streaming statistics upload
  14898. *
  14899. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14900. *
  14901. * @details
  14902. * The following field definitions describe the format of the HTT target
  14903. * to host streaming stats upload indication message.
  14904. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14905. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14906. * use the STREAMING_STATS_REQ message to halt the target's production of
  14907. * STREAMING_STATS_IND messages.
  14908. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14909. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14910. *
  14911. * |31 8|7 0|
  14912. * |--------------------------------------------------------------|
  14913. * | reserved | msg type |
  14914. * |--------------------------------------------------------------|
  14915. * | type-specific stats info |
  14916. * | (see htt_stats.h) |
  14917. * |--------------------------------------------------------------|
  14918. * Header fields:
  14919. * - MSG_TYPE
  14920. * Bits 7:0
  14921. * Purpose: Identifies this as a streaming statistics upload indication
  14922. * message.
  14923. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14924. */
  14925. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14926. typedef enum {
  14927. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14928. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14929. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14930. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14931. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14932. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14933. /* Reserved from 128 - 255 for target internal use.*/
  14934. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14935. } HTT_PEER_TYPE;
  14936. /** macro to convert MAC address from char array to HTT word format */
  14937. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14938. (phtt_mac_addr)->mac_addr31to0 = \
  14939. (((c_macaddr)[0] << 0) | \
  14940. ((c_macaddr)[1] << 8) | \
  14941. ((c_macaddr)[2] << 16) | \
  14942. ((c_macaddr)[3] << 24)); \
  14943. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14944. } while (0)
  14945. /**
  14946. * @brief target -> host monitor mac header indication message
  14947. *
  14948. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14949. *
  14950. * @details
  14951. * The following diagram shows the format of the monitor mac header message
  14952. * sent from the target to the host.
  14953. * This message is primarily sent when promiscuous rx mode is enabled.
  14954. * One message is sent per rx PPDU.
  14955. *
  14956. * |31 24|23 16|15 8|7 0|
  14957. * |-------------------------------------------------------------|
  14958. * | peer_id | reserved0 | msg_type |
  14959. * |-------------------------------------------------------------|
  14960. * | reserved1 | num_mpdu |
  14961. * |-------------------------------------------------------------|
  14962. * | struct hw_rx_desc |
  14963. * | (see wal_rx_desc.h) |
  14964. * |-------------------------------------------------------------|
  14965. * | struct ieee80211_frame_addr4 |
  14966. * | (see ieee80211_defs.h) |
  14967. * |-------------------------------------------------------------|
  14968. * | struct ieee80211_frame_addr4 |
  14969. * | (see ieee80211_defs.h) |
  14970. * |-------------------------------------------------------------|
  14971. * | ...... |
  14972. * |-------------------------------------------------------------|
  14973. *
  14974. * Header fields:
  14975. * - msg_type
  14976. * Bits 7:0
  14977. * Purpose: Identifies this is a monitor mac header indication message.
  14978. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14979. * - peer_id
  14980. * Bits 31:16
  14981. * Purpose: Software peer id given by host during association,
  14982. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14983. * for rx PPDUs received from unassociated peers.
  14984. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14985. * - num_mpdu
  14986. * Bits 15:0
  14987. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14988. * delivered within the message.
  14989. * Value: 1 to 32
  14990. * num_mpdu is limited to a maximum value of 32, due to buffer
  14991. * size limits. For PPDUs with more than 32 MPDUs, only the
  14992. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14993. * the PPDU will be provided.
  14994. */
  14995. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14996. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14997. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14998. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14999. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15000. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15001. do { \
  15002. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15003. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15004. } while (0)
  15005. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15006. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15007. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15008. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15009. do { \
  15010. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15011. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15012. } while (0)
  15013. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15014. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15015. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15016. /**
  15017. * @brief target -> host flow pool resize Message
  15018. *
  15019. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15020. *
  15021. * @details
  15022. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15023. * the flow pool associated with the specified ID is resized
  15024. *
  15025. * The message would appear as follows:
  15026. *
  15027. * |31 16|15 8|7 0|
  15028. * |---------------------------------+----------------+----------------|
  15029. * | reserved0 | Msg type |
  15030. * |-------------------------------------------------------------------|
  15031. * | flow pool new size | flow pool ID |
  15032. * |-------------------------------------------------------------------|
  15033. *
  15034. * The message is interpreted as follows:
  15035. * b'0:7 - msg_type: This will be set to 0x21
  15036. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15037. *
  15038. * b'0:15 - flow pool ID: Existing flow pool ID
  15039. *
  15040. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  15041. *
  15042. */
  15043. PREPACK struct htt_flow_pool_resize_t {
  15044. A_UINT32 msg_type:8,
  15045. reserved0:24;
  15046. A_UINT32 flow_pool_id:16,
  15047. flow_pool_new_size:16;
  15048. } POSTPACK;
  15049. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15050. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15051. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15052. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15053. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15054. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15055. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15056. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15057. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15058. do { \
  15059. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15060. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15061. } while (0)
  15062. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15063. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15064. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15065. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15066. do { \
  15067. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15068. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15069. } while (0)
  15070. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15071. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15072. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15073. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15074. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15075. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15076. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15077. /*
  15078. * The read and write indices point to the data within the host buffer.
  15079. * Because the first 4 bytes of the host buffer is used for the read index and
  15080. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15081. * The read index and write index are the byte offsets from the base of the
  15082. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15083. * Refer the ASCII text picture below.
  15084. */
  15085. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15086. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15087. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15088. /*
  15089. ***************************************************************************
  15090. *
  15091. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15092. *
  15093. ***************************************************************************
  15094. *
  15095. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15096. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15097. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15098. * written into the Host memory region mentioned below.
  15099. *
  15100. * Read index is updated by the Host. At any point of time, the read index will
  15101. * indicate the index that will next be read by the Host. The read index is
  15102. * in units of bytes offset from the base of the meta-data buffer.
  15103. *
  15104. * Write index is updated by the FW. At any point of time, the write index will
  15105. * indicate from where the FW can start writing any new data. The write index is
  15106. * in units of bytes offset from the base of the meta-data buffer.
  15107. *
  15108. * If the Host is not fast enough in reading the CFR data, any new capture data
  15109. * would be dropped if there is no space left to write the new captures.
  15110. *
  15111. * The last 4 bytes of the memory region will have the magic pattern
  15112. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15113. * not overrun the host buffer.
  15114. *
  15115. * ,--------------------. read and write indices store the
  15116. * | | byte offset from the base of the
  15117. * | ,--------+--------. meta-data buffer to the next
  15118. * | | | | location within the data buffer
  15119. * | | v v that will be read / written
  15120. * ************************************************************************
  15121. * * Read * Write * * Magic *
  15122. * * index * index * CFR data1 ...... CFR data N * pattern *
  15123. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15124. * ************************************************************************
  15125. * |<---------- data buffer ---------->|
  15126. *
  15127. * |<----------------- meta-data buffer allocated in Host ----------------|
  15128. *
  15129. * Note:
  15130. * - Considering the 4 bytes needed to store the Read index (R) and the
  15131. * Write index (W), the initial value is as follows:
  15132. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15133. * - Buffer empty condition:
  15134. * R = W
  15135. *
  15136. * Regarding CFR data format:
  15137. * --------------------------
  15138. *
  15139. * Each CFR tone is stored in HW as 16-bits with the following format:
  15140. * {bits[15:12], bits[11:6], bits[5:0]} =
  15141. * {unsigned exponent (4 bits),
  15142. * signed mantissa_real (6 bits),
  15143. * signed mantissa_imag (6 bits)}
  15144. *
  15145. * CFR_real = mantissa_real * 2^(exponent-5)
  15146. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15147. *
  15148. *
  15149. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15150. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15151. *
  15152. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15153. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15154. * .
  15155. * .
  15156. * .
  15157. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15158. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15159. */
  15160. /* Bandwidth of peer CFR captures */
  15161. typedef enum {
  15162. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15163. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15164. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15165. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15166. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15167. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15168. } HTT_PEER_CFR_CAPTURE_BW;
  15169. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15170. * was captured
  15171. */
  15172. typedef enum {
  15173. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15174. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15175. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15176. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15177. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15178. } HTT_PEER_CFR_CAPTURE_MODE;
  15179. typedef enum {
  15180. /* This message type is currently used for the below purpose:
  15181. *
  15182. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15183. * wmi_peer_cfr_capture_cmd.
  15184. * If payload_present bit is set to 0 then the associated memory region
  15185. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15186. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15187. * message; the CFR dump will be present at the end of the message,
  15188. * after the chan_phy_mode.
  15189. */
  15190. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15191. /* Always keep this last */
  15192. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15193. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15194. /**
  15195. * @brief target -> host CFR dump completion indication message definition
  15196. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15197. *
  15198. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15199. *
  15200. * @details
  15201. * The following diagram shows the format of the Channel Frequency Response
  15202. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15203. * the channel capture of a peer is copied by Firmware into the Host memory
  15204. *
  15205. * **************************************************************************
  15206. *
  15207. * Message format when the CFR capture message type is
  15208. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15209. *
  15210. * **************************************************************************
  15211. *
  15212. * |31 16|15 |8|7 0|
  15213. * |----------------------------------------------------------------|
  15214. * header: | reserved |P| msg_type |
  15215. * word 0 | | | |
  15216. * |----------------------------------------------------------------|
  15217. * payload: | cfr_capture_msg_type |
  15218. * word 1 | |
  15219. * |----------------------------------------------------------------|
  15220. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15221. * word 2 | | | | | | | | |
  15222. * |----------------------------------------------------------------|
  15223. * | mac_addr31to0 |
  15224. * word 3 | |
  15225. * |----------------------------------------------------------------|
  15226. * | unused / reserved | mac_addr47to32 |
  15227. * word 4 | | |
  15228. * |----------------------------------------------------------------|
  15229. * | index |
  15230. * word 5 | |
  15231. * |----------------------------------------------------------------|
  15232. * | length |
  15233. * word 6 | |
  15234. * |----------------------------------------------------------------|
  15235. * | timestamp |
  15236. * word 7 | |
  15237. * |----------------------------------------------------------------|
  15238. * | counter |
  15239. * word 8 | |
  15240. * |----------------------------------------------------------------|
  15241. * | chan_mhz |
  15242. * word 9 | |
  15243. * |----------------------------------------------------------------|
  15244. * | band_center_freq1 |
  15245. * word 10 | |
  15246. * |----------------------------------------------------------------|
  15247. * | band_center_freq2 |
  15248. * word 11 | |
  15249. * |----------------------------------------------------------------|
  15250. * | chan_phy_mode |
  15251. * word 12 | |
  15252. * |----------------------------------------------------------------|
  15253. * where,
  15254. * P - payload present bit (payload_present explained below)
  15255. * req_id - memory request id (mem_req_id explained below)
  15256. * S - status field (status explained below)
  15257. * capbw - capture bandwidth (capture_bw explained below)
  15258. * mode - mode of capture (mode explained below)
  15259. * sts - space time streams (sts_count explained below)
  15260. * chbw - channel bandwidth (channel_bw explained below)
  15261. * captype - capture type (cap_type explained below)
  15262. *
  15263. * The following field definitions describe the format of the CFR dump
  15264. * completion indication sent from the target to the host
  15265. *
  15266. * Header fields:
  15267. *
  15268. * Word 0
  15269. * - msg_type
  15270. * Bits 7:0
  15271. * Purpose: Identifies this as CFR TX completion indication
  15272. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15273. * - payload_present
  15274. * Bit 8
  15275. * Purpose: Identifies how CFR data is sent to host
  15276. * Value: 0 - If CFR Payload is written to host memory
  15277. * 1 - If CFR Payload is sent as part of HTT message
  15278. * (This is the requirement for SDIO/USB where it is
  15279. * not possible to write CFR data to host memory)
  15280. * - reserved
  15281. * Bits 31:9
  15282. * Purpose: Reserved
  15283. * Value: 0
  15284. *
  15285. * Payload fields:
  15286. *
  15287. * Word 1
  15288. * - cfr_capture_msg_type
  15289. * Bits 31:0
  15290. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15291. * to specify the format used for the remainder of the message
  15292. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15293. * (currently only MSG_TYPE_1 is defined)
  15294. *
  15295. * Word 2
  15296. * - mem_req_id
  15297. * Bits 6:0
  15298. * Purpose: Contain the mem request id of the region where the CFR capture
  15299. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15300. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15301. this value is invalid)
  15302. * - status
  15303. * Bit 7
  15304. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15305. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15306. * - capture_bw
  15307. * Bits 10:8
  15308. * Purpose: Carry the bandwidth of the CFR capture
  15309. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15310. * - mode
  15311. * Bits 13:11
  15312. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15313. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15314. * - sts_count
  15315. * Bits 16:14
  15316. * Purpose: Carry the number of space time streams
  15317. * Value: Number of space time streams
  15318. * - channel_bw
  15319. * Bits 19:17
  15320. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15321. * measurement
  15322. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15323. * - cap_type
  15324. * Bits 23:20
  15325. * Purpose: Carry the type of the capture
  15326. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15327. * - vdev_id
  15328. * Bits 31:24
  15329. * Purpose: Carry the virtual device id
  15330. * Value: vdev ID
  15331. *
  15332. * Word 3
  15333. * - mac_addr31to0
  15334. * Bits 31:0
  15335. * Purpose: Contain the bits 31:0 of the peer MAC address
  15336. * Value: Bits 31:0 of the peer MAC address
  15337. *
  15338. * Word 4
  15339. * - mac_addr47to32
  15340. * Bits 15:0
  15341. * Purpose: Contain the bits 47:32 of the peer MAC address
  15342. * Value: Bits 47:32 of the peer MAC address
  15343. *
  15344. * Word 5
  15345. * - index
  15346. * Bits 31:0
  15347. * Purpose: Contain the index at which this CFR dump was written in the Host
  15348. * allocated memory. This index is the number of bytes from the base address.
  15349. * Value: Index position
  15350. *
  15351. * Word 6
  15352. * - length
  15353. * Bits 31:0
  15354. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15355. * Value: Length of the CFR capture of the peer
  15356. *
  15357. * Word 7
  15358. * - timestamp
  15359. * Bits 31:0
  15360. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15361. * clock used for this timestamp is private to the target and not visible to
  15362. * the host i.e., Host can interpret only the relative timestamp deltas from
  15363. * one message to the next, but can't interpret the absolute timestamp from a
  15364. * single message.
  15365. * Value: Timestamp in microseconds
  15366. *
  15367. * Word 8
  15368. * - counter
  15369. * Bits 31:0
  15370. * Purpose: Carry the count of the current CFR capture from FW. This is
  15371. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15372. * in host memory)
  15373. * Value: Count of the current CFR capture
  15374. *
  15375. * Word 9
  15376. * - chan_mhz
  15377. * Bits 31:0
  15378. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15379. * Value: Primary 20 channel frequency
  15380. *
  15381. * Word 10
  15382. * - band_center_freq1
  15383. * Bits 31:0
  15384. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15385. * Value: Center frequency 1 in MHz
  15386. *
  15387. * Word 11
  15388. * - band_center_freq2
  15389. * Bits 31:0
  15390. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15391. * the VDEV
  15392. * 80plus80 mode
  15393. * Value: Center frequency 2 in MHz
  15394. *
  15395. * Word 12
  15396. * - chan_phy_mode
  15397. * Bits 31:0
  15398. * Purpose: Carry the phy mode of the channel, of the VDEV
  15399. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15400. */
  15401. PREPACK struct htt_cfr_dump_ind_type_1 {
  15402. A_UINT32 mem_req_id:7,
  15403. status:1,
  15404. capture_bw:3,
  15405. mode:3,
  15406. sts_count:3,
  15407. channel_bw:3,
  15408. cap_type:4,
  15409. vdev_id:8;
  15410. htt_mac_addr addr;
  15411. A_UINT32 index;
  15412. A_UINT32 length;
  15413. A_UINT32 timestamp;
  15414. A_UINT32 counter;
  15415. struct htt_chan_change_msg chan;
  15416. } POSTPACK;
  15417. PREPACK struct htt_cfr_dump_compl_ind {
  15418. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15419. union {
  15420. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15421. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15422. /* If there is a need to change the memory layout and its associated
  15423. * HTT indication format, a new CFR capture message type can be
  15424. * introduced and added into this union.
  15425. */
  15426. };
  15427. } POSTPACK;
  15428. /*
  15429. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15430. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15431. */
  15432. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15433. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15434. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15435. do { \
  15436. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15437. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15438. } while(0)
  15439. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15440. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15441. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15442. /*
  15443. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15444. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15445. */
  15446. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15447. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15448. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15449. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15450. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15451. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15452. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15453. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15454. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15455. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15456. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15457. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15458. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15459. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15460. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15461. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15462. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15463. do { \
  15464. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15465. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15466. } while (0)
  15467. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15468. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15469. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15470. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15471. do { \
  15472. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15473. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15474. } while (0)
  15475. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15476. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15477. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15478. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15479. do { \
  15480. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15481. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15482. } while (0)
  15483. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15484. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15485. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15486. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15487. do { \
  15488. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15489. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15490. } while (0)
  15491. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15492. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15493. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15494. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15495. do { \
  15496. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15497. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15498. } while (0)
  15499. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15500. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15501. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15502. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15503. do { \
  15504. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15505. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15506. } while (0)
  15507. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15508. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15509. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15510. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15511. do { \
  15512. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15513. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15514. } while (0)
  15515. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15516. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15517. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15518. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15519. do { \
  15520. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15521. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15522. } while (0)
  15523. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15524. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15525. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15526. /**
  15527. * @brief target -> host peer (PPDU) stats message
  15528. *
  15529. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15530. *
  15531. * @details
  15532. * This message is generated by FW when FW is sending stats to host
  15533. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15534. * This message is sent autonomously by the target rather than upon request
  15535. * by the host.
  15536. * The following field definitions describe the format of the HTT target
  15537. * to host peer stats indication message.
  15538. *
  15539. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15540. * or more PPDU stats records.
  15541. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15542. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15543. * then the message would start with the
  15544. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15545. * below.
  15546. *
  15547. * |31 16|15|14|13 11|10 9|8|7 0|
  15548. * |-------------------------------------------------------------|
  15549. * | reserved |MSG_TYPE |
  15550. * |-------------------------------------------------------------|
  15551. * rec 0 | TLV header |
  15552. * rec 0 |-------------------------------------------------------------|
  15553. * rec 0 | ppdu successful bytes |
  15554. * rec 0 |-------------------------------------------------------------|
  15555. * rec 0 | ppdu retry bytes |
  15556. * rec 0 |-------------------------------------------------------------|
  15557. * rec 0 | ppdu failed bytes |
  15558. * rec 0 |-------------------------------------------------------------|
  15559. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15560. * rec 0 |-------------------------------------------------------------|
  15561. * rec 0 | retried MSDUs | successful MSDUs |
  15562. * rec 0 |-------------------------------------------------------------|
  15563. * rec 0 | TX duration | failed MSDUs |
  15564. * rec 0 |-------------------------------------------------------------|
  15565. * ...
  15566. * |-------------------------------------------------------------|
  15567. * rec N | TLV header |
  15568. * rec N |-------------------------------------------------------------|
  15569. * rec N | ppdu successful bytes |
  15570. * rec N |-------------------------------------------------------------|
  15571. * rec N | ppdu retry bytes |
  15572. * rec N |-------------------------------------------------------------|
  15573. * rec N | ppdu failed bytes |
  15574. * rec N |-------------------------------------------------------------|
  15575. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15576. * rec N |-------------------------------------------------------------|
  15577. * rec N | retried MSDUs | successful MSDUs |
  15578. * rec N |-------------------------------------------------------------|
  15579. * rec N | TX duration | failed MSDUs |
  15580. * rec N |-------------------------------------------------------------|
  15581. *
  15582. * where:
  15583. * A = is A-MPDU flag
  15584. * BA = block-ack failure flags
  15585. * BW = bandwidth spec
  15586. * SG = SGI enabled spec
  15587. * S = skipped rate ctrl
  15588. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15589. *
  15590. * Header
  15591. * ------
  15592. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15593. * dword0 - b'8:31 - reserved : Reserved for future use
  15594. *
  15595. * payload include below peer_stats information
  15596. * --------------------------------------------
  15597. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15598. * @tx_success_bytes : total successful bytes in the PPDU.
  15599. * @tx_retry_bytes : total retried bytes in the PPDU.
  15600. * @tx_failed_bytes : total failed bytes in the PPDU.
  15601. * @tx_ratecode : rate code used for the PPDU.
  15602. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15603. * @ba_ack_failed : BA/ACK failed for this PPDU
  15604. * b00 -> BA received
  15605. * b01 -> BA failed once
  15606. * b10 -> BA failed twice, when HW retry is enabled.
  15607. * @bw : BW
  15608. * b00 -> 20 MHz
  15609. * b01 -> 40 MHz
  15610. * b10 -> 80 MHz
  15611. * b11 -> 160 MHz (or 80+80)
  15612. * @sg : SGI enabled
  15613. * @s : skipped ratectrl
  15614. * @peer_id : peer id
  15615. * @tx_success_msdus : successful MSDUs
  15616. * @tx_retry_msdus : retried MSDUs
  15617. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15618. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15619. */
  15620. /**
  15621. * @brief target -> host backpressure event
  15622. *
  15623. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15624. *
  15625. * @details
  15626. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15627. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15628. * This message will only be sent if the backpressure condition has existed
  15629. * continuously for an initial period (100 ms).
  15630. * Repeat messages with updated information will be sent after each
  15631. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15632. * This message indicates the ring id along with current head and tail index
  15633. * locations (i.e. write and read indices).
  15634. * The backpressure time indicates the time in ms for which continous
  15635. * backpressure has been observed in the ring.
  15636. *
  15637. * The message format is as follows:
  15638. *
  15639. * |31 24|23 16|15 8|7 0|
  15640. * |----------------+----------------+----------------+----------------|
  15641. * | ring_id | ring_type | pdev_id | msg_type |
  15642. * |-------------------------------------------------------------------|
  15643. * | tail_idx | head_idx |
  15644. * |-------------------------------------------------------------------|
  15645. * | backpressure_time_ms |
  15646. * |-------------------------------------------------------------------|
  15647. *
  15648. * The message is interpreted as follows:
  15649. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15650. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15651. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15652. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15653. the msg is for LMAC ring.
  15654. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15655. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15656. * htt_backpressure_lmac_ring_id. This represents
  15657. * the ring id for which continous backpressure is seen
  15658. *
  15659. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15660. * the ring indicated by the ring_id
  15661. *
  15662. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15663. * the ring indicated by the ring id
  15664. *
  15665. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15666. * backpressure has been seen in the ring
  15667. * indicated by the ring_id.
  15668. * Units = milliseconds
  15669. */
  15670. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15671. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15672. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15673. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15674. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15675. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15676. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15677. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15678. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15679. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15680. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15681. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15682. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15683. do { \
  15684. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15685. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15686. } while (0)
  15687. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15688. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15689. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15690. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15691. do { \
  15692. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15693. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15694. } while (0)
  15695. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15696. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15697. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15698. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15699. do { \
  15700. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15701. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15702. } while (0)
  15703. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15704. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15705. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15706. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15707. do { \
  15708. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15709. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15710. } while (0)
  15711. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15712. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15713. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15714. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15715. do { \
  15716. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15717. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15718. } while (0)
  15719. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15720. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15721. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15722. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15723. do { \
  15724. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15725. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15726. } while (0)
  15727. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15728. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15729. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15730. enum htt_backpressure_ring_type {
  15731. HTT_SW_RING_TYPE_UMAC,
  15732. HTT_SW_RING_TYPE_LMAC,
  15733. HTT_SW_RING_TYPE_MAX,
  15734. };
  15735. /* Ring id for which the message is sent to host */
  15736. enum htt_backpressure_umac_ringid {
  15737. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15738. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15739. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15740. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15741. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15742. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15743. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15744. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15745. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15746. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15747. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15748. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15749. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15750. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15751. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15752. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15753. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15754. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15755. HTT_SW_UMAC_RING_IDX_MAX,
  15756. };
  15757. enum htt_backpressure_lmac_ringid {
  15758. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15759. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15760. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15761. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15762. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15763. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15764. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15765. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15766. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15767. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15768. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15769. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15770. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15771. HTT_SW_LMAC_RING_IDX_MAX,
  15772. };
  15773. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15774. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15775. pdev_id: 8,
  15776. ring_type: 8, /* htt_backpressure_ring_type */
  15777. /*
  15778. * ring_id holds an enum value from either
  15779. * htt_backpressure_umac_ringid or
  15780. * htt_backpressure_lmac_ringid, based on
  15781. * the ring_type setting.
  15782. */
  15783. ring_id: 8;
  15784. A_UINT16 head_idx;
  15785. A_UINT16 tail_idx;
  15786. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15787. } POSTPACK;
  15788. /*
  15789. * Defines two 32 bit words that can be used by the target to indicate a per
  15790. * user RU allocation and rate information.
  15791. *
  15792. * This information is currently provided in the "sw_response_reference_ptr"
  15793. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15794. * "rx_ppdu_end_user_stats" TLV.
  15795. *
  15796. * VALID:
  15797. * The consumer of these words must explicitly check the valid bit,
  15798. * and only attempt interpretation of any of the remaining fields if
  15799. * the valid bit is set to 1.
  15800. *
  15801. * VERSION:
  15802. * The consumer of these words must also explicitly check the version bit,
  15803. * and only use the V0 definition if the VERSION field is set to 0.
  15804. *
  15805. * Version 1 is currently undefined, with the exception of the VALID and
  15806. * VERSION fields.
  15807. *
  15808. * Version 0:
  15809. *
  15810. * The fields below are duplicated per BW.
  15811. *
  15812. * The consumer must determine which BW field to use, based on the UL OFDMA
  15813. * PPDU BW indicated by HW.
  15814. *
  15815. * RU_START: RU26 start index for the user.
  15816. * Note that this is always using the RU26 index, regardless
  15817. * of the actual RU assigned to the user
  15818. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15819. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15820. *
  15821. * For example, 20MHz (the value in the top row is RU_START)
  15822. *
  15823. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15824. * RU Size 1 (52): | | | | | |
  15825. * RU Size 2 (106): | | | |
  15826. * RU Size 3 (242): | |
  15827. *
  15828. * RU_SIZE: Indicates the RU size, as defined by enum
  15829. * htt_ul_ofdma_user_info_ru_size.
  15830. *
  15831. * LDPC: LDPC enabled (if 0, BCC is used)
  15832. *
  15833. * DCM: DCM enabled
  15834. *
  15835. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15836. * |---------------------------------+--------------------------------|
  15837. * |Ver|Valid| FW internal |
  15838. * |---------------------------------+--------------------------------|
  15839. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15840. * |---------------------------------+--------------------------------|
  15841. */
  15842. enum htt_ul_ofdma_user_info_ru_size {
  15843. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15844. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15845. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15846. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15847. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15848. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15849. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15850. };
  15851. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15852. struct htt_ul_ofdma_user_info_v0 {
  15853. A_UINT32 word0;
  15854. A_UINT32 word1;
  15855. };
  15856. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15857. A_UINT32 w0_fw_rsvd:30; \
  15858. A_UINT32 w0_valid:1; \
  15859. A_UINT32 w0_version:1;
  15860. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15861. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15862. };
  15863. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15864. A_UINT32 w1_nss:3; \
  15865. A_UINT32 w1_mcs:4; \
  15866. A_UINT32 w1_ldpc:1; \
  15867. A_UINT32 w1_dcm:1; \
  15868. A_UINT32 w1_ru_start:7; \
  15869. A_UINT32 w1_ru_size:3; \
  15870. A_UINT32 w1_trig_type:4; \
  15871. A_UINT32 w1_unused:9;
  15872. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15873. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15874. };
  15875. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15876. A_UINT32 w0_fw_rsvd:27; \
  15877. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15878. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15879. 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) */
  15880. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15881. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15882. };
  15883. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15884. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15885. A_UINT32 w1_trig_type:4; \
  15886. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15887. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15888. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15889. };
  15890. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15891. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15892. union {
  15893. A_UINT32 word0;
  15894. struct {
  15895. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15896. };
  15897. };
  15898. union {
  15899. A_UINT32 word1;
  15900. struct {
  15901. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15902. };
  15903. };
  15904. } POSTPACK;
  15905. /*
  15906. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15907. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15908. * this should be picked.
  15909. */
  15910. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15911. union {
  15912. A_UINT32 word0;
  15913. struct {
  15914. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15915. };
  15916. };
  15917. union {
  15918. A_UINT32 word1;
  15919. struct {
  15920. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15921. };
  15922. };
  15923. } POSTPACK;
  15924. enum HTT_UL_OFDMA_TRIG_TYPE {
  15925. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15926. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15927. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15928. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15929. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15930. };
  15931. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15932. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15933. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15934. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15935. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15936. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15937. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15938. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15939. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15940. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15941. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15942. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15943. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15944. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15945. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15946. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15947. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15948. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15949. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15950. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15951. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15952. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15953. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15954. /*--- word 0 ---*/
  15955. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15956. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15957. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15958. do { \
  15959. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15960. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15961. } while (0)
  15962. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15963. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15964. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15965. do { \
  15966. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15967. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15968. } while (0)
  15969. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15970. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15971. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15972. do { \
  15973. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15974. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15975. } while (0)
  15976. /*--- word 1 ---*/
  15977. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15978. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15979. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15980. do { \
  15981. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15982. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15983. } while (0)
  15984. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15985. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15986. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15987. do { \
  15988. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15989. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15990. } while (0)
  15991. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15992. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15993. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15994. do { \
  15995. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15996. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15997. } while (0)
  15998. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15999. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16000. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16001. do { \
  16002. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16003. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16004. } while (0)
  16005. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16006. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16007. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16008. do { \
  16009. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16010. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16011. } while (0)
  16012. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16013. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16014. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16015. do { \
  16016. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16017. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16018. } while (0)
  16019. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16020. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16021. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16022. do { \
  16023. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16024. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16025. } while (0)
  16026. /**
  16027. * @brief target -> host channel calibration data message
  16028. *
  16029. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16030. *
  16031. * @brief host -> target channel calibration data message
  16032. *
  16033. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16034. *
  16035. * @details
  16036. * The following field definitions describe the format of the channel
  16037. * calibration data message sent from the target to the host when
  16038. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16039. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16040. * The message is defined as htt_chan_caldata_msg followed by a variable
  16041. * number of 32-bit character values.
  16042. *
  16043. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16044. * |------------------------------------------------------------------|
  16045. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16046. * |------------------------------------------------------------------|
  16047. * | payload size | mhz |
  16048. * |------------------------------------------------------------------|
  16049. * | center frequency 2 | center frequency 1 |
  16050. * |------------------------------------------------------------------|
  16051. * | check sum |
  16052. * |------------------------------------------------------------------|
  16053. * | payload |
  16054. * |------------------------------------------------------------------|
  16055. * message info field:
  16056. * - MSG_TYPE
  16057. * Bits 7:0
  16058. * Purpose: identifies this as a channel calibration data message
  16059. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16060. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16061. * - SUB_TYPE
  16062. * Bits 11:8
  16063. * Purpose: T2H: indicates whether target is providing chan cal data
  16064. * to the host to store, or requesting that the host
  16065. * download previously-stored data.
  16066. * H2T: indicates whether the host is providing the requested
  16067. * channel cal data, or if it is rejecting the data
  16068. * request because it does not have the requested data.
  16069. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16070. * - CHKSUM_VALID
  16071. * Bit 12
  16072. * Purpose: indicates if the checksum field is valid
  16073. * value:
  16074. * - FRAG
  16075. * Bit 19:16
  16076. * Purpose: indicates the fragment index for message
  16077. * value: 0 for first fragment, 1 for second fragment, ...
  16078. * - APPEND
  16079. * Bit 20
  16080. * Purpose: indicates if this is the last fragment
  16081. * value: 0 = final fragment, 1 = more fragments will be appended
  16082. *
  16083. * channel and payload size field
  16084. * - MHZ
  16085. * Bits 15:0
  16086. * Purpose: indicates the channel primary frequency
  16087. * Value:
  16088. * - PAYLOAD_SIZE
  16089. * Bits 31:16
  16090. * Purpose: indicates the bytes of calibration data in payload
  16091. * Value:
  16092. *
  16093. * center frequency field
  16094. * - CENTER FREQUENCY 1
  16095. * Bits 15:0
  16096. * Purpose: indicates the channel center frequency
  16097. * Value: channel center frequency, in MHz units
  16098. * - CENTER FREQUENCY 2
  16099. * Bits 31:16
  16100. * Purpose: indicates the secondary channel center frequency,
  16101. * only for 11acvht 80plus80 mode
  16102. * Value: secondary channel center frequeny, in MHz units, if applicable
  16103. *
  16104. * checksum field
  16105. * - CHECK_SUM
  16106. * Bits 31:0
  16107. * Purpose: check the payload data, it is just for this fragment.
  16108. * This is intended for the target to check that the channel
  16109. * calibration data returned by the host is the unmodified data
  16110. * that was previously provided to the host by the target.
  16111. * value: checksum of fragment payload
  16112. */
  16113. PREPACK struct htt_chan_caldata_msg {
  16114. /* DWORD 0: message info */
  16115. A_UINT32
  16116. msg_type: 8,
  16117. sub_type: 4 ,
  16118. chksum_valid: 1, /** 1:valid, 0:invalid */
  16119. reserved1: 3,
  16120. frag_idx: 4, /** fragment index for calibration data */
  16121. appending: 1, /** 0: no fragment appending,
  16122. * 1: extra fragment appending */
  16123. reserved2: 11;
  16124. /* DWORD 1: channel and payload size */
  16125. A_UINT32
  16126. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16127. payload_size: 16; /** unit: bytes */
  16128. /* DWORD 2: center frequency */
  16129. A_UINT32
  16130. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16131. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16132. * valid only for 11acvht 80plus80 mode */
  16133. /* DWORD 3: check sum */
  16134. A_UINT32 chksum;
  16135. /* variable length for calibration data */
  16136. A_UINT32 payload[1/* or more */];
  16137. } POSTPACK;
  16138. /* T2H SUBTYPE */
  16139. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16140. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16141. /* H2T SUBTYPE */
  16142. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16143. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16144. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16145. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16146. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16147. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16148. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16149. do { \
  16150. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16151. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16152. } while (0)
  16153. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16154. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16155. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16156. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16157. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16158. do { \
  16159. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16160. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16161. } while (0)
  16162. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16163. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16164. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16165. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16166. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16167. do { \
  16168. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16169. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16170. } while (0)
  16171. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16172. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16173. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16174. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16175. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16176. do { \
  16177. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16178. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16179. } while (0)
  16180. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16181. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16182. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16183. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16184. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16185. do { \
  16186. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16187. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16188. } while (0)
  16189. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16190. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16191. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16192. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16193. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16194. do { \
  16195. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16196. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16197. } while (0)
  16198. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16199. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16200. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16201. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16202. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16203. do { \
  16204. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16205. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16206. } while (0)
  16207. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16208. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16209. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16210. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16211. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16212. do { \
  16213. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16214. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16215. } while (0)
  16216. /**
  16217. * @brief target -> host FSE CMEM based send
  16218. *
  16219. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16220. *
  16221. * @details
  16222. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16223. * FSE placement in CMEM is enabled.
  16224. *
  16225. * This message sends the non-secure CMEM base address.
  16226. * It will be sent to host in response to message
  16227. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16228. * The message would appear as follows:
  16229. *
  16230. * |31 24|23 16|15 8|7 0|
  16231. * |----------------+----------------+----------------+----------------|
  16232. * | reserved | num_entries | msg_type |
  16233. * |----------------+----------------+----------------+----------------|
  16234. * | base_address_lo |
  16235. * |----------------+----------------+----------------+----------------|
  16236. * | base_address_hi |
  16237. * |-------------------------------------------------------------------|
  16238. *
  16239. * The message is interpreted as follows:
  16240. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16241. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16242. * b'8:15 - number_entries: Indicated the number of entries
  16243. * programmed.
  16244. * b'16:31 - reserved.
  16245. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16246. * CMEM base address
  16247. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16248. * CMEM base address
  16249. */
  16250. PREPACK struct htt_cmem_base_send_t {
  16251. A_UINT32 msg_type: 8,
  16252. num_entries: 8,
  16253. reserved: 16;
  16254. A_UINT32 base_address_lo;
  16255. A_UINT32 base_address_hi;
  16256. } POSTPACK;
  16257. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16258. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16259. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16260. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16261. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16262. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16263. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16264. do { \
  16265. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16266. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16267. } while (0)
  16268. /**
  16269. * @brief - HTT PPDU ID format
  16270. *
  16271. * @details
  16272. * The following field definitions describe the format of the PPDU ID.
  16273. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16274. *
  16275. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16276. * +--------------------------------------------------------------------------
  16277. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16278. * +--------------------------------------------------------------------------
  16279. *
  16280. * sch id :Schedule command id
  16281. * Bits [11 : 0] : monotonically increasing counter to track the
  16282. * PPDU posted to a specific transmit queue.
  16283. *
  16284. * hwq_id: Hardware Queue ID.
  16285. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16286. *
  16287. * mac_id: MAC ID
  16288. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16289. *
  16290. * seq_idx: Sequence index.
  16291. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16292. * a particular TXOP.
  16293. *
  16294. * tqm_cmd: HWSCH/TQM flag.
  16295. * Bit [23] : Always set to 0.
  16296. *
  16297. * seq_cmd_type: Sequence command type.
  16298. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16299. * Refer to enum HTT_STATS_FTYPE for values.
  16300. */
  16301. PREPACK struct htt_ppdu_id {
  16302. A_UINT32
  16303. sch_id: 12,
  16304. hwq_id: 5,
  16305. mac_id: 2,
  16306. seq_idx: 2,
  16307. reserved1: 2,
  16308. tqm_cmd: 1,
  16309. seq_cmd_type: 6,
  16310. reserved2: 2;
  16311. } POSTPACK;
  16312. #define HTT_PPDU_ID_SCH_ID_S 0
  16313. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16314. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16315. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16316. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16317. do { \
  16318. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16319. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16320. } while (0)
  16321. #define HTT_PPDU_ID_HWQ_ID_S 12
  16322. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16323. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16324. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16325. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16326. do { \
  16327. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16328. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16329. } while (0)
  16330. #define HTT_PPDU_ID_MAC_ID_S 17
  16331. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16332. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16333. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16334. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16335. do { \
  16336. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16337. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16338. } while (0)
  16339. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16340. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16341. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16342. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16343. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16344. do { \
  16345. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16346. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16347. } while (0)
  16348. #define HTT_PPDU_ID_TQM_CMD_S 23
  16349. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16350. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16351. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16352. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16353. do { \
  16354. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16355. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16356. } while (0)
  16357. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16358. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16359. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16360. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16361. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16362. do { \
  16363. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16364. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16365. } while (0)
  16366. /**
  16367. * @brief target -> RX PEER METADATA V0 format
  16368. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16369. * message from target, and will confirm to the target which peer metadata
  16370. * version to use in the wmi_init message.
  16371. *
  16372. * The following diagram shows the format of the RX PEER METADATA.
  16373. *
  16374. * |31 24|23 16|15 8|7 0|
  16375. * |-----------------------------------------------------------------------|
  16376. * | Reserved | VDEV ID | PEER ID |
  16377. * |-----------------------------------------------------------------------|
  16378. */
  16379. PREPACK struct htt_rx_peer_metadata_v0 {
  16380. A_UINT32
  16381. peer_id: 16,
  16382. vdev_id: 8,
  16383. reserved1: 8;
  16384. } POSTPACK;
  16385. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16386. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16387. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16388. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16389. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16390. do { \
  16391. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16392. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16393. } while (0)
  16394. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16395. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16396. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16397. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16398. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16399. do { \
  16400. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16401. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16402. } while (0)
  16403. /**
  16404. * @brief target -> RX PEER METADATA V1 format
  16405. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16406. * message from target, and will confirm to the target which peer metadata
  16407. * version to use in the wmi_init message.
  16408. *
  16409. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16410. *
  16411. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16412. * |-----------------------------------------------------------------------|
  16413. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16414. * |-----------------------------------------------------------------------|
  16415. */
  16416. PREPACK struct htt_rx_peer_metadata_v1 {
  16417. A_UINT32
  16418. peer_id: 13,
  16419. ml_peer_valid: 1,
  16420. reserved1: 2,
  16421. vdev_id: 8,
  16422. lmac_id: 2,
  16423. chip_id: 3,
  16424. reserved2: 3;
  16425. } POSTPACK;
  16426. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16427. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16428. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16429. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16430. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16431. do { \
  16432. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16433. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16434. } while (0)
  16435. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16436. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16437. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16438. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16439. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16440. do { \
  16441. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16442. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16443. } while (0)
  16444. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16445. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16446. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16447. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16448. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16449. do { \
  16450. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16451. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16452. } while (0)
  16453. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16454. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16455. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16456. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16457. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16458. do { \
  16459. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16460. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16461. } while (0)
  16462. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16463. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16464. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16465. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16466. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16467. do { \
  16468. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16469. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16470. } while (0)
  16471. /*
  16472. * In some systems, the host SW wants to specify priorities between
  16473. * different MSDU / flow queues within the same peer-TID.
  16474. * The below enums are used for the host to identify to the target
  16475. * which MSDU queue's priority it wants to adjust.
  16476. */
  16477. /*
  16478. * The MSDUQ index describe index of TCL HW, where each index is
  16479. * used for queuing particular types of MSDUs.
  16480. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16481. */
  16482. enum HTT_MSDUQ_INDEX {
  16483. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16484. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16485. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16486. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16487. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16488. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16489. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16490. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16491. HTT_MSDUQ_MAX_INDEX,
  16492. };
  16493. /* MSDU qtype definition */
  16494. enum HTT_MSDU_QTYPE {
  16495. /*
  16496. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16497. * relative priority. Instead, the relative priority of CRIT_0 versus
  16498. * CRIT_1 is controlled by the FW, through the configuration parameters
  16499. * it applies to the queues.
  16500. */
  16501. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16502. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16503. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16504. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16505. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16506. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16507. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16508. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16509. /* New MSDU_QTYPE should be added above this line */
  16510. /*
  16511. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16512. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16513. * any host/target message definitions. The QTYPE_MAX value can
  16514. * only be used internally within the host or within the target.
  16515. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16516. * it must regard the unexpected value as a default qtype value,
  16517. * or ignore it.
  16518. */
  16519. HTT_MSDU_QTYPE_MAX,
  16520. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16521. };
  16522. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16523. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16524. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16525. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16526. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16527. };
  16528. /**
  16529. * @brief target -> host mlo timestamp offset indication
  16530. *
  16531. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16532. *
  16533. * @details
  16534. * The following field definitions describe the format of the HTT target
  16535. * to host mlo timestamp offset indication message.
  16536. *
  16537. *
  16538. * |31 16|15 12|11 10|9 8|7 0 |
  16539. * |----------------------------------------------------------------------|
  16540. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16541. * |----------------------------------------------------------------------|
  16542. * | Sync time stamp lo in us |
  16543. * |----------------------------------------------------------------------|
  16544. * | Sync time stamp hi in us |
  16545. * |----------------------------------------------------------------------|
  16546. * | mlo time stamp offset lo in us |
  16547. * |----------------------------------------------------------------------|
  16548. * | mlo time stamp offset hi in us |
  16549. * |----------------------------------------------------------------------|
  16550. * | mlo time stamp offset clocks in clock ticks |
  16551. * |----------------------------------------------------------------------|
  16552. * |31 26|25 16|15 0 |
  16553. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16554. * | | compensation in clks | |
  16555. * |----------------------------------------------------------------------|
  16556. * |31 22|21 0 |
  16557. * | rsvd 3 | mlo time stamp comp timer period |
  16558. * |----------------------------------------------------------------------|
  16559. * The message is interpreted as follows:
  16560. *
  16561. * dword0 - b'0:7 - msg_type: This will be set to
  16562. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16563. * value: 0x28
  16564. *
  16565. * dword0 - b'9:8 - pdev_id
  16566. *
  16567. * dword0 - b'11:10 - chip_id
  16568. *
  16569. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16570. *
  16571. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16572. *
  16573. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16574. * which last sync interrupt was received
  16575. *
  16576. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16577. * which last sync interrupt was received
  16578. *
  16579. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16580. *
  16581. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16582. *
  16583. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16584. *
  16585. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16586. *
  16587. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16588. * for sub us resolution
  16589. *
  16590. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16591. *
  16592. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16593. * is applied, in us
  16594. *
  16595. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16596. */
  16597. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16598. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16599. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16600. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16601. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16602. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16603. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16604. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16605. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16606. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16607. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16608. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16609. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16610. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16611. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16612. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16613. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16614. do { \
  16615. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16616. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16617. } while (0)
  16618. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16619. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16620. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16621. do { \
  16622. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16623. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16624. } while (0)
  16625. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16626. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16627. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16628. do { \
  16629. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16630. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16631. } while (0)
  16632. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16633. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16634. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16635. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16636. do { \
  16637. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16638. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16639. } while (0)
  16640. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16641. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16642. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16643. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16644. do { \
  16645. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16646. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16647. } while (0)
  16648. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16649. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16650. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16651. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16652. do { \
  16653. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16654. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16655. } while (0)
  16656. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16657. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16658. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16659. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16660. do { \
  16661. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16662. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16663. } while (0)
  16664. typedef struct {
  16665. A_UINT32 msg_type: 8, /* bits 7:0 */
  16666. pdev_id: 2, /* bits 9:8 */
  16667. chip_id: 2, /* bits 11:10 */
  16668. reserved1: 4, /* bits 15:12 */
  16669. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16670. A_UINT32 sync_timestamp_lo_us;
  16671. A_UINT32 sync_timestamp_hi_us;
  16672. A_UINT32 mlo_timestamp_offset_lo_us;
  16673. A_UINT32 mlo_timestamp_offset_hi_us;
  16674. A_UINT32 mlo_timestamp_offset_clks;
  16675. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16676. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16677. reserved2: 6; /* bits 31:26 */
  16678. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16679. reserved3: 10; /* bits 31:22 */
  16680. } htt_t2h_mlo_offset_ind_t;
  16681. /*
  16682. * @brief target -> host VDEV TX RX STATS
  16683. *
  16684. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16685. *
  16686. * @details
  16687. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16688. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16689. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16690. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16691. * periodically by target even in the absence of any further HTT request
  16692. * messages from host.
  16693. *
  16694. * The message is formatted as follows:
  16695. *
  16696. * |31 16|15 8|7 0|
  16697. * |---------------------------------+----------------+----------------|
  16698. * | payload_size | pdev_id | msg_type |
  16699. * |---------------------------------+----------------+----------------|
  16700. * | reserved0 |
  16701. * |-------------------------------------------------------------------|
  16702. * | reserved1 |
  16703. * |-------------------------------------------------------------------|
  16704. * | reserved2 |
  16705. * |-------------------------------------------------------------------|
  16706. * | |
  16707. * | VDEV specific Tx Rx stats info |
  16708. * | |
  16709. * |-------------------------------------------------------------------|
  16710. *
  16711. * The message is interpreted as follows:
  16712. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16713. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16714. * b'8:15 - pdev_id
  16715. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16716. * message header fields (msg_type through reserved2)
  16717. * dword1 - b'0:31 - reserved0.
  16718. * dword2 - b'0:31 - reserved1.
  16719. * dword3 - b'0:31 - reserved2.
  16720. */
  16721. typedef struct {
  16722. A_UINT32 msg_type: 8,
  16723. pdev_id: 8,
  16724. payload_size: 16;
  16725. A_UINT32 reserved0;
  16726. A_UINT32 reserved1;
  16727. A_UINT32 reserved2;
  16728. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16729. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16730. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16731. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16732. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16733. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16734. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16735. do { \
  16736. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16737. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16738. } while (0)
  16739. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16740. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16741. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16742. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16743. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16744. do { \
  16745. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16746. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16747. } while (0)
  16748. /* SOC related stats */
  16749. typedef struct {
  16750. htt_tlv_hdr_t tlv_hdr;
  16751. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16752. * This can be due to either the peer is deleted or deletion is ongoing
  16753. * */
  16754. A_UINT32 inv_peers_msdu_drop_count_lo;
  16755. A_UINT32 inv_peers_msdu_drop_count_hi;
  16756. } htt_t2h_soc_txrx_stats_common_tlv;
  16757. /* VDEV HW Tx/Rx stats */
  16758. typedef struct {
  16759. htt_tlv_hdr_t tlv_hdr;
  16760. A_UINT32 vdev_id;
  16761. /* Rx msdu byte cnt */
  16762. A_UINT32 rx_msdu_byte_cnt_lo;
  16763. A_UINT32 rx_msdu_byte_cnt_hi;
  16764. /* Rx msdu cnt */
  16765. A_UINT32 rx_msdu_cnt_lo;
  16766. A_UINT32 rx_msdu_cnt_hi;
  16767. /* tx msdu byte cnt */
  16768. A_UINT32 tx_msdu_byte_cnt_lo;
  16769. A_UINT32 tx_msdu_byte_cnt_hi;
  16770. /* tx msdu cnt */
  16771. A_UINT32 tx_msdu_cnt_lo;
  16772. A_UINT32 tx_msdu_cnt_hi;
  16773. /* tx excessive retry discarded msdu cnt */
  16774. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16775. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16776. /* TX congestion ctrl msdu drop cnt */
  16777. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16778. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16779. /* discarded tx msdus cnt coz of time to live expiry */
  16780. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16781. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16782. /* tx excessive retry discarded msdu byte cnt */
  16783. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16784. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16785. /* TX congestion ctrl msdu drop byte cnt */
  16786. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16787. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16788. /* discarded tx msdus byte cnt coz of time to live expiry */
  16789. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16790. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16791. /* TQM bypass frame cnt */
  16792. A_UINT32 tqm_bypass_frame_cnt_lo;
  16793. A_UINT32 tqm_bypass_frame_cnt_hi;
  16794. /* TQM bypass byte cnt */
  16795. A_UINT32 tqm_bypass_byte_cnt_lo;
  16796. A_UINT32 tqm_bypass_byte_cnt_hi;
  16797. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16798. /*
  16799. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16800. *
  16801. * @details
  16802. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16803. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16804. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16805. * the default MSDU queues of each of the specified TIDs for the peer
  16806. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16807. * If the default MSDU queues of a given TID within the peer are not linked
  16808. * to a service class, the svc_class_id field for that TID will have a
  16809. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16810. * queues for that TID are not mapped to any service class.
  16811. *
  16812. * |31 16|15 8|7 0|
  16813. * |------------------------------+--------------+--------------|
  16814. * | peer ID | reserved | msg type |
  16815. * |------------------------------+--------------+------+-------|
  16816. * | reserved | svc class ID | TID |
  16817. * |------------------------------------------------------------|
  16818. * ...
  16819. * |------------------------------------------------------------|
  16820. * | reserved | svc class ID | TID |
  16821. * |------------------------------------------------------------|
  16822. * Header fields:
  16823. * dword0 - b'7:0 - msg_type: This will be set to
  16824. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16825. * b'31:16 - peer ID
  16826. * dword1 - b'7:0 - TID
  16827. * b'15:8 - svc class ID
  16828. * (dword2, etc. same format as dword1)
  16829. */
  16830. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16831. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16832. A_UINT32 msg_type :8,
  16833. reserved0 :8,
  16834. peer_id :16;
  16835. struct {
  16836. A_UINT32 tid :8,
  16837. svc_class_id :8,
  16838. reserved1 :16;
  16839. } tid_reports[1/*or more*/];
  16840. } POSTPACK;
  16841. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16842. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16843. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16844. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16845. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16846. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16847. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16848. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16849. do { \
  16850. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16851. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16852. } while (0)
  16853. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16854. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16855. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16856. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16857. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16858. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16859. do { \
  16860. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16861. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16862. } while (0)
  16863. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16864. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16865. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16866. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16867. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16868. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16869. do { \
  16870. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16871. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16872. } while (0)
  16873. /*
  16874. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16875. *
  16876. * @details
  16877. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16878. * flow if the flow is seen the associated service class is conveyed to the
  16879. * target via TCL Data Command. Target on the other hand internally creates the
  16880. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16881. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16882. * the newly created MSDUQ
  16883. *
  16884. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16885. * |------------------------------+------------------------+--------------|
  16886. * | peer ID | HTT qtype | msg type |
  16887. * |---------------------------------+--------------+--+---+-------+------|
  16888. * | reserved |AST list index|FO|WC | HLOS | remap|
  16889. * | | | | | TID | TID |
  16890. * |---------------------+------------------------------------------------|
  16891. * | reserved1 | tgt_opaque_id |
  16892. * |---------------------+------------------------------------------------|
  16893. *
  16894. * Header fields:
  16895. *
  16896. * dword0 - b'7:0 - msg_type: This will be set to
  16897. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16898. * b'15:8 - HTT qtype
  16899. * b'31:16 - peer ID
  16900. *
  16901. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16902. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16903. * hlos_tid : Common to Lithium and Beryllium
  16904. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16905. * TCL Data Command : Beryllium
  16906. * b10 - flow_override (FO), as sent by host in
  16907. * TCL Data Command: Beryllium
  16908. * b11:14 - ast_list_idx
  16909. * Array index into the list of extension AST entries
  16910. * (not the actual AST 16-bit index).
  16911. * The ast_list_idx is one-based, with the following
  16912. * range of values:
  16913. * - legacy targets supporting 16 user-defined
  16914. * MSDU queues: 1-2
  16915. * - legacy targets supporting 48 user-defined
  16916. * MSDU queues: 1-6
  16917. * - new targets: 0 (peer_id is used instead)
  16918. * Note that since ast_list_idx is one-based,
  16919. * the host will need to subtract 1 to use it as an
  16920. * index into a list of extension AST entries.
  16921. * b15:31 - reserved
  16922. *
  16923. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16924. * unique MSDUQ id in firmware
  16925. * b'24:31 - reserved1
  16926. */
  16927. PREPACK struct htt_t2h_sawf_msduq_event {
  16928. A_UINT32 msg_type : 8,
  16929. htt_qtype : 8,
  16930. peer_id :16;
  16931. A_UINT32 remap_tid : 4,
  16932. hlos_tid : 4,
  16933. who_classify_info_sel : 2,
  16934. flow_override : 1,
  16935. ast_list_idx : 4,
  16936. reserved :17;
  16937. A_UINT32 tgt_opaque_id :24,
  16938. reserved1 : 8;
  16939. } POSTPACK;
  16940. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16941. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16942. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16943. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16944. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16945. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16946. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16947. do { \
  16948. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16949. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16950. } while (0)
  16951. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16952. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16953. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16954. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16955. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16956. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16957. do { \
  16958. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16959. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16960. } while (0)
  16961. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16962. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16963. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16964. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16965. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16966. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16967. do { \
  16968. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16969. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16970. } while (0)
  16971. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16972. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16973. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16974. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16975. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16976. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16977. do { \
  16978. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16979. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16980. } while (0)
  16981. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16982. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16983. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16984. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16985. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16986. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16987. do { \
  16988. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16989. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16990. } while (0)
  16991. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16992. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16993. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16994. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16995. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16996. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16997. do { \
  16998. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16999. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17000. } while (0)
  17001. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17002. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17003. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17004. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17005. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17006. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17007. do { \
  17008. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17009. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17010. } while (0)
  17011. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17012. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17013. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17014. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17015. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17016. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17017. do { \
  17018. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17019. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17020. } while (0)
  17021. /**
  17022. * @brief target -> PPDU id format indication
  17023. *
  17024. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17025. *
  17026. * @details
  17027. * The following field definitions describe the format of the HTT target
  17028. * to host PPDU ID format indication message.
  17029. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17030. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17031. * seq_idx :- Sequence control index of this PPDU.
  17032. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17033. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17034. * tqm_cmd:-
  17035. *
  17036. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17037. * |--------------------------------------------------+------------------------|
  17038. * | rsvd0 | msg type |
  17039. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17040. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17041. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17042. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17043. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17044. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17045. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17046. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17047. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17048. * Where: OF = bit offset, NB = number of bits, V = valid
  17049. * The message is interpreted as follows:
  17050. *
  17051. * dword0 - b'7:0 - msg_type: This will be set to
  17052. * HTT_T2H_PPDU_ID_FMT_IND
  17053. * value: 0x30
  17054. *
  17055. * dword0 - b'31:8 - reserved
  17056. *
  17057. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17058. *
  17059. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17060. *
  17061. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17062. *
  17063. * dword1 - b'15:11 - reserved for future use
  17064. *
  17065. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17066. *
  17067. * dword1 - b'21:17 - number of bits in ring_id
  17068. *
  17069. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17070. *
  17071. * dword1 - b'31:27 - reserved for future use
  17072. *
  17073. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17074. *
  17075. * dword2 - b'5:1 - number of bits in sequence index
  17076. *
  17077. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17078. *
  17079. * dword2 - b'15:11 - reserved for future use
  17080. *
  17081. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17082. *
  17083. * dword2 - b'21:17 - number of bits in link_id
  17084. *
  17085. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17086. *
  17087. * dword2 - b'31:27 - reserved for future use
  17088. *
  17089. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17090. *
  17091. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17092. *
  17093. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17094. *
  17095. * dword3 - b'15:11 - reserved for future use
  17096. *
  17097. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17098. *
  17099. * dword3 - b'21:17 - number of bits in tqm_cmd
  17100. *
  17101. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17102. *
  17103. * dword3 - b'31:27 - reserved for future use
  17104. *
  17105. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17106. *
  17107. * dword4 - b'5:1 - number of bits in mac_id
  17108. *
  17109. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17110. *
  17111. * dword4 - b'15:11 - reserved for future use
  17112. *
  17113. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17114. *
  17115. * dword4 - b'21:17 - number of bits in crc
  17116. *
  17117. * dword4 - b'26:22 - offset of crc (in number of bits)
  17118. *
  17119. * dword4 - b'31:27 - reserved for future use
  17120. *
  17121. */
  17122. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17123. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17124. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17125. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17126. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17127. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17128. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17129. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17130. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17131. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17132. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17133. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17134. /* macros for accessing lower 16 bits in dword */
  17135. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17136. do { \
  17137. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17138. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17139. } while (0)
  17140. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17141. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17142. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17143. do { \
  17144. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17145. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17146. } while (0)
  17147. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17148. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17149. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17150. do { \
  17151. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17152. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17153. } while (0)
  17154. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17155. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17156. /* macros for accessing upper 16 bits in dword */
  17157. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17158. do { \
  17159. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17160. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17161. } while (0)
  17162. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17163. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17164. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17165. do { \
  17166. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17167. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17168. } while (0)
  17169. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17170. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17171. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17172. do { \
  17173. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17174. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17175. } while (0)
  17176. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17177. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17178. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17179. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17180. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17181. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17182. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17183. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17184. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17185. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17186. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17187. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17188. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17189. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17190. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17191. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17192. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17193. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17194. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17195. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17196. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17197. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17198. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17199. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17200. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17201. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17202. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17203. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17204. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17205. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17206. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17207. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17208. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17209. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17210. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17211. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17212. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17213. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17214. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17215. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17216. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17217. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17218. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17219. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17220. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17221. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17222. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17223. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17224. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17225. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17226. /* offsets in number dwords */
  17227. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17228. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17229. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17230. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17231. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17232. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17233. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17234. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17235. typedef struct {
  17236. A_UINT32 msg_type: 8, /* bits 7:0 */
  17237. rsvd0: 24;/* bits 31:8 */
  17238. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17239. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17240. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17241. rsvd1: 5, /* bits 15:11 */
  17242. ring_id_valid: 1, /* bits 16:16 */
  17243. ring_id_bits: 5, /* bits 21:17 */
  17244. ring_id_offset: 5, /* bits 26:22 */
  17245. rsvd2: 5; /* bits 31:27 */
  17246. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17247. seq_idx_bits: 5, /* bits 5:1 */
  17248. seq_idx_offset: 5, /* bits 10:6 */
  17249. rsvd3: 5, /* bits 15:11 */
  17250. link_id_valid: 1, /* bits 16:16 */
  17251. link_id_bits: 5, /* bits 21:17 */
  17252. link_id_offset: 5, /* bits 26:22 */
  17253. rsvd4: 5; /* bits 31:27 */
  17254. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17255. seq_cmd_type_bits: 5, /* bits 5:1 */
  17256. seq_cmd_type_offset: 5, /* bits 10:6 */
  17257. rsvd5: 5, /* bits 15:11 */
  17258. tqm_cmd_valid: 1, /* bits 16:16 */
  17259. tqm_cmd_bits: 5, /* bits 21:17 */
  17260. tqm_cmd_offset: 5, /* bits 26:12 */
  17261. rsvd6: 5; /* bits 31:27 */
  17262. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17263. mac_id_bits: 5, /* bits 5:1 */
  17264. mac_id_offset: 5, /* bits 10:6 */
  17265. rsvd8: 5, /* bits 15:11 */
  17266. crc_valid: 1, /* bits 16:16 */
  17267. crc_bits: 5, /* bits 21:17 */
  17268. crc_offset: 5, /* bits 26:12 */
  17269. rsvd9: 5; /* bits 31:27 */
  17270. } htt_t2h_ppdu_id_fmt_ind_t;
  17271. #endif