htt.h 882 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. */
  232. #define HTT_CURRENT_VERSION_MAJOR 3
  233. #define HTT_CURRENT_VERSION_MINOR 110
  234. #define HTT_NUM_TX_FRAG_DESC 1024
  235. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  236. #define HTT_CHECK_SET_VAL(field, val) \
  237. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  238. /* macros to assist in sign-extending fields from HTT messages */
  239. #define HTT_SIGN_BIT_MASK(field) \
  240. ((field ## _M + (1 << field ## _S)) >> 1)
  241. #define HTT_SIGN_BIT(_val, field) \
  242. (_val & HTT_SIGN_BIT_MASK(field))
  243. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  244. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  245. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  246. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  247. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  248. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  249. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  250. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  251. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  252. /*
  253. * TEMPORARY:
  254. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  255. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  256. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  257. * updated.
  258. */
  259. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  260. /*
  261. * TEMPORARY:
  262. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  263. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  264. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  265. * updated.
  266. */
  267. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  268. /**
  269. * htt_dbg_stats_type -
  270. * bit positions for each stats type within a stats type bitmask
  271. * The bitmask contains 24 bits.
  272. */
  273. enum htt_dbg_stats_type {
  274. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  275. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  276. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  277. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  278. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  279. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  280. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  281. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  282. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  283. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  284. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  285. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  286. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  287. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  288. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  289. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  290. /* bits 16-23 currently reserved */
  291. /* keep this last */
  292. HTT_DBG_NUM_STATS
  293. };
  294. /*=== HTT option selection TLVs ===
  295. * Certain HTT messages have alternatives or options.
  296. * For such cases, the host and target need to agree on which option to use.
  297. * Option specification TLVs can be appended to the VERSION_REQ and
  298. * VERSION_CONF messages to select options other than the default.
  299. * These TLVs are entirely optional - if they are not provided, there is a
  300. * well-defined default for each option. If they are provided, they can be
  301. * provided in any order. Each TLV can be present or absent independent of
  302. * the presence / absence of other TLVs.
  303. *
  304. * The HTT option selection TLVs use the following format:
  305. * |31 16|15 8|7 0|
  306. * |---------------------------------+----------------+----------------|
  307. * | value (payload) | length | tag |
  308. * |-------------------------------------------------------------------|
  309. * The value portion need not be only 2 bytes; it can be extended by any
  310. * integer number of 4-byte units. The total length of the TLV, including
  311. * the tag and length fields, must be a multiple of 4 bytes. The length
  312. * field specifies the total TLV size in 4-byte units. Thus, the typical
  313. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  314. * field, would store 0x1 in its length field, to show that the TLV occupies
  315. * a single 4-byte unit.
  316. */
  317. /*--- TLV header format - applies to all HTT option TLVs ---*/
  318. enum HTT_OPTION_TLV_TAGS {
  319. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  320. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  321. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  322. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  323. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  324. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  325. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  326. };
  327. #define HTT_TCL_METADATA_VER_SZ 4
  328. PREPACK struct htt_option_tlv_header_t {
  329. A_UINT8 tag;
  330. A_UINT8 length;
  331. } POSTPACK;
  332. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  333. #define HTT_OPTION_TLV_TAG_S 0
  334. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  335. #define HTT_OPTION_TLV_LENGTH_S 8
  336. /*
  337. * value0 - 16 bit value field stored in word0
  338. * The TLV's value field may be longer than 2 bytes, in which case
  339. * the remainder of the value is stored in word1, word2, etc.
  340. */
  341. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  342. #define HTT_OPTION_TLV_VALUE0_S 16
  343. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  344. do { \
  345. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  346. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  347. } while (0)
  348. #define HTT_OPTION_TLV_TAG_GET(word) \
  349. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  350. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  351. do { \
  352. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  353. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  354. } while (0)
  355. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  356. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  357. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  358. do { \
  359. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  360. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  361. } while (0)
  362. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  363. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  364. /*--- format of specific HTT option TLVs ---*/
  365. /*
  366. * HTT option TLV for specifying LL bus address size
  367. * Some chips require bus addresses used by the target to access buffers
  368. * within the host's memory to be 32 bits; others require bus addresses
  369. * used by the target to access buffers within the host's memory to be
  370. * 64 bits.
  371. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  372. * a suffix to the VERSION_CONF message to specify which bus address format
  373. * the target requires.
  374. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  375. * default to providing bus addresses to the target in 32-bit format.
  376. */
  377. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  378. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  379. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  380. };
  381. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  382. struct htt_option_tlv_header_t hdr;
  383. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  384. } POSTPACK;
  385. /*
  386. * HTT option TLV for specifying whether HL systems should indicate
  387. * over-the-air tx completion for individual frames, or should instead
  388. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  389. * requests an OTA tx completion for a particular tx frame.
  390. * This option does not apply to LL systems, where the TX_COMPL_IND
  391. * is mandatory.
  392. * This option is primarily intended for HL systems in which the tx frame
  393. * downloads over the host --> target bus are as slow as or slower than
  394. * the transmissions over the WLAN PHY. For cases where the bus is faster
  395. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  396. * and consequently will send one TX_COMPL_IND message that covers several
  397. * tx frames. For cases where the WLAN PHY is faster than the bus,
  398. * the target will end up transmitting very short A-MPDUs, and consequently
  399. * sending many TX_COMPL_IND messages, which each cover a very small number
  400. * of tx frames.
  401. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  402. * a suffix to the VERSION_REQ message to request whether the host desires to
  403. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  404. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  405. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  406. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  407. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  408. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  409. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  410. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  411. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  412. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  413. * TLV.
  414. */
  415. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  416. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  417. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  418. };
  419. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  420. struct htt_option_tlv_header_t hdr;
  421. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  422. } POSTPACK;
  423. /*
  424. * HTT option TLV for specifying how many tx queue groups the target
  425. * may establish.
  426. * This TLV specifies the maximum value the target may send in the
  427. * txq_group_id field of any TXQ_GROUP information elements sent by
  428. * the target to the host. This allows the host to pre-allocate an
  429. * appropriate number of tx queue group structs.
  430. *
  431. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  432. * a suffix to the VERSION_REQ message to specify whether the host supports
  433. * tx queue groups at all, and if so if there is any limit on the number of
  434. * tx queue groups that the host supports.
  435. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  436. * a suffix to the VERSION_CONF message. If the host has specified in the
  437. * VER_REQ message a limit on the number of tx queue groups the host can
  438. * support, the target shall limit its specification of the maximum tx groups
  439. * to be no larger than this host-specified limit.
  440. *
  441. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  442. * shall preallocate 4 tx queue group structs, and the target shall not
  443. * specify a txq_group_id larger than 3.
  444. */
  445. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  446. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  447. /*
  448. * values 1 through N specify the max number of tx queue groups
  449. * the sender supports
  450. */
  451. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  452. };
  453. /* TEMPORARY backwards-compatibility alias for a typo fix -
  454. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  455. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  456. * to support the old name (with the typo) until all references to the
  457. * old name are replaced with the new name.
  458. */
  459. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  460. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  461. struct htt_option_tlv_header_t hdr;
  462. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  463. } POSTPACK;
  464. /*
  465. * HTT option TLV for specifying whether the target supports an extended
  466. * version of the HTT tx descriptor. If the target provides this TLV
  467. * and specifies in the TLV that the target supports an extended version
  468. * of the HTT tx descriptor, the target must check the "extension" bit in
  469. * the HTT tx descriptor, and if the extension bit is set, to expect a
  470. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  471. * descriptor. Furthermore, the target must provide room for the HTT
  472. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  473. * This option is intended for systems where the host needs to explicitly
  474. * control the transmission parameters such as tx power for individual
  475. * tx frames.
  476. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  477. * as a suffix to the VERSION_CONF message to explicitly specify whether
  478. * the target supports the HTT tx MSDU extension descriptor.
  479. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  480. * by the host as lack of target support for the HTT tx MSDU extension
  481. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  482. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  483. * the HTT tx MSDU extension descriptor.
  484. * The host is not required to provide the HTT tx MSDU extension descriptor
  485. * just because the target supports it; the target must check the
  486. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  487. * extension descriptor is present.
  488. */
  489. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  490. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  491. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  492. };
  493. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  494. struct htt_option_tlv_header_t hdr;
  495. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  496. } POSTPACK;
  497. /*
  498. * For the tcl data command V2 and higher support added a new
  499. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  500. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  501. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  502. * HTT option TLV for specifying which version of the TCL metadata struct
  503. * should be used:
  504. * V1 -> use htt_tx_tcl_metadata struct
  505. * V2 -> use htt_tx_tcl_metadata_v2 struct
  506. * Old FW will only support V1.
  507. * New FW will support V2. New FW will still support V1, at least during
  508. * a transition period.
  509. * Similarly, old host will only support V1, and new host will support V1 + V2.
  510. *
  511. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  512. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  513. * of TCL metadata the host supports. If the host doesn't provide a
  514. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  515. * is implicitly understood that the host only supports V1.
  516. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  517. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  518. * the host shall use. The target shall only select one of the versions
  519. * supported by the host. If the target doesn't provide a
  520. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  521. * is implicitly understood that the V1 TCL metadata shall be used.
  522. */
  523. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  524. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  525. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  526. };
  527. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  528. struct htt_option_tlv_header_t hdr;
  529. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  530. } POSTPACK;
  531. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  532. HTT_OPTION_TLV_VALUE0_SET(word, value)
  533. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  534. HTT_OPTION_TLV_VALUE0_GET(word)
  535. typedef struct {
  536. union {
  537. /* BIT [11 : 0] :- tag
  538. * BIT [23 : 12] :- length
  539. * BIT [31 : 24] :- reserved
  540. */
  541. A_UINT32 tag__length;
  542. /*
  543. * The following struct is not endian-portable.
  544. * It is suitable for use within the target, which is known to be
  545. * little-endian.
  546. * The host should use the above endian-portable macros to access
  547. * the tag and length bitfields in an endian-neutral manner.
  548. */
  549. struct {
  550. A_UINT32 tag : 12, /* BIT [11 : 0] */
  551. length : 12, /* BIT [23 : 12] */
  552. reserved : 8; /* BIT [31 : 24] */
  553. };
  554. };
  555. } htt_tlv_hdr_t;
  556. /** HTT stats TLV tag values */
  557. typedef enum {
  558. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  559. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  560. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  561. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  562. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  563. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  564. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  565. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  566. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  567. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  568. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  569. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  570. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  571. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  572. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  573. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  574. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  575. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  576. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  577. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  578. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  579. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  580. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  581. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  582. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  583. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  584. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  585. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  586. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  587. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  588. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  589. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  590. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  591. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  592. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  593. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  594. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  595. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  596. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  597. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  598. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  599. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  600. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  601. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  602. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  603. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  604. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  605. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  606. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  607. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  608. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  609. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  610. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  611. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  612. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  613. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  614. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  615. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  616. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  617. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  618. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  619. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  620. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  621. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  622. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  623. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  624. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  625. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  626. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  627. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  628. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  629. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  630. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  631. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  632. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  633. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  634. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  635. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  636. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  637. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  638. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  639. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  640. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  641. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  642. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  643. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  644. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  645. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  646. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  647. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  648. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  649. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  650. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  651. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  652. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  653. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  654. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  655. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  656. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  657. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  658. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  659. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  660. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  661. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  662. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  663. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  664. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  665. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  666. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  667. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  668. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  669. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  670. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  671. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  672. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  673. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  674. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  675. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  676. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  677. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  678. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  679. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  680. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  681. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  682. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  683. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  684. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  685. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  686. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  687. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  688. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  689. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  690. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  691. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  692. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  693. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  694. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  696. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  697. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  698. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  699. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  700. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  701. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  702. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  703. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  704. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  705. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  712. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  713. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  714. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  715. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  716. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  717. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  718. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  719. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  720. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  721. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  722. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  723. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  724. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  725. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  726. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  727. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v */
  728. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  729. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  730. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  731. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  732. HTT_STATS_MAX_TAG,
  733. } htt_stats_tlv_tag_t;
  734. /* retain deprecated enum name as an alias for the current enum name */
  735. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  736. #define HTT_STATS_TLV_TAG_M 0x00000fff
  737. #define HTT_STATS_TLV_TAG_S 0
  738. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  739. #define HTT_STATS_TLV_LENGTH_S 12
  740. #define HTT_STATS_TLV_TAG_GET(_var) \
  741. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  742. HTT_STATS_TLV_TAG_S)
  743. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  744. do { \
  745. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  746. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  747. } while (0)
  748. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  749. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  750. HTT_STATS_TLV_LENGTH_S)
  751. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  752. do { \
  753. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  754. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  755. } while (0)
  756. /*=== host -> target messages ===============================================*/
  757. enum htt_h2t_msg_type {
  758. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  759. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  760. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  761. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  762. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  763. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  764. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  765. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  766. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  767. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  768. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  769. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  770. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  771. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  772. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  773. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  774. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  775. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  776. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  777. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  778. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  779. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  780. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  781. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  782. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  783. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  784. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  785. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  786. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  787. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  788. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  789. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  790. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  791. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  792. /* keep this last */
  793. HTT_H2T_NUM_MSGS
  794. };
  795. /*
  796. * HTT host to target message type -
  797. * stored in bits 7:0 of the first word of the message
  798. */
  799. #define HTT_H2T_MSG_TYPE_M 0xff
  800. #define HTT_H2T_MSG_TYPE_S 0
  801. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  802. do { \
  803. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  804. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  805. } while (0)
  806. #define HTT_H2T_MSG_TYPE_GET(word) \
  807. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  808. /**
  809. * @brief host -> target version number request message definition
  810. *
  811. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  812. *
  813. *
  814. * |31 24|23 16|15 8|7 0|
  815. * |----------------+----------------+----------------+----------------|
  816. * | reserved | msg type |
  817. * |-------------------------------------------------------------------|
  818. * : option request TLV (optional) |
  819. * :...................................................................:
  820. *
  821. * The VER_REQ message may consist of a single 4-byte word, or may be
  822. * extended with TLVs that specify which HTT options the host is requesting
  823. * from the target.
  824. * The following option TLVs may be appended to the VER_REQ message:
  825. * - HL_SUPPRESS_TX_COMPL_IND
  826. * - HL_MAX_TX_QUEUE_GROUPS
  827. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  828. * may be appended to the VER_REQ message (but only one TLV of each type).
  829. *
  830. * Header fields:
  831. * - MSG_TYPE
  832. * Bits 7:0
  833. * Purpose: identifies this as a version number request message
  834. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  835. */
  836. #define HTT_VER_REQ_BYTES 4
  837. /* TBDXXX: figure out a reasonable number */
  838. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  839. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  840. /**
  841. * @brief HTT tx MSDU descriptor
  842. *
  843. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  844. *
  845. * @details
  846. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  847. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  848. * the target firmware needs for the FW's tx processing, particularly
  849. * for creating the HW msdu descriptor.
  850. * The same HTT tx descriptor is used for HL and LL systems, though
  851. * a few fields within the tx descriptor are used only by LL or
  852. * only by HL.
  853. * The HTT tx descriptor is defined in two manners: by a struct with
  854. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  855. * definitions.
  856. * The target should use the struct def, for simplicitly and clarity,
  857. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  858. * neutral. Specifically, the host shall use the get/set macros built
  859. * around the mask + shift defs.
  860. */
  861. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  862. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  863. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  864. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  865. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  866. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  867. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  868. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  869. #define HTT_TX_VDEV_ID_WORD 0
  870. #define HTT_TX_VDEV_ID_MASK 0x3f
  871. #define HTT_TX_VDEV_ID_SHIFT 16
  872. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  873. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  874. #define HTT_TX_MSDU_LEN_DWORD 1
  875. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  876. /*
  877. * HTT_VAR_PADDR macros
  878. * Allow physical / bus addresses to be either a single 32-bit value,
  879. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  880. */
  881. #define HTT_VAR_PADDR32(var_name) \
  882. A_UINT32 var_name
  883. #define HTT_VAR_PADDR64_LE(var_name) \
  884. struct { \
  885. /* little-endian: lo precedes hi */ \
  886. A_UINT32 lo; \
  887. A_UINT32 hi; \
  888. } var_name
  889. /*
  890. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  891. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  892. * addresses are stored in a XXX-bit field.
  893. * This macro is used to define both htt_tx_msdu_desc32_t and
  894. * htt_tx_msdu_desc64_t structs.
  895. */
  896. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  897. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  898. { \
  899. /* DWORD 0: flags and meta-data */ \
  900. A_UINT32 \
  901. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  902. \
  903. /* pkt_subtype - \
  904. * Detailed specification of the tx frame contents, extending the \
  905. * general specification provided by pkt_type. \
  906. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  907. * pkt_type | pkt_subtype \
  908. * ============================================================== \
  909. * 802.3 | bit 0:3 - Reserved \
  910. * | bit 4: 0x0 - Copy-Engine Classification Results \
  911. * | not appended to the HTT message \
  912. * | 0x1 - Copy-Engine Classification Results \
  913. * | appended to the HTT message in the \
  914. * | format: \
  915. * | [HTT tx desc, frame header, \
  916. * | CE classification results] \
  917. * | The CE classification results begin \
  918. * | at the next 4-byte boundary after \
  919. * | the frame header. \
  920. * ------------+------------------------------------------------- \
  921. * Eth2 | bit 0:3 - Reserved \
  922. * | bit 4: 0x0 - Copy-Engine Classification Results \
  923. * | not appended to the HTT message \
  924. * | 0x1 - Copy-Engine Classification Results \
  925. * | appended to the HTT message. \
  926. * | See the above specification of the \
  927. * | CE classification results location. \
  928. * ------------+------------------------------------------------- \
  929. * native WiFi | bit 0:3 - Reserved \
  930. * | bit 4: 0x0 - Copy-Engine Classification Results \
  931. * | not appended to the HTT message \
  932. * | 0x1 - Copy-Engine Classification Results \
  933. * | appended to the HTT message. \
  934. * | See the above specification of the \
  935. * | CE classification results location. \
  936. * ------------+------------------------------------------------- \
  937. * mgmt | 0x0 - 802.11 MAC header absent \
  938. * | 0x1 - 802.11 MAC header present \
  939. * ------------+------------------------------------------------- \
  940. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  941. * | 0x1 - 802.11 MAC header present \
  942. * | bit 1: 0x0 - allow aggregation \
  943. * | 0x1 - don't allow aggregation \
  944. * | bit 2: 0x0 - perform encryption \
  945. * | 0x1 - don't perform encryption \
  946. * | bit 3: 0x0 - perform tx classification / queuing \
  947. * | 0x1 - don't perform tx classification; \
  948. * | insert the frame into the "misc" \
  949. * | tx queue \
  950. * | bit 4: 0x0 - Copy-Engine Classification Results \
  951. * | not appended to the HTT message \
  952. * | 0x1 - Copy-Engine Classification Results \
  953. * | appended to the HTT message. \
  954. * | See the above specification of the \
  955. * | CE classification results location. \
  956. */ \
  957. pkt_subtype: 5, \
  958. \
  959. /* pkt_type - \
  960. * General specification of the tx frame contents. \
  961. * The htt_pkt_type enum should be used to specify and check the \
  962. * value of this field. \
  963. */ \
  964. pkt_type: 3, \
  965. \
  966. /* vdev_id - \
  967. * ID for the vdev that is sending this tx frame. \
  968. * For certain non-standard packet types, e.g. pkt_type == raw \
  969. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  970. * This field is used primarily for determining where to queue \
  971. * broadcast and multicast frames. \
  972. */ \
  973. vdev_id: 6, \
  974. /* ext_tid - \
  975. * The extended traffic ID. \
  976. * If the TID is unknown, the extended TID is set to \
  977. * HTT_TX_EXT_TID_INVALID. \
  978. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  979. * value of the QoS TID. \
  980. * If the tx frame is non-QoS data, then the extended TID is set to \
  981. * HTT_TX_EXT_TID_NON_QOS. \
  982. * If the tx frame is multicast or broadcast, then the extended TID \
  983. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  984. */ \
  985. ext_tid: 5, \
  986. \
  987. /* postponed - \
  988. * This flag indicates whether the tx frame has been downloaded to \
  989. * the target before but discarded by the target, and now is being \
  990. * downloaded again; or if this is a new frame that is being \
  991. * downloaded for the first time. \
  992. * This flag allows the target to determine the correct order for \
  993. * transmitting new vs. old frames. \
  994. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  995. * This flag only applies to HL systems, since in LL systems, \
  996. * the tx flow control is handled entirely within the target. \
  997. */ \
  998. postponed: 1, \
  999. \
  1000. /* extension - \
  1001. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1002. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1003. * \
  1004. * 0x0 - no extension MSDU descriptor is present \
  1005. * 0x1 - an extension MSDU descriptor immediately follows the \
  1006. * regular MSDU descriptor \
  1007. */ \
  1008. extension: 1, \
  1009. \
  1010. /* cksum_offload - \
  1011. * This flag indicates whether checksum offload is enabled or not \
  1012. * for this frame. Target FW use this flag to turn on HW checksumming \
  1013. * 0x0 - No checksum offload \
  1014. * 0x1 - L3 header checksum only \
  1015. * 0x2 - L4 checksum only \
  1016. * 0x3 - L3 header checksum + L4 checksum \
  1017. */ \
  1018. cksum_offload: 2, \
  1019. \
  1020. /* tx_comp_req - \
  1021. * This flag indicates whether Tx Completion \
  1022. * from fw is required or not. \
  1023. * This flag is only relevant if tx completion is not \
  1024. * universally enabled. \
  1025. * For all LL systems, tx completion is mandatory, \
  1026. * so this flag will be irrelevant. \
  1027. * For HL systems tx completion is optional, but HL systems in which \
  1028. * the bus throughput exceeds the WLAN throughput will \
  1029. * probably want to always use tx completion, and thus \
  1030. * would not check this flag. \
  1031. * This flag is required when tx completions are not used universally, \
  1032. * but are still required for certain tx frames for which \
  1033. * an OTA delivery acknowledgment is needed by the host. \
  1034. * In practice, this would be for HL systems in which the \
  1035. * bus throughput is less than the WLAN throughput. \
  1036. * \
  1037. * 0x0 - Tx Completion Indication from Fw not required \
  1038. * 0x1 - Tx Completion Indication from Fw is required \
  1039. */ \
  1040. tx_compl_req: 1; \
  1041. \
  1042. \
  1043. /* DWORD 1: MSDU length and ID */ \
  1044. A_UINT32 \
  1045. len: 16, /* MSDU length, in bytes */ \
  1046. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1047. * and this id is used to calculate fragmentation \
  1048. * descriptor pointer inside the target based on \
  1049. * the base address, configured inside the target. \
  1050. */ \
  1051. \
  1052. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1053. /* frags_desc_ptr - \
  1054. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1055. * where the tx frame's fragments reside in memory. \
  1056. * This field only applies to LL systems, since in HL systems the \
  1057. * (degenerate single-fragment) fragmentation descriptor is created \
  1058. * within the target. \
  1059. */ \
  1060. _paddr__frags_desc_ptr_; \
  1061. \
  1062. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1063. /* \
  1064. * Peer ID : Target can use this value to know which peer-id packet \
  1065. * destined to. \
  1066. * It's intended to be specified by host in case of NAWDS. \
  1067. */ \
  1068. A_UINT16 peerid; \
  1069. \
  1070. /* \
  1071. * Channel frequency: This identifies the desired channel \
  1072. * frequency (in mhz) for tx frames. This is used by FW to help \
  1073. * determine when it is safe to transmit or drop frames for \
  1074. * off-channel operation. \
  1075. * The default value of zero indicates to FW that the corresponding \
  1076. * VDEV's home channel (if there is one) is the desired channel \
  1077. * frequency. \
  1078. */ \
  1079. A_UINT16 chanfreq; \
  1080. \
  1081. /* Reason reserved is commented is increasing the htt structure size \
  1082. * leads to some weird issues. \
  1083. * A_UINT32 reserved_dword3_bits0_31; \
  1084. */ \
  1085. } POSTPACK
  1086. /* define a htt_tx_msdu_desc32_t type */
  1087. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1088. /* define a htt_tx_msdu_desc64_t type */
  1089. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1090. /*
  1091. * Make htt_tx_msdu_desc_t be an alias for either
  1092. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1093. */
  1094. #if HTT_PADDR64
  1095. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1096. #else
  1097. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1098. #endif
  1099. /* decriptor information for Management frame*/
  1100. /*
  1101. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1102. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1103. */
  1104. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1105. extern A_UINT32 mgmt_hdr_len;
  1106. PREPACK struct htt_mgmt_tx_desc_t {
  1107. A_UINT32 msg_type;
  1108. #if HTT_PADDR64
  1109. A_UINT64 frag_paddr; /* DMAble address of the data */
  1110. #else
  1111. A_UINT32 frag_paddr; /* DMAble address of the data */
  1112. #endif
  1113. A_UINT32 desc_id; /* returned to host during completion
  1114. * to free the meory*/
  1115. A_UINT32 len; /* Fragment length */
  1116. A_UINT32 vdev_id; /* virtual device ID*/
  1117. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1118. } POSTPACK;
  1119. PREPACK struct htt_mgmt_tx_compl_ind {
  1120. A_UINT32 desc_id;
  1121. A_UINT32 status;
  1122. } POSTPACK;
  1123. /*
  1124. * This SDU header size comes from the summation of the following:
  1125. * 1. Max of:
  1126. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1127. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1128. * b. 802.11 header, for raw frames: 36 bytes
  1129. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1130. * QoS header, HT header)
  1131. * c. 802.3 header, for ethernet frames: 14 bytes
  1132. * (destination address, source address, ethertype / length)
  1133. * 2. Max of:
  1134. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1135. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1136. * 3. 802.1Q VLAN header: 4 bytes
  1137. * 4. LLC/SNAP header: 8 bytes
  1138. */
  1139. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1140. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1141. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1142. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1143. A_COMPILE_TIME_ASSERT(
  1144. htt_encap_hdr_size_max_check_nwifi,
  1145. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1146. A_COMPILE_TIME_ASSERT(
  1147. htt_encap_hdr_size_max_check_enet,
  1148. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1149. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1150. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1151. #define HTT_TX_HDR_SIZE_802_1Q 4
  1152. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1153. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1154. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1155. HTT_TX_HDR_SIZE_802_1Q + \
  1156. HTT_TX_HDR_SIZE_LLC_SNAP)
  1157. #define HTT_HL_TX_FRM_HDR_LEN \
  1158. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1159. #define HTT_LL_TX_FRM_HDR_LEN \
  1160. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1161. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1162. /* dword 0 */
  1163. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1164. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1165. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1166. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1167. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1168. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1169. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1170. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1171. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1172. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1173. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1174. #define HTT_TX_DESC_PKT_TYPE_S 13
  1175. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1176. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1177. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1178. #define HTT_TX_DESC_VDEV_ID_S 16
  1179. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1180. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1181. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1182. #define HTT_TX_DESC_EXT_TID_S 22
  1183. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1184. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1185. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1186. #define HTT_TX_DESC_POSTPONED_S 27
  1187. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1188. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1189. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1190. #define HTT_TX_DESC_EXTENSION_S 28
  1191. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1192. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1193. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1194. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1195. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1196. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1197. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1198. #define HTT_TX_DESC_TX_COMP_S 31
  1199. /* dword 1 */
  1200. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1201. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1202. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1203. #define HTT_TX_DESC_FRM_LEN_S 0
  1204. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1205. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1206. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1207. #define HTT_TX_DESC_FRM_ID_S 16
  1208. /* dword 2 */
  1209. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1210. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1211. /* for systems using 64-bit format for bus addresses */
  1212. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1213. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1214. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1215. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1216. /* for systems using 32-bit format for bus addresses */
  1217. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1218. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1219. /* dword 3 */
  1220. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1221. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1222. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1223. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1224. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1225. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1226. #if HTT_PADDR64
  1227. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1228. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1229. #else
  1230. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1231. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1232. #endif
  1233. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1234. #define HTT_TX_DESC_PEER_ID_S 0
  1235. /*
  1236. * TEMPORARY:
  1237. * The original definitions for the PEER_ID fields contained typos
  1238. * (with _DESC_PADDR appended to this PEER_ID field name).
  1239. * Retain deprecated original names for PEER_ID fields until all code that
  1240. * refers to them has been updated.
  1241. */
  1242. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1243. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1244. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1245. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1246. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1247. HTT_TX_DESC_PEER_ID_M
  1248. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1249. HTT_TX_DESC_PEER_ID_S
  1250. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1251. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1252. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1253. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1254. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1255. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1256. #if HTT_PADDR64
  1257. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1258. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1259. #else
  1260. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1261. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1262. #endif
  1263. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1264. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1265. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1266. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1267. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1271. } while (0)
  1272. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1273. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1274. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1277. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1278. } while (0)
  1279. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1280. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1281. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1282. do { \
  1283. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1284. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1285. } while (0)
  1286. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1287. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1288. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1292. } while (0)
  1293. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1294. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1295. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1299. } while (0)
  1300. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1301. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1302. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1306. } while (0)
  1307. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1308. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1309. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1313. } while (0)
  1314. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1315. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1316. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1320. } while (0)
  1321. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1322. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1323. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1327. } while (0)
  1328. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1329. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1330. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1334. } while (0)
  1335. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1336. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1337. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1340. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1341. } while (0)
  1342. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1343. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1344. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1348. } while (0)
  1349. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1350. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1351. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1355. } while (0)
  1356. /* enums used in the HTT tx MSDU extension descriptor */
  1357. enum {
  1358. htt_tx_guard_interval_regular = 0,
  1359. htt_tx_guard_interval_short = 1,
  1360. };
  1361. enum {
  1362. htt_tx_preamble_type_ofdm = 0,
  1363. htt_tx_preamble_type_cck = 1,
  1364. htt_tx_preamble_type_ht = 2,
  1365. htt_tx_preamble_type_vht = 3,
  1366. };
  1367. enum {
  1368. htt_tx_bandwidth_5MHz = 0,
  1369. htt_tx_bandwidth_10MHz = 1,
  1370. htt_tx_bandwidth_20MHz = 2,
  1371. htt_tx_bandwidth_40MHz = 3,
  1372. htt_tx_bandwidth_80MHz = 4,
  1373. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1374. };
  1375. /**
  1376. * @brief HTT tx MSDU extension descriptor
  1377. * @details
  1378. * If the target supports HTT tx MSDU extension descriptors, the host has
  1379. * the option of appending the following struct following the regular
  1380. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1381. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1382. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1383. * tx specs for each frame.
  1384. */
  1385. PREPACK struct htt_tx_msdu_desc_ext_t {
  1386. /* DWORD 0: flags */
  1387. A_UINT32
  1388. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1389. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1390. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1391. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1392. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1393. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1394. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1395. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1396. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1397. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1398. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1399. /* DWORD 1: tx power, tx rate, tx BW */
  1400. A_UINT32
  1401. /* pwr -
  1402. * Specify what power the tx frame needs to be transmitted at.
  1403. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1404. * The value needs to be appropriately sign-extended when extracting
  1405. * the value from the message and storing it in a variable that is
  1406. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1407. * automatically handles this sign-extension.)
  1408. * If the transmission uses multiple tx chains, this power spec is
  1409. * the total transmit power, assuming incoherent combination of
  1410. * per-chain power to produce the total power.
  1411. */
  1412. pwr: 8,
  1413. /* mcs_mask -
  1414. * Specify the allowable values for MCS index (modulation and coding)
  1415. * to use for transmitting the frame.
  1416. *
  1417. * For HT / VHT preamble types, this mask directly corresponds to
  1418. * the HT or VHT MCS indices that are allowed. For each bit N set
  1419. * within the mask, MCS index N is allowed for transmitting the frame.
  1420. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1421. * rates versus OFDM rates, so the host has the option of specifying
  1422. * that the target must transmit the frame with CCK or OFDM rates
  1423. * (not HT or VHT), but leaving the decision to the target whether
  1424. * to use CCK or OFDM.
  1425. *
  1426. * For CCK and OFDM, the bits within this mask are interpreted as
  1427. * follows:
  1428. * bit 0 -> CCK 1 Mbps rate is allowed
  1429. * bit 1 -> CCK 2 Mbps rate is allowed
  1430. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1431. * bit 3 -> CCK 11 Mbps rate is allowed
  1432. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1433. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1434. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1435. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1436. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1437. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1438. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1439. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1440. *
  1441. * The MCS index specification needs to be compatible with the
  1442. * bandwidth mask specification. For example, a MCS index == 9
  1443. * specification is inconsistent with a preamble type == VHT,
  1444. * Nss == 1, and channel bandwidth == 20 MHz.
  1445. *
  1446. * Furthermore, the host has only a limited ability to specify to
  1447. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1448. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1449. */
  1450. mcs_mask: 12,
  1451. /* nss_mask -
  1452. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1453. * Each bit in this mask corresponds to a Nss value:
  1454. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1455. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1456. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1457. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1458. * The values in the Nss mask must be suitable for the recipient, e.g.
  1459. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1460. * recipient which only supports 2x2 MIMO.
  1461. */
  1462. nss_mask: 4,
  1463. /* guard_interval -
  1464. * Specify a htt_tx_guard_interval enum value to indicate whether
  1465. * the transmission should use a regular guard interval or a
  1466. * short guard interval.
  1467. */
  1468. guard_interval: 1,
  1469. /* preamble_type_mask -
  1470. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1471. * may choose from for transmitting this frame.
  1472. * The bits in this mask correspond to the values in the
  1473. * htt_tx_preamble_type enum. For example, to allow the target
  1474. * to transmit the frame as either CCK or OFDM, this field would
  1475. * be set to
  1476. * (1 << htt_tx_preamble_type_ofdm) |
  1477. * (1 << htt_tx_preamble_type_cck)
  1478. */
  1479. preamble_type_mask: 4,
  1480. reserved1_31_29: 3; /* unused, set to 0x0 */
  1481. /* DWORD 2: tx chain mask, tx retries */
  1482. A_UINT32
  1483. /* chain_mask - specify which chains to transmit from */
  1484. chain_mask: 4,
  1485. /* retry_limit -
  1486. * Specify the maximum number of transmissions, including the
  1487. * initial transmission, to attempt before giving up if no ack
  1488. * is received.
  1489. * If the tx rate is specified, then all retries shall use the
  1490. * same rate as the initial transmission.
  1491. * If no tx rate is specified, the target can choose whether to
  1492. * retain the original rate during the retransmissions, or to
  1493. * fall back to a more robust rate.
  1494. */
  1495. retry_limit: 4,
  1496. /* bandwidth_mask -
  1497. * Specify what channel widths may be used for the transmission.
  1498. * A value of zero indicates "don't care" - the target may choose
  1499. * the transmission bandwidth.
  1500. * The bits within this mask correspond to the htt_tx_bandwidth
  1501. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1502. * The bandwidth_mask must be consistent with the preamble_type_mask
  1503. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1504. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1505. */
  1506. bandwidth_mask: 6,
  1507. reserved2_31_14: 18; /* unused, set to 0x0 */
  1508. /* DWORD 3: tx expiry time (TSF) LSBs */
  1509. A_UINT32 expire_tsf_lo;
  1510. /* DWORD 4: tx expiry time (TSF) MSBs */
  1511. A_UINT32 expire_tsf_hi;
  1512. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1513. } POSTPACK;
  1514. /* DWORD 0 */
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1535. /* DWORD 1 */
  1536. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1537. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1538. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1539. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1540. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1541. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1542. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1543. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1544. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1545. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1546. /* DWORD 2 */
  1547. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1548. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1549. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1550. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1551. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1552. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1553. /* DWORD 0 */
  1554. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1555. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1556. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1557. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1558. do { \
  1559. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1560. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1561. } while (0)
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1563. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1564. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1565. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1566. do { \
  1567. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1568. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1569. } while (0)
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1571. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1572. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1573. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1574. do { \
  1575. HTT_CHECK_SET_VAL( \
  1576. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1577. ((_var) |= ((_val) \
  1578. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1579. } while (0)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1582. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1583. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1584. do { \
  1585. HTT_CHECK_SET_VAL( \
  1586. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1587. ((_var) |= ((_val) \
  1588. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1589. } while (0)
  1590. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1591. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1592. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1593. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1594. do { \
  1595. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1596. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1597. } while (0)
  1598. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1599. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1600. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1601. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1602. do { \
  1603. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1604. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1605. } while (0)
  1606. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1607. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1608. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1609. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1610. do { \
  1611. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1612. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1613. } while (0)
  1614. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1615. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1616. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1617. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1618. do { \
  1619. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1620. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1621. } while (0)
  1622. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1624. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1625. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1628. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1629. } while (0)
  1630. /* DWORD 1 */
  1631. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1633. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1634. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1635. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1636. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1637. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1638. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1639. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1640. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1641. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1642. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1643. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1646. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1647. } while (0)
  1648. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1650. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1651. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1652. do { \
  1653. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1654. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1655. } while (0)
  1656. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1657. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1658. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1659. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1660. do { \
  1661. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1662. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1663. } while (0)
  1664. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1665. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1666. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1667. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1668. do { \
  1669. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1670. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1671. } while (0)
  1672. /* DWORD 2 */
  1673. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1674. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1675. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1676. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1679. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1680. } while (0)
  1681. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1682. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1683. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1684. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1685. do { \
  1686. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1687. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1688. } while (0)
  1689. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1690. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1691. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1692. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1693. do { \
  1694. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1695. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1696. } while (0)
  1697. typedef enum {
  1698. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1699. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1700. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1701. } htt_11ax_ltf_subtype_t;
  1702. typedef enum {
  1703. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1704. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1705. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1706. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1707. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1708. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1709. } htt_tx_ext2_preamble_type_t;
  1710. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1711. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1712. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1713. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1714. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1715. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1716. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1717. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1718. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1719. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1720. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1722. /**
  1723. * @brief HTT tx MSDU extension descriptor v2
  1724. * @details
  1725. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1726. * is received as tcl_exit_base->host_meta_info in firmware.
  1727. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1728. * are already part of tcl_exit_base.
  1729. */
  1730. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1731. /* DWORD 0: flags */
  1732. A_UINT32
  1733. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1734. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1735. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1736. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1737. valid_retries : 1, /* if set, tx retries spec is valid */
  1738. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1739. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1740. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1741. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1742. valid_key_flags : 1, /* if set, key flags is valid */
  1743. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1744. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1745. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1746. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1747. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1748. 1 = ENCRYPT,
  1749. 2 ~ 3 - Reserved */
  1750. /* retry_limit -
  1751. * Specify the maximum number of transmissions, including the
  1752. * initial transmission, to attempt before giving up if no ack
  1753. * is received.
  1754. * If the tx rate is specified, then all retries shall use the
  1755. * same rate as the initial transmission.
  1756. * If no tx rate is specified, the target can choose whether to
  1757. * retain the original rate during the retransmissions, or to
  1758. * fall back to a more robust rate.
  1759. */
  1760. retry_limit : 4,
  1761. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1762. * Valid only for 11ax preamble types HE_SU
  1763. * and HE_EXT_SU
  1764. */
  1765. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1766. * Valid only for 11ax preamble types HE_SU
  1767. * and HE_EXT_SU
  1768. */
  1769. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1770. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1771. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1772. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1773. */
  1774. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1775. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1776. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1777. * Use cases:
  1778. * Any time firmware uses TQM-BYPASS for Data
  1779. * TID, firmware expect host to set this bit.
  1780. */
  1781. /* DWORD 1: tx power, tx rate */
  1782. A_UINT32
  1783. power : 8, /* unit of the power field is 0.5 dbm
  1784. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1785. * signed value ranging from -64dbm to 63.5 dbm
  1786. */
  1787. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1788. * Setting more than one MCS isn't currently
  1789. * supported by the target (but is supported
  1790. * in the interface in case in the future
  1791. * the target supports specifications of
  1792. * a limited set of MCS values.
  1793. */
  1794. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1795. * Setting more than one Nss isn't currently
  1796. * supported by the target (but is supported
  1797. * in the interface in case in the future
  1798. * the target supports specifications of
  1799. * a limited set of Nss values.
  1800. */
  1801. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1802. update_peer_cache : 1; /* When set these custom values will be
  1803. * used for all packets, until the next
  1804. * update via this ext header.
  1805. * This is to make sure not all packets
  1806. * need to include this header.
  1807. */
  1808. /* DWORD 2: tx chain mask, tx retries */
  1809. A_UINT32
  1810. /* chain_mask - specify which chains to transmit from */
  1811. chain_mask : 8,
  1812. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1813. * TODO: Update Enum values for key_flags
  1814. */
  1815. /*
  1816. * Channel frequency: This identifies the desired channel
  1817. * frequency (in MHz) for tx frames. This is used by FW to help
  1818. * determine when it is safe to transmit or drop frames for
  1819. * off-channel operation.
  1820. * The default value of zero indicates to FW that the corresponding
  1821. * VDEV's home channel (if there is one) is the desired channel
  1822. * frequency.
  1823. */
  1824. chanfreq : 16;
  1825. /* DWORD 3: tx expiry time (TSF) LSBs */
  1826. A_UINT32 expire_tsf_lo;
  1827. /* DWORD 4: tx expiry time (TSF) MSBs */
  1828. A_UINT32 expire_tsf_hi;
  1829. /* DWORD 5: flags to control routing / processing of the MSDU */
  1830. A_UINT32
  1831. /* learning_frame
  1832. * When this flag is set, this frame will be dropped by FW
  1833. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1834. */
  1835. learning_frame : 1,
  1836. /* send_as_standalone
  1837. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1838. * i.e. with no A-MSDU or A-MPDU aggregation.
  1839. * The scope is extended to other use-cases.
  1840. */
  1841. send_as_standalone : 1,
  1842. /* is_host_opaque_valid
  1843. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1844. * with valid information.
  1845. */
  1846. is_host_opaque_valid : 1,
  1847. traffic_end_indication: 1,
  1848. rsvd0 : 28;
  1849. /* DWORD 6 : Host opaque cookie for special frames */
  1850. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1851. rsvd1 : 16;
  1852. /*
  1853. * This structure can be expanded further up to 40 bytes
  1854. * by adding further DWORDs as needed.
  1855. */
  1856. } POSTPACK;
  1857. /* DWORD 0 */
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1884. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1885. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1886. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1887. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1888. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1889. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1890. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1891. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1892. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1893. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1894. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1895. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1896. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1897. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1898. /* DWORD 1 */
  1899. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1900. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1901. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1902. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1903. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1904. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1905. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1906. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1907. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1908. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1909. /* DWORD 2 */
  1910. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1911. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1912. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1913. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1914. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1915. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1916. /* DWORD 5 */
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1921. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1923. /* DWORD 6 */
  1924. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1925. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1926. /* DWORD 0 */
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1928. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1929. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1931. do { \
  1932. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1933. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1934. } while (0)
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1936. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1937. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1941. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1942. } while (0)
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1944. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1945. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1946. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1949. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1950. } while (0)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1952. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1953. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL( \
  1957. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1958. ((_var) |= ((_val) \
  1959. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1960. } while (0)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1962. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1963. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1964. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1965. do { \
  1966. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1967. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1968. } while (0)
  1969. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1970. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1971. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1972. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1975. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1976. } while (0)
  1977. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1978. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1979. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1980. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL( \
  1983. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1984. ((_var) |= ((_val) \
  1985. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1986. } while (0)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1988. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1989. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1990. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1993. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1994. } while (0)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1996. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1997. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1998. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2001. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2002. } while (0)
  2003. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2004. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2005. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2006. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2010. } while (0)
  2011. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2012. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2013. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2014. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2015. do { \
  2016. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2017. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2018. } while (0)
  2019. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2020. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2021. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2022. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2023. do { \
  2024. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2025. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2026. } while (0)
  2027. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2028. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2029. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2030. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2031. do { \
  2032. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2033. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2034. } while (0)
  2035. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2036. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2037. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2038. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2039. do { \
  2040. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2041. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2042. } while (0)
  2043. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2044. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2045. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2046. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2047. do { \
  2048. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2049. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2050. } while (0)
  2051. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2052. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2053. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2054. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2055. do { \
  2056. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2057. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2058. } while (0)
  2059. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2060. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2061. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2062. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2063. do { \
  2064. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2065. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2066. } while (0)
  2067. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2068. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2069. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2070. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2071. do { \
  2072. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2073. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2074. } while (0)
  2075. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2076. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2077. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2078. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2079. do { \
  2080. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2081. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2082. } while (0)
  2083. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2084. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2085. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2086. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2090. } while (0)
  2091. /* DWORD 1 */
  2092. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2093. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2094. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2095. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2096. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2097. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2098. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2099. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2100. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2101. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2102. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2103. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2104. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2105. do { \
  2106. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2107. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2108. } while (0)
  2109. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2110. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2111. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2112. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2113. do { \
  2114. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2115. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2116. } while (0)
  2117. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2118. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2119. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2120. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2121. do { \
  2122. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2123. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2124. } while (0)
  2125. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2126. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2127. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2128. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2129. do { \
  2130. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2131. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2132. } while (0)
  2133. /* DWORD 2 */
  2134. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2135. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2136. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2137. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2138. do { \
  2139. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2140. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2141. } while (0)
  2142. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2143. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2144. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2145. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2146. do { \
  2147. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2148. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2149. } while (0)
  2150. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2151. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2152. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2153. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2154. do { \
  2155. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2156. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2157. } while (0)
  2158. /* DWORD 5 */
  2159. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2160. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2161. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2162. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2166. } while (0)
  2167. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2168. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2169. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2170. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2174. } while (0)
  2175. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2176. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2177. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2178. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2179. do { \
  2180. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2181. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2182. } while (0)
  2183. /* DWORD 6 */
  2184. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2185. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2186. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2187. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2188. do { \
  2189. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2190. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2191. } while (0)
  2192. typedef enum {
  2193. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2194. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2195. } htt_tcl_metadata_type;
  2196. /**
  2197. * @brief HTT TCL command number format
  2198. * @details
  2199. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2200. * available to firmware as tcl_exit_base->tcl_status_number.
  2201. * For regular / multicast packets host will send vdev and mac id and for
  2202. * NAWDS packets, host will send peer id.
  2203. * A_UINT32 is used to avoid endianness conversion problems.
  2204. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2205. */
  2206. typedef struct {
  2207. A_UINT32
  2208. type: 1, /* vdev_id based or peer_id based */
  2209. rsvd: 31;
  2210. } htt_tx_tcl_vdev_or_peer_t;
  2211. typedef struct {
  2212. A_UINT32
  2213. type: 1, /* vdev_id based or peer_id based */
  2214. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2215. vdev_id: 8,
  2216. pdev_id: 2,
  2217. host_inspected:1,
  2218. rsvd: 19;
  2219. } htt_tx_tcl_vdev_metadata;
  2220. typedef struct {
  2221. A_UINT32
  2222. type: 1, /* vdev_id based or peer_id based */
  2223. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2224. peer_id: 14,
  2225. rsvd: 16;
  2226. } htt_tx_tcl_peer_metadata;
  2227. PREPACK struct htt_tx_tcl_metadata {
  2228. union {
  2229. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2230. htt_tx_tcl_vdev_metadata vdev_meta;
  2231. htt_tx_tcl_peer_metadata peer_meta;
  2232. };
  2233. } POSTPACK;
  2234. /* DWORD 0 */
  2235. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2236. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2237. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2238. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2239. /* VDEV metadata */
  2240. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2241. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2242. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2243. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2244. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2245. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2246. /* PEER metadata */
  2247. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2248. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2249. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2250. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2251. HTT_TX_TCL_METADATA_TYPE_S)
  2252. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2253. do { \
  2254. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2255. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2256. } while (0)
  2257. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2258. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2259. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2260. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2261. do { \
  2262. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2263. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2264. } while (0)
  2265. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2266. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2267. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2268. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2272. } while (0)
  2273. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2274. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2275. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2276. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2280. } while (0)
  2281. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2282. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2283. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2284. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2285. do { \
  2286. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2287. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2288. } while (0)
  2289. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2290. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2291. HTT_TX_TCL_METADATA_PEER_ID_S)
  2292. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2293. do { \
  2294. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2295. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2296. } while (0)
  2297. /*------------------------------------------------------------------
  2298. * V2 Version of TCL Data Command
  2299. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2300. * MLO global_seq all flavours of TCL Data Cmd.
  2301. *-----------------------------------------------------------------*/
  2302. typedef enum {
  2303. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2304. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2305. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2306. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2307. } htt_tcl_metadata_type_v2;
  2308. /**
  2309. * @brief HTT TCL command number format
  2310. * @details
  2311. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2312. * available to firmware as tcl_exit_base->tcl_status_number.
  2313. * A_UINT32 is used to avoid endianness conversion problems.
  2314. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2315. */
  2316. typedef struct {
  2317. A_UINT32
  2318. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2319. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2320. vdev_id: 8,
  2321. pdev_id: 2,
  2322. host_inspected:1,
  2323. rsvd: 2,
  2324. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2325. } htt_tx_tcl_vdev_metadata_v2;
  2326. typedef struct {
  2327. A_UINT32
  2328. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2329. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2330. peer_id: 13,
  2331. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2332. } htt_tx_tcl_peer_metadata_v2;
  2333. typedef struct {
  2334. A_UINT32
  2335. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2336. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2337. svc_class_id: 8,
  2338. rsvd: 5,
  2339. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2340. } htt_tx_tcl_svc_class_id_metadata;
  2341. typedef struct {
  2342. A_UINT32
  2343. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2344. host_inspected: 1,
  2345. global_seq_no: 12,
  2346. rsvd: 1,
  2347. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2348. } htt_tx_tcl_global_seq_metadata;
  2349. PREPACK struct htt_tx_tcl_metadata_v2 {
  2350. union {
  2351. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2352. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2353. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2354. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2355. };
  2356. } POSTPACK;
  2357. /* DWORD 0 */
  2358. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2359. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2360. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2361. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2362. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2363. /* VDEV V2 metadata */
  2364. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2365. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2366. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2367. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2368. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2369. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2370. /* PEER V2 metadata */
  2371. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2372. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2373. /* SVC_CLASS_ID metadata */
  2374. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2375. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2376. /* Global Seq no metadata */
  2377. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2378. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2379. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2380. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2381. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2382. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2383. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2384. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2385. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2386. do { \
  2387. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2388. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2389. } while (0)
  2390. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2391. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2392. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2393. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2394. do { \
  2395. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2396. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2397. } while (0)
  2398. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2399. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2400. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2401. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2402. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2403. do { \
  2404. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2405. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2406. } while (0)
  2407. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2408. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2409. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2410. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2411. do { \
  2412. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2413. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2414. } while (0)
  2415. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2416. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2417. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2418. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2419. do { \
  2420. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2421. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2422. } while (0)
  2423. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2424. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2425. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2426. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2427. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2428. do { \
  2429. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2430. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2431. } while (0)
  2432. /*----- Get and Set V2 type field in Service Class fields ----*/
  2433. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2434. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2435. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2436. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2437. do { \
  2438. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2439. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2440. } while (0)
  2441. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2442. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2443. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2444. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2445. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2446. do { \
  2447. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2448. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2449. } while (0)
  2450. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2451. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2452. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2453. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2454. do { \
  2455. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2456. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2457. } while (0)
  2458. /*------------------------------------------------------------------
  2459. * End V2 Version of TCL Data Command
  2460. *-----------------------------------------------------------------*/
  2461. typedef enum {
  2462. HTT_TX_FW2WBM_TX_STATUS_OK,
  2463. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2464. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2465. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2466. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2467. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2468. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2469. HTT_TX_FW2WBM_TX_STATUS_MAX
  2470. } htt_tx_fw2wbm_tx_status_t;
  2471. typedef enum {
  2472. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2473. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2474. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2475. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2476. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2477. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2478. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2479. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2480. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2481. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2482. } htt_tx_fw2wbm_reinject_reason_t;
  2483. /**
  2484. * @brief HTT TX WBM Completion from firmware to host
  2485. * @details
  2486. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2487. * DWORD 3 and 4 for software based completions (Exception frames and
  2488. * TQM bypass frames)
  2489. * For software based completions, wbm_release_ring->release_source_module will
  2490. * be set to release_source_fw
  2491. */
  2492. PREPACK struct htt_tx_wbm_completion {
  2493. A_UINT32
  2494. sch_cmd_id: 24,
  2495. exception_frame: 1, /* If set, this packet was queued via exception path */
  2496. rsvd0_31_25: 7;
  2497. A_UINT32
  2498. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2499. * reception of an ACK or BA, this field indicates
  2500. * the RSSI of the received ACK or BA frame.
  2501. * When the frame is removed as result of a direct
  2502. * remove command from the SW, this field is set
  2503. * to 0x0 (which is never a valid value when real
  2504. * RSSI is available).
  2505. * Units: dB w.r.t noise floor
  2506. */
  2507. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2508. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2509. rsvd1_31_16: 16;
  2510. } POSTPACK;
  2511. /* DWORD 0 */
  2512. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2513. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2514. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2515. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2516. /* DWORD 1 */
  2517. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2518. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2519. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2520. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2521. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2522. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2523. /* DWORD 0 */
  2524. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2525. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2526. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2527. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2528. do { \
  2529. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2530. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2531. } while (0)
  2532. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2533. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2534. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2535. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2536. do { \
  2537. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2538. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2539. } while (0)
  2540. /* DWORD 1 */
  2541. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2542. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2543. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2544. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2545. do { \
  2546. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2547. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2548. } while (0)
  2549. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2550. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2551. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2552. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2553. do { \
  2554. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2555. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2556. } while (0)
  2557. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2558. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2559. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2560. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2561. do { \
  2562. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2563. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2564. } while (0)
  2565. /**
  2566. * @brief HTT TX WBM Completion from firmware to host
  2567. * @details
  2568. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2569. * (WBM) offload HW.
  2570. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2571. * For software based completions, release_source_module will
  2572. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2573. * struct wbm_release_ring and then switch to this after looking at
  2574. * release_source_module.
  2575. */
  2576. PREPACK struct htt_tx_wbm_completion_v2 {
  2577. A_UINT32
  2578. used_by_hw0; /* Refer to struct wbm_release_ring */
  2579. A_UINT32
  2580. used_by_hw1; /* Refer to struct wbm_release_ring */
  2581. A_UINT32
  2582. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2583. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2584. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2585. exception_frame: 1,
  2586. rsvd0: 12, /* For future use */
  2587. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2588. rsvd1: 1; /* For future use */
  2589. A_UINT32
  2590. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2591. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2592. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2593. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2594. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2595. */
  2596. A_UINT32
  2597. data1: 32;
  2598. A_UINT32
  2599. data2: 32;
  2600. A_UINT32
  2601. used_by_hw3; /* Refer to struct wbm_release_ring */
  2602. } POSTPACK;
  2603. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2604. /* DWORD 3 */
  2605. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2606. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2607. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2608. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2609. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2610. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2611. /* DWORD 3 */
  2612. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2613. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2614. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2615. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2616. do { \
  2617. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2618. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2619. } while (0)
  2620. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2621. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2622. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2623. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2624. do { \
  2625. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2626. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2627. } while (0)
  2628. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2629. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2630. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2631. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2632. do { \
  2633. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2634. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2635. } while (0)
  2636. /**
  2637. * @brief HTT TX WBM Completion from firmware to host (V3)
  2638. * @details
  2639. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2640. * (WBM) offload HW.
  2641. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2642. * For software based completions, release_source_module will
  2643. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2644. * struct wbm_release_ring and then switch to this after looking at
  2645. * release_source_module.
  2646. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2647. * by new generations of targets.
  2648. */
  2649. PREPACK struct htt_tx_wbm_completion_v3 {
  2650. A_UINT32
  2651. used_by_hw0; /* Refer to struct wbm_release_ring */
  2652. A_UINT32
  2653. used_by_hw1; /* Refer to struct wbm_release_ring */
  2654. A_UINT32
  2655. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2656. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2657. used_by_hw3: 15;
  2658. A_UINT32
  2659. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2660. exception_frame: 1,
  2661. rsvd0: 27; /* For future use */
  2662. A_UINT32
  2663. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2664. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2665. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2666. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2667. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2668. */
  2669. A_UINT32
  2670. data1: 32;
  2671. A_UINT32
  2672. data2: 32;
  2673. A_UINT32
  2674. rsvd1: 20,
  2675. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2676. } POSTPACK;
  2677. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2678. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2679. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2680. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2681. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2682. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2683. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2684. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2685. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2686. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2687. do { \
  2688. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2689. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2690. } while (0)
  2691. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2692. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2693. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2694. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2695. do { \
  2696. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2697. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2698. } while (0)
  2699. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2700. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2701. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2702. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2703. do { \
  2704. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2705. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2706. } while (0)
  2707. typedef enum {
  2708. TX_FRAME_TYPE_UNDEFINED = 0,
  2709. TX_FRAME_TYPE_EAPOL = 1,
  2710. } htt_tx_wbm_status_frame_type;
  2711. /**
  2712. * @brief HTT TX WBM transmit status from firmware to host
  2713. * @details
  2714. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2715. * (WBM) offload HW.
  2716. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2717. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2718. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2719. */
  2720. PREPACK struct htt_tx_wbm_transmit_status {
  2721. A_UINT32
  2722. sch_cmd_id: 24,
  2723. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2724. * reception of an ACK or BA, this field indicates
  2725. * the RSSI of the received ACK or BA frame.
  2726. * When the frame is removed as result of a direct
  2727. * remove command from the SW, this field is set
  2728. * to 0x0 (which is never a valid value when real
  2729. * RSSI is available).
  2730. * Units: dB w.r.t noise floor
  2731. */
  2732. A_UINT32
  2733. sw_peer_id: 16,
  2734. tid_num: 5,
  2735. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2736. * and tid_num fields contain valid data.
  2737. * If this "valid" flag is not set, the
  2738. * sw_peer_id and tid_num fields must be ignored.
  2739. */
  2740. mcast: 1,
  2741. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2742. * contains valid data.
  2743. */
  2744. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2745. reserved: 4;
  2746. A_UINT32
  2747. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2748. * packets in the wbm completion path
  2749. */
  2750. } POSTPACK;
  2751. /* DWORD 4 */
  2752. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2753. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2754. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2755. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2756. /* DWORD 5 */
  2757. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2758. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2759. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2760. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2761. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2762. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2763. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2764. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2765. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2766. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2767. /* DWORD 4 */
  2768. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2769. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2770. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2771. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2772. do { \
  2773. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2774. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2775. } while (0)
  2776. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2777. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2778. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2779. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2780. do { \
  2781. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2782. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2783. } while (0)
  2784. /* DWORD 5 */
  2785. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2786. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2787. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2788. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2789. do { \
  2790. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2791. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2792. } while (0)
  2793. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2794. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2795. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2796. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2799. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2800. } while (0)
  2801. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2802. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2803. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2804. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2805. do { \
  2806. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2807. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2808. } while (0)
  2809. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2810. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2811. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2812. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2813. do { \
  2814. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2815. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2816. } while (0)
  2817. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2818. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2819. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2820. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2823. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2824. } while (0)
  2825. /**
  2826. * @brief HTT TX WBM reinject status from firmware to host
  2827. * @details
  2828. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2829. * (WBM) offload HW.
  2830. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2831. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2832. */
  2833. PREPACK struct htt_tx_wbm_reinject_status {
  2834. A_UINT32
  2835. reserved0: 32;
  2836. A_UINT32
  2837. reserved1: 32;
  2838. A_UINT32
  2839. reserved2: 32;
  2840. } POSTPACK;
  2841. /**
  2842. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2843. * @details
  2844. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2845. * (WBM) offload HW.
  2846. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2847. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2848. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2849. * STA side.
  2850. */
  2851. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2852. A_UINT32
  2853. mec_sa_addr_31_0;
  2854. A_UINT32
  2855. mec_sa_addr_47_32: 16,
  2856. sa_ast_index: 16;
  2857. A_UINT32
  2858. vdev_id: 8,
  2859. reserved0: 24;
  2860. } POSTPACK;
  2861. /* DWORD 4 - mec_sa_addr_31_0 */
  2862. /* DWORD 5 */
  2863. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2864. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2865. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2866. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2867. /* DWORD 6 */
  2868. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2869. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2870. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2871. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2872. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2873. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2874. do { \
  2875. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2876. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2877. } while (0)
  2878. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2879. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2880. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2881. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2882. do { \
  2883. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2884. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2885. } while (0)
  2886. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2887. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2888. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2889. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2892. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2893. } while (0)
  2894. typedef enum {
  2895. TX_FLOW_PRIORITY_BE,
  2896. TX_FLOW_PRIORITY_HIGH,
  2897. TX_FLOW_PRIORITY_LOW,
  2898. } htt_tx_flow_priority_t;
  2899. typedef enum {
  2900. TX_FLOW_LATENCY_SENSITIVE,
  2901. TX_FLOW_LATENCY_INSENSITIVE,
  2902. } htt_tx_flow_latency_t;
  2903. typedef enum {
  2904. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2905. TX_FLOW_INTERACTIVE_TRAFFIC,
  2906. TX_FLOW_PERIODIC_TRAFFIC,
  2907. TX_FLOW_BURSTY_TRAFFIC,
  2908. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2909. } htt_tx_flow_traffic_pattern_t;
  2910. /**
  2911. * @brief HTT TX Flow search metadata format
  2912. * @details
  2913. * Host will set this metadata in flow table's flow search entry along with
  2914. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2915. * firmware and TQM ring if the flow search entry wins.
  2916. * This metadata is available to firmware in that first MSDU's
  2917. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2918. * to one of the available flows for specific tid and returns the tqm flow
  2919. * pointer as part of htt_tx_map_flow_info message.
  2920. */
  2921. PREPACK struct htt_tx_flow_metadata {
  2922. A_UINT32
  2923. rsvd0_1_0: 2,
  2924. tid: 4,
  2925. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2926. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2927. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2928. * Else choose final tid based on latency, priority.
  2929. */
  2930. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2931. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2932. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2933. } POSTPACK;
  2934. /* DWORD 0 */
  2935. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2936. #define HTT_TX_FLOW_METADATA_TID_S 2
  2937. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2938. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2939. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2940. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2941. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2942. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2943. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2944. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2945. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2946. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2947. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2948. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2949. /* DWORD 0 */
  2950. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2951. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2952. HTT_TX_FLOW_METADATA_TID_S)
  2953. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2956. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2957. } while (0)
  2958. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2959. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2960. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2961. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2964. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2965. } while (0)
  2966. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2967. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2968. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2969. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2972. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2973. } while (0)
  2974. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2975. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2976. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2977. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2980. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2981. } while (0)
  2982. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2983. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2984. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2985. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2986. do { \
  2987. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2988. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2989. } while (0)
  2990. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2991. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2992. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2993. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2994. do { \
  2995. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2996. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2997. } while (0)
  2998. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2999. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3000. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3001. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3002. do { \
  3003. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3004. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3005. } while (0)
  3006. /**
  3007. * @brief host -> target ADD WDS Entry
  3008. *
  3009. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3010. *
  3011. * @brief host -> target DELETE WDS Entry
  3012. *
  3013. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3014. *
  3015. * @details
  3016. * HTT wds entry from source port learning
  3017. * Host will learn wds entries from rx and send this message to firmware
  3018. * to enable firmware to configure/delete AST entries for wds clients.
  3019. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3020. * and when SA's entry is deleted, firmware removes this AST entry
  3021. *
  3022. * The message would appear as follows:
  3023. *
  3024. * |31 30|29 |17 16|15 8|7 0|
  3025. * |----------------+----------------+----------------+----------------|
  3026. * | rsvd0 |PDVID| vdev_id | msg_type |
  3027. * |-------------------------------------------------------------------|
  3028. * | sa_addr_31_0 |
  3029. * |-------------------------------------------------------------------|
  3030. * | | ta_peer_id | sa_addr_47_32 |
  3031. * |-------------------------------------------------------------------|
  3032. * Where PDVID = pdev_id
  3033. *
  3034. * The message is interpreted as follows:
  3035. *
  3036. * dword0 - b'0:7 - msg_type: This will be set to
  3037. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3038. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3039. *
  3040. * dword0 - b'8:15 - vdev_id
  3041. *
  3042. * dword0 - b'16:17 - pdev_id
  3043. *
  3044. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3045. *
  3046. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3047. *
  3048. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3049. *
  3050. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3051. */
  3052. PREPACK struct htt_wds_entry {
  3053. A_UINT32
  3054. msg_type: 8,
  3055. vdev_id: 8,
  3056. pdev_id: 2,
  3057. rsvd0: 14;
  3058. A_UINT32 sa_addr_31_0;
  3059. A_UINT32
  3060. sa_addr_47_32: 16,
  3061. ta_peer_id: 14,
  3062. rsvd2: 2;
  3063. } POSTPACK;
  3064. /* DWORD 0 */
  3065. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3066. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3067. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3068. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3069. /* DWORD 2 */
  3070. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3071. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3072. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3073. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3074. /* DWORD 0 */
  3075. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3076. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3077. HTT_WDS_ENTRY_VDEV_ID_S)
  3078. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3079. do { \
  3080. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3081. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3082. } while (0)
  3083. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3084. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3085. HTT_WDS_ENTRY_PDEV_ID_S)
  3086. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3087. do { \
  3088. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3089. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3090. } while (0)
  3091. /* DWORD 2 */
  3092. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3093. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3094. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3095. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3096. do { \
  3097. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3098. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3099. } while (0)
  3100. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3101. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3102. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3103. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3104. do { \
  3105. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3106. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3107. } while (0)
  3108. /**
  3109. * @brief MAC DMA rx ring setup specification
  3110. *
  3111. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3112. *
  3113. * @details
  3114. * To allow for dynamic rx ring reconfiguration and to avoid race
  3115. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3116. * it uses. Instead, it sends this message to the target, indicating how
  3117. * the rx ring used by the host should be set up and maintained.
  3118. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3119. * specifications.
  3120. *
  3121. * |31 16|15 8|7 0|
  3122. * |---------------------------------------------------------------|
  3123. * header: | reserved | num rings | msg type |
  3124. * |---------------------------------------------------------------|
  3125. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3126. #if HTT_PADDR64
  3127. * | FW_IDX shadow register physical address (bits 63:32) |
  3128. #endif
  3129. * |---------------------------------------------------------------|
  3130. * | rx ring base physical address (bits 31:0) |
  3131. #if HTT_PADDR64
  3132. * | rx ring base physical address (bits 63:32) |
  3133. #endif
  3134. * |---------------------------------------------------------------|
  3135. * | rx ring buffer size | rx ring length |
  3136. * |---------------------------------------------------------------|
  3137. * | FW_IDX initial value | enabled flags |
  3138. * |---------------------------------------------------------------|
  3139. * | MSDU payload offset | 802.11 header offset |
  3140. * |---------------------------------------------------------------|
  3141. * | PPDU end offset | PPDU start offset |
  3142. * |---------------------------------------------------------------|
  3143. * | MPDU end offset | MPDU start offset |
  3144. * |---------------------------------------------------------------|
  3145. * | MSDU end offset | MSDU start offset |
  3146. * |---------------------------------------------------------------|
  3147. * | frag info offset | rx attention offset |
  3148. * |---------------------------------------------------------------|
  3149. * payload 2, if present, has the same format as payload 1
  3150. * Header fields:
  3151. * - MSG_TYPE
  3152. * Bits 7:0
  3153. * Purpose: identifies this as an rx ring configuration message
  3154. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3155. * - NUM_RINGS
  3156. * Bits 15:8
  3157. * Purpose: indicates whether the host is setting up one rx ring or two
  3158. * Value: 1 or 2
  3159. * Payload:
  3160. * for systems using 64-bit format for bus addresses:
  3161. * - IDX_SHADOW_REG_PADDR_LO
  3162. * Bits 31:0
  3163. * Value: lower 4 bytes of physical address of the host's
  3164. * FW_IDX shadow register
  3165. * - IDX_SHADOW_REG_PADDR_HI
  3166. * Bits 31:0
  3167. * Value: upper 4 bytes of physical address of the host's
  3168. * FW_IDX shadow register
  3169. * - RING_BASE_PADDR_LO
  3170. * Bits 31:0
  3171. * Value: lower 4 bytes of physical address of the host's rx ring
  3172. * - RING_BASE_PADDR_HI
  3173. * Bits 31:0
  3174. * Value: uppper 4 bytes of physical address of the host's rx ring
  3175. * for systems using 32-bit format for bus addresses:
  3176. * - IDX_SHADOW_REG_PADDR
  3177. * Bits 31:0
  3178. * Value: physical address of the host's FW_IDX shadow register
  3179. * - RING_BASE_PADDR
  3180. * Bits 31:0
  3181. * Value: physical address of the host's rx ring
  3182. * - RING_LEN
  3183. * Bits 15:0
  3184. * Value: number of elements in the rx ring
  3185. * - RING_BUF_SZ
  3186. * Bits 31:16
  3187. * Value: size of the buffers referenced by the rx ring, in byte units
  3188. * - ENABLED_FLAGS
  3189. * Bits 15:0
  3190. * Value: 1-bit flags to show whether different rx fields are enabled
  3191. * bit 0: 802.11 header enabled (1) or disabled (0)
  3192. * bit 1: MSDU payload enabled (1) or disabled (0)
  3193. * bit 2: PPDU start enabled (1) or disabled (0)
  3194. * bit 3: PPDU end enabled (1) or disabled (0)
  3195. * bit 4: MPDU start enabled (1) or disabled (0)
  3196. * bit 5: MPDU end enabled (1) or disabled (0)
  3197. * bit 6: MSDU start enabled (1) or disabled (0)
  3198. * bit 7: MSDU end enabled (1) or disabled (0)
  3199. * bit 8: rx attention enabled (1) or disabled (0)
  3200. * bit 9: frag info enabled (1) or disabled (0)
  3201. * bit 10: unicast rx enabled (1) or disabled (0)
  3202. * bit 11: multicast rx enabled (1) or disabled (0)
  3203. * bit 12: ctrl rx enabled (1) or disabled (0)
  3204. * bit 13: mgmt rx enabled (1) or disabled (0)
  3205. * bit 14: null rx enabled (1) or disabled (0)
  3206. * bit 15: phy data rx enabled (1) or disabled (0)
  3207. * - IDX_INIT_VAL
  3208. * Bits 31:16
  3209. * Purpose: Specify the initial value for the FW_IDX.
  3210. * Value: the number of buffers initially present in the host's rx ring
  3211. * - OFFSET_802_11_HDR
  3212. * Bits 15:0
  3213. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3214. * - OFFSET_MSDU_PAYLOAD
  3215. * Bits 31:16
  3216. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3217. * - OFFSET_PPDU_START
  3218. * Bits 15:0
  3219. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3220. * - OFFSET_PPDU_END
  3221. * Bits 31:16
  3222. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3223. * - OFFSET_MPDU_START
  3224. * Bits 15:0
  3225. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3226. * - OFFSET_MPDU_END
  3227. * Bits 31:16
  3228. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3229. * - OFFSET_MSDU_START
  3230. * Bits 15:0
  3231. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3232. * - OFFSET_MSDU_END
  3233. * Bits 31:16
  3234. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3235. * - OFFSET_RX_ATTN
  3236. * Bits 15:0
  3237. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3238. * - OFFSET_FRAG_INFO
  3239. * Bits 31:16
  3240. * Value: offset in QUAD-bytes of frag info table
  3241. */
  3242. /* header fields */
  3243. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3244. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3245. /* payload fields */
  3246. /* for systems using a 64-bit format for bus addresses */
  3247. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3248. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3249. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3250. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3251. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3252. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3253. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3254. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3255. /* for systems using a 32-bit format for bus addresses */
  3256. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3257. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3258. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3259. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3260. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3261. #define HTT_RX_RING_CFG_LEN_S 0
  3262. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3263. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3264. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3265. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3266. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3267. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3268. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3269. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3270. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3271. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3272. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3273. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3274. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3275. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3276. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3277. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3278. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3279. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3280. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3281. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3282. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3283. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3284. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3285. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3286. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3287. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3288. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3289. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3290. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3291. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3292. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3293. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3294. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3295. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3296. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3297. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3298. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3299. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3300. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3301. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3302. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3303. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3304. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3305. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3306. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3307. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3308. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3309. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3310. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3311. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3312. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3313. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3314. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3315. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3316. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3317. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3318. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3319. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3320. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3321. #if HTT_PADDR64
  3322. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3323. #else
  3324. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3325. #endif
  3326. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3327. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3328. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3329. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3330. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3331. do { \
  3332. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3333. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3334. } while (0)
  3335. /* degenerate case for 32-bit fields */
  3336. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3337. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3338. ((_var) = (_val))
  3339. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3340. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3341. ((_var) = (_val))
  3342. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3343. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3344. ((_var) = (_val))
  3345. /* degenerate case for 32-bit fields */
  3346. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3347. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3348. ((_var) = (_val))
  3349. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3350. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3351. ((_var) = (_val))
  3352. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3353. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3354. ((_var) = (_val))
  3355. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3356. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3357. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3358. do { \
  3359. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3360. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3361. } while (0)
  3362. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3363. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3364. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3365. do { \
  3366. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3367. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3368. } while (0)
  3369. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3370. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3371. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3372. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3373. do { \
  3374. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3375. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3376. } while (0)
  3377. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3378. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3379. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3380. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3381. do { \
  3382. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3383. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3384. } while (0)
  3385. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3386. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3387. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3388. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3389. do { \
  3390. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3391. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3392. } while (0)
  3393. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3394. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3395. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3396. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3397. do { \
  3398. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3399. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3400. } while (0)
  3401. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3402. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3403. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3404. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3405. do { \
  3406. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3407. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3408. } while (0)
  3409. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3410. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3411. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3412. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3413. do { \
  3414. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3415. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3416. } while (0)
  3417. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3418. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3419. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3420. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3421. do { \
  3422. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3423. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3424. } while (0)
  3425. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3426. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3427. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3428. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3429. do { \
  3430. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3431. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3432. } while (0)
  3433. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3434. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3435. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3436. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3437. do { \
  3438. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3439. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3440. } while (0)
  3441. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3442. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3443. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3444. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3445. do { \
  3446. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3447. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3448. } while (0)
  3449. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3450. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3451. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3452. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3453. do { \
  3454. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3455. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3456. } while (0)
  3457. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3458. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3459. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3460. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3461. do { \
  3462. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3463. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3464. } while (0)
  3465. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3466. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3467. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3468. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3469. do { \
  3470. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3471. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3472. } while (0)
  3473. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3474. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3475. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3476. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3477. do { \
  3478. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3479. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3480. } while (0)
  3481. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3482. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3483. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3484. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3485. do { \
  3486. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3487. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3488. } while (0)
  3489. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3490. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3491. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3492. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3495. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3496. } while (0)
  3497. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3498. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3499. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3500. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3501. do { \
  3502. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3503. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3504. } while (0)
  3505. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3506. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3507. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3508. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3509. do { \
  3510. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3511. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3512. } while (0)
  3513. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3514. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3515. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3516. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3517. do { \
  3518. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3519. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3520. } while (0)
  3521. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3522. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3523. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3524. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3525. do { \
  3526. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3527. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3528. } while (0)
  3529. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3530. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3531. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3532. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3533. do { \
  3534. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3535. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3536. } while (0)
  3537. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3538. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3539. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3540. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3541. do { \
  3542. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3543. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3544. } while (0)
  3545. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3546. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3547. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3548. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3549. do { \
  3550. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3551. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3552. } while (0)
  3553. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3554. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3555. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3556. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3557. do { \
  3558. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3559. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3560. } while (0)
  3561. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3562. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3563. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3564. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3567. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3568. } while (0)
  3569. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3570. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3571. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3572. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3575. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3576. } while (0)
  3577. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3578. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3579. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3580. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3583. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3584. } while (0)
  3585. /**
  3586. * @brief host -> target FW statistics retrieve
  3587. *
  3588. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3589. *
  3590. * @details
  3591. * The following field definitions describe the format of the HTT host
  3592. * to target FW stats retrieve message. The message specifies the type of
  3593. * stats host wants to retrieve.
  3594. *
  3595. * |31 24|23 16|15 8|7 0|
  3596. * |-----------------------------------------------------------|
  3597. * | stats types request bitmask | msg type |
  3598. * |-----------------------------------------------------------|
  3599. * | stats types reset bitmask | reserved |
  3600. * |-----------------------------------------------------------|
  3601. * | stats type | config value |
  3602. * |-----------------------------------------------------------|
  3603. * | cookie LSBs |
  3604. * |-----------------------------------------------------------|
  3605. * | cookie MSBs |
  3606. * |-----------------------------------------------------------|
  3607. * Header fields:
  3608. * - MSG_TYPE
  3609. * Bits 7:0
  3610. * Purpose: identifies this is a stats upload request message
  3611. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3612. * - UPLOAD_TYPES
  3613. * Bits 31:8
  3614. * Purpose: identifies which types of FW statistics to upload
  3615. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3616. * - RESET_TYPES
  3617. * Bits 31:8
  3618. * Purpose: identifies which types of FW statistics to reset
  3619. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3620. * - CFG_VAL
  3621. * Bits 23:0
  3622. * Purpose: give an opaque configuration value to the specified stats type
  3623. * Value: stats-type specific configuration value
  3624. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3625. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3626. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3627. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3628. * - CFG_STAT_TYPE
  3629. * Bits 31:24
  3630. * Purpose: specify which stats type (if any) the config value applies to
  3631. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3632. * a valid configuration specification
  3633. * - COOKIE_LSBS
  3634. * Bits 31:0
  3635. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3636. * message with its preceding host->target stats request message.
  3637. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3638. * - COOKIE_MSBS
  3639. * Bits 31:0
  3640. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3641. * message with its preceding host->target stats request message.
  3642. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3643. */
  3644. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3645. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3646. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3647. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3648. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3649. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3650. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3651. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3652. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3653. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3654. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3655. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3656. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3657. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3658. do { \
  3659. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3660. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3661. } while (0)
  3662. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3663. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3664. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3665. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3666. do { \
  3667. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3668. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3669. } while (0)
  3670. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3671. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3672. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3673. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3674. do { \
  3675. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3676. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3677. } while (0)
  3678. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3679. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3680. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3681. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3682. do { \
  3683. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3684. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3685. } while (0)
  3686. /**
  3687. * @brief host -> target HTT out-of-band sync request
  3688. *
  3689. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3690. *
  3691. * @details
  3692. * The HTT SYNC tells the target to suspend processing of subsequent
  3693. * HTT host-to-target messages until some other target agent locally
  3694. * informs the target HTT FW that the current sync counter is equal to
  3695. * or greater than (in a modulo sense) the sync counter specified in
  3696. * the SYNC message.
  3697. * This allows other host-target components to synchronize their operation
  3698. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3699. * security key has been downloaded to and activated by the target.
  3700. * In the absence of any explicit synchronization counter value
  3701. * specification, the target HTT FW will use zero as the default current
  3702. * sync value.
  3703. *
  3704. * |31 24|23 16|15 8|7 0|
  3705. * |-----------------------------------------------------------|
  3706. * | reserved | sync count | msg type |
  3707. * |-----------------------------------------------------------|
  3708. * Header fields:
  3709. * - MSG_TYPE
  3710. * Bits 7:0
  3711. * Purpose: identifies this as a sync message
  3712. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3713. * - SYNC_COUNT
  3714. * Bits 15:8
  3715. * Purpose: specifies what sync value the HTT FW will wait for from
  3716. * an out-of-band specification to resume its operation
  3717. * Value: in-band sync counter value to compare against the out-of-band
  3718. * counter spec.
  3719. * The HTT target FW will suspend its host->target message processing
  3720. * as long as
  3721. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3722. */
  3723. #define HTT_H2T_SYNC_MSG_SZ 4
  3724. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3725. #define HTT_H2T_SYNC_COUNT_S 8
  3726. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3727. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3728. HTT_H2T_SYNC_COUNT_S)
  3729. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3730. do { \
  3731. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3732. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3733. } while (0)
  3734. /**
  3735. * @brief host -> target HTT aggregation configuration
  3736. *
  3737. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3738. */
  3739. #define HTT_AGGR_CFG_MSG_SZ 4
  3740. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3741. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3742. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3743. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3744. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3745. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3746. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3747. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3748. do { \
  3749. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3750. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3751. } while (0)
  3752. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3753. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3754. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3755. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3756. do { \
  3757. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3758. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3759. } while (0)
  3760. /**
  3761. * @brief host -> target HTT configure max amsdu info per vdev
  3762. *
  3763. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3764. *
  3765. * @details
  3766. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3767. *
  3768. * |31 21|20 16|15 8|7 0|
  3769. * |-----------------------------------------------------------|
  3770. * | reserved | vdev id | max amsdu | msg type |
  3771. * |-----------------------------------------------------------|
  3772. * Header fields:
  3773. * - MSG_TYPE
  3774. * Bits 7:0
  3775. * Purpose: identifies this as a aggr cfg ex message
  3776. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3777. * - MAX_NUM_AMSDU_SUBFRM
  3778. * Bits 15:8
  3779. * Purpose: max MSDUs per A-MSDU
  3780. * - VDEV_ID
  3781. * Bits 20:16
  3782. * Purpose: ID of the vdev to which this limit is applied
  3783. */
  3784. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3785. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3786. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3787. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3788. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3789. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3790. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3791. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3792. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3793. do { \
  3794. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3795. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3796. } while (0)
  3797. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3798. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3799. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3800. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3801. do { \
  3802. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3803. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3804. } while (0)
  3805. /**
  3806. * @brief HTT WDI_IPA Config Message
  3807. *
  3808. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3809. *
  3810. * @details
  3811. * The HTT WDI_IPA config message is created/sent by host at driver
  3812. * init time. It contains information about data structures used on
  3813. * WDI_IPA TX and RX path.
  3814. * TX CE ring is used for pushing packet metadata from IPA uC
  3815. * to WLAN FW
  3816. * TX Completion ring is used for generating TX completions from
  3817. * WLAN FW to IPA uC
  3818. * RX Indication ring is used for indicating RX packets from FW
  3819. * to IPA uC
  3820. * RX Ring2 is used as either completion ring or as second
  3821. * indication ring. when Ring2 is used as completion ring, IPA uC
  3822. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3823. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3824. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3825. * indicated in RX Indication ring. Please see WDI_IPA specification
  3826. * for more details.
  3827. * |31 24|23 16|15 8|7 0|
  3828. * |----------------+----------------+----------------+----------------|
  3829. * | tx pkt pool size | Rsvd | msg_type |
  3830. * |-------------------------------------------------------------------|
  3831. * | tx comp ring base (bits 31:0) |
  3832. #if HTT_PADDR64
  3833. * | tx comp ring base (bits 63:32) |
  3834. #endif
  3835. * |-------------------------------------------------------------------|
  3836. * | tx comp ring size |
  3837. * |-------------------------------------------------------------------|
  3838. * | tx comp WR_IDX physical address (bits 31:0) |
  3839. #if HTT_PADDR64
  3840. * | tx comp WR_IDX physical address (bits 63:32) |
  3841. #endif
  3842. * |-------------------------------------------------------------------|
  3843. * | tx CE WR_IDX physical address (bits 31:0) |
  3844. #if HTT_PADDR64
  3845. * | tx CE WR_IDX physical address (bits 63:32) |
  3846. #endif
  3847. * |-------------------------------------------------------------------|
  3848. * | rx indication ring base (bits 31:0) |
  3849. #if HTT_PADDR64
  3850. * | rx indication ring base (bits 63:32) |
  3851. #endif
  3852. * |-------------------------------------------------------------------|
  3853. * | rx indication ring size |
  3854. * |-------------------------------------------------------------------|
  3855. * | rx ind RD_IDX physical address (bits 31:0) |
  3856. #if HTT_PADDR64
  3857. * | rx ind RD_IDX physical address (bits 63:32) |
  3858. #endif
  3859. * |-------------------------------------------------------------------|
  3860. * | rx ind WR_IDX physical address (bits 31:0) |
  3861. #if HTT_PADDR64
  3862. * | rx ind WR_IDX physical address (bits 63:32) |
  3863. #endif
  3864. * |-------------------------------------------------------------------|
  3865. * |-------------------------------------------------------------------|
  3866. * | rx ring2 base (bits 31:0) |
  3867. #if HTT_PADDR64
  3868. * | rx ring2 base (bits 63:32) |
  3869. #endif
  3870. * |-------------------------------------------------------------------|
  3871. * | rx ring2 size |
  3872. * |-------------------------------------------------------------------|
  3873. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3874. #if HTT_PADDR64
  3875. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3876. #endif
  3877. * |-------------------------------------------------------------------|
  3878. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3879. #if HTT_PADDR64
  3880. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3881. #endif
  3882. * |-------------------------------------------------------------------|
  3883. *
  3884. * Header fields:
  3885. * Header fields:
  3886. * - MSG_TYPE
  3887. * Bits 7:0
  3888. * Purpose: Identifies this as WDI_IPA config message
  3889. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3890. * - TX_PKT_POOL_SIZE
  3891. * Bits 15:0
  3892. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3893. * WDI_IPA TX path
  3894. * For systems using 32-bit format for bus addresses:
  3895. * - TX_COMP_RING_BASE_ADDR
  3896. * Bits 31:0
  3897. * Purpose: TX Completion Ring base address in DDR
  3898. * - TX_COMP_RING_SIZE
  3899. * Bits 31:0
  3900. * Purpose: TX Completion Ring size (must be power of 2)
  3901. * - TX_COMP_WR_IDX_ADDR
  3902. * Bits 31:0
  3903. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3904. * updates the Write Index for WDI_IPA TX completion ring
  3905. * - TX_CE_WR_IDX_ADDR
  3906. * Bits 31:0
  3907. * Purpose: DDR address where IPA uC
  3908. * updates the WR Index for TX CE ring
  3909. * (needed for fusion platforms)
  3910. * - RX_IND_RING_BASE_ADDR
  3911. * Bits 31:0
  3912. * Purpose: RX Indication Ring base address in DDR
  3913. * - RX_IND_RING_SIZE
  3914. * Bits 31:0
  3915. * Purpose: RX Indication Ring size
  3916. * - RX_IND_RD_IDX_ADDR
  3917. * Bits 31:0
  3918. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3919. * RX indication ring
  3920. * - RX_IND_WR_IDX_ADDR
  3921. * Bits 31:0
  3922. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3923. * updates the Write Index for WDI_IPA RX indication ring
  3924. * - RX_RING2_BASE_ADDR
  3925. * Bits 31:0
  3926. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3927. * - RX_RING2_SIZE
  3928. * Bits 31:0
  3929. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3930. * - RX_RING2_RD_IDX_ADDR
  3931. * Bits 31:0
  3932. * Purpose: If Second RX ring is Indication ring, DDR address where
  3933. * IPA uC updates the Read Index for Ring2.
  3934. * If Second RX ring is completion ring, this is NOT used
  3935. * - RX_RING2_WR_IDX_ADDR
  3936. * Bits 31:0
  3937. * Purpose: If Second RX ring is Indication ring, DDR address where
  3938. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3939. * If second RX ring is completion ring, DDR address where
  3940. * IPA uC updates the Write Index for Ring 2.
  3941. * For systems using 64-bit format for bus addresses:
  3942. * - TX_COMP_RING_BASE_ADDR_LO
  3943. * Bits 31:0
  3944. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3945. * - TX_COMP_RING_BASE_ADDR_HI
  3946. * Bits 31:0
  3947. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3948. * - TX_COMP_RING_SIZE
  3949. * Bits 31:0
  3950. * Purpose: TX Completion Ring size (must be power of 2)
  3951. * - TX_COMP_WR_IDX_ADDR_LO
  3952. * Bits 31:0
  3953. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3954. * Lower 4 bytes of DDR address where WIFI FW
  3955. * updates the Write Index for WDI_IPA TX completion ring
  3956. * - TX_COMP_WR_IDX_ADDR_HI
  3957. * Bits 31:0
  3958. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3959. * Higher 4 bytes of DDR address where WIFI FW
  3960. * updates the Write Index for WDI_IPA TX completion ring
  3961. * - TX_CE_WR_IDX_ADDR_LO
  3962. * Bits 31:0
  3963. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3964. * updates the WR Index for TX CE ring
  3965. * (needed for fusion platforms)
  3966. * - TX_CE_WR_IDX_ADDR_HI
  3967. * Bits 31:0
  3968. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3969. * updates the WR Index for TX CE ring
  3970. * (needed for fusion platforms)
  3971. * - RX_IND_RING_BASE_ADDR_LO
  3972. * Bits 31:0
  3973. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3974. * - RX_IND_RING_BASE_ADDR_HI
  3975. * Bits 31:0
  3976. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3977. * - RX_IND_RING_SIZE
  3978. * Bits 31:0
  3979. * Purpose: RX Indication Ring size
  3980. * - RX_IND_RD_IDX_ADDR_LO
  3981. * Bits 31:0
  3982. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3983. * for WDI_IPA RX indication ring
  3984. * - RX_IND_RD_IDX_ADDR_HI
  3985. * Bits 31:0
  3986. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3987. * for WDI_IPA RX indication ring
  3988. * - RX_IND_WR_IDX_ADDR_LO
  3989. * Bits 31:0
  3990. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3991. * Lower 4 bytes of DDR address where WIFI FW
  3992. * updates the Write Index for WDI_IPA RX indication ring
  3993. * - RX_IND_WR_IDX_ADDR_HI
  3994. * Bits 31:0
  3995. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3996. * Higher 4 bytes of DDR address where WIFI FW
  3997. * updates the Write Index for WDI_IPA RX indication ring
  3998. * - RX_RING2_BASE_ADDR_LO
  3999. * Bits 31:0
  4000. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4001. * - RX_RING2_BASE_ADDR_HI
  4002. * Bits 31:0
  4003. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4004. * - RX_RING2_SIZE
  4005. * Bits 31:0
  4006. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4007. * - RX_RING2_RD_IDX_ADDR_LO
  4008. * Bits 31:0
  4009. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4010. * DDR address where IPA uC updates the Read Index for Ring2.
  4011. * If Second RX ring is completion ring, this is NOT used
  4012. * - RX_RING2_RD_IDX_ADDR_HI
  4013. * Bits 31:0
  4014. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4015. * DDR address where IPA uC updates the Read Index for Ring2.
  4016. * If Second RX ring is completion ring, this is NOT used
  4017. * - RX_RING2_WR_IDX_ADDR_LO
  4018. * Bits 31:0
  4019. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4020. * DDR address where WIFI FW updates the Write Index
  4021. * for WDI_IPA RX ring2
  4022. * If second RX ring is completion ring, lower 4 bytes of
  4023. * DDR address where IPA uC updates the Write Index for Ring 2.
  4024. * - RX_RING2_WR_IDX_ADDR_HI
  4025. * Bits 31:0
  4026. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4027. * DDR address where WIFI FW updates the Write Index
  4028. * for WDI_IPA RX ring2
  4029. * If second RX ring is completion ring, higher 4 bytes of
  4030. * DDR address where IPA uC updates the Write Index for Ring 2.
  4031. */
  4032. #if HTT_PADDR64
  4033. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4034. #else
  4035. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4036. #endif
  4037. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4038. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4039. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4041. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4043. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4045. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4049. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4051. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4053. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4055. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4057. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4061. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4099. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4100. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4101. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4102. do { \
  4103. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4104. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4105. } while (0)
  4106. /* for systems using 32-bit format for bus addr */
  4107. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4108. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4109. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4110. do { \
  4111. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4112. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4113. } while (0)
  4114. /* for systems using 64-bit format for bus addr */
  4115. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4116. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4117. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4120. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4121. } while (0)
  4122. /* for systems using 64-bit format for bus addr */
  4123. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4124. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4128. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4129. } while (0)
  4130. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4131. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4132. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4135. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4136. } while (0)
  4137. /* for systems using 32-bit format for bus addr */
  4138. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4139. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4140. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4143. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4144. } while (0)
  4145. /* for systems using 64-bit format for bus addr */
  4146. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4147. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4148. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4149. do { \
  4150. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4151. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4152. } while (0)
  4153. /* for systems using 64-bit format for bus addr */
  4154. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4155. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4156. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4159. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4160. } while (0)
  4161. /* for systems using 32-bit format for bus addr */
  4162. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4163. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4164. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4165. do { \
  4166. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4167. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4168. } while (0)
  4169. /* for systems using 64-bit format for bus addr */
  4170. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4171. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4172. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4175. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4176. } while (0)
  4177. /* for systems using 64-bit format for bus addr */
  4178. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4179. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4180. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4183. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4184. } while (0)
  4185. /* for systems using 32-bit format for bus addr */
  4186. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4187. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4188. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4191. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4192. } while (0)
  4193. /* for systems using 64-bit format for bus addr */
  4194. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4195. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4196. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4197. do { \
  4198. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4199. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4200. } while (0)
  4201. /* for systems using 64-bit format for bus addr */
  4202. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4203. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4204. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4207. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4208. } while (0)
  4209. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4210. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4211. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4212. do { \
  4213. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4214. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4215. } while (0)
  4216. /* for systems using 32-bit format for bus addr */
  4217. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4218. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4219. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4220. do { \
  4221. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4222. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4223. } while (0)
  4224. /* for systems using 64-bit format for bus addr */
  4225. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4226. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4227. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4228. do { \
  4229. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4230. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4231. } while (0)
  4232. /* for systems using 64-bit format for bus addr */
  4233. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4234. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4235. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4236. do { \
  4237. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4238. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4239. } while (0)
  4240. /* for systems using 32-bit format for bus addr */
  4241. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4242. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4243. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4244. do { \
  4245. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4246. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4247. } while (0)
  4248. /* for systems using 64-bit format for bus addr */
  4249. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4250. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4251. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4254. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4255. } while (0)
  4256. /* for systems using 64-bit format for bus addr */
  4257. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4258. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4259. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4262. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4263. } while (0)
  4264. /* for systems using 32-bit format for bus addr */
  4265. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4266. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4267. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4268. do { \
  4269. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4270. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4271. } while (0)
  4272. /* for systems using 64-bit format for bus addr */
  4273. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4274. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4275. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4278. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4279. } while (0)
  4280. /* for systems using 64-bit format for bus addr */
  4281. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4282. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4286. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4287. } while (0)
  4288. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4289. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4291. do { \
  4292. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4293. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4294. } while (0)
  4295. /* for systems using 32-bit format for bus addr */
  4296. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4297. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4301. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4302. } while (0)
  4303. /* for systems using 64-bit format for bus addr */
  4304. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4305. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4306. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4309. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4310. } while (0)
  4311. /* for systems using 64-bit format for bus addr */
  4312. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4313. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4314. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4315. do { \
  4316. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4317. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4318. } while (0)
  4319. /* for systems using 32-bit format for bus addr */
  4320. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4321. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4322. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4323. do { \
  4324. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4325. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4326. } while (0)
  4327. /* for systems using 64-bit format for bus addr */
  4328. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4329. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4330. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4331. do { \
  4332. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4333. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4334. } while (0)
  4335. /* for systems using 64-bit format for bus addr */
  4336. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4337. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4338. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4339. do { \
  4340. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4341. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4342. } while (0)
  4343. /*
  4344. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4345. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4346. * addresses are stored in a XXX-bit field.
  4347. * This macro is used to define both htt_wdi_ipa_config32_t and
  4348. * htt_wdi_ipa_config64_t structs.
  4349. */
  4350. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4351. _paddr__tx_comp_ring_base_addr_, \
  4352. _paddr__tx_comp_wr_idx_addr_, \
  4353. _paddr__tx_ce_wr_idx_addr_, \
  4354. _paddr__rx_ind_ring_base_addr_, \
  4355. _paddr__rx_ind_rd_idx_addr_, \
  4356. _paddr__rx_ind_wr_idx_addr_, \
  4357. _paddr__rx_ring2_base_addr_,\
  4358. _paddr__rx_ring2_rd_idx_addr_,\
  4359. _paddr__rx_ring2_wr_idx_addr_) \
  4360. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4361. { \
  4362. /* DWORD 0: flags and meta-data */ \
  4363. A_UINT32 \
  4364. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4365. reserved: 8, \
  4366. tx_pkt_pool_size: 16;\
  4367. /* DWORD 1 */\
  4368. _paddr__tx_comp_ring_base_addr_;\
  4369. /* DWORD 2 (or 3)*/\
  4370. A_UINT32 tx_comp_ring_size;\
  4371. /* DWORD 3 (or 4)*/\
  4372. _paddr__tx_comp_wr_idx_addr_;\
  4373. /* DWORD 4 (or 6)*/\
  4374. _paddr__tx_ce_wr_idx_addr_;\
  4375. /* DWORD 5 (or 8)*/\
  4376. _paddr__rx_ind_ring_base_addr_;\
  4377. /* DWORD 6 (or 10)*/\
  4378. A_UINT32 rx_ind_ring_size;\
  4379. /* DWORD 7 (or 11)*/\
  4380. _paddr__rx_ind_rd_idx_addr_;\
  4381. /* DWORD 8 (or 13)*/\
  4382. _paddr__rx_ind_wr_idx_addr_;\
  4383. /* DWORD 9 (or 15)*/\
  4384. _paddr__rx_ring2_base_addr_;\
  4385. /* DWORD 10 (or 17) */\
  4386. A_UINT32 rx_ring2_size;\
  4387. /* DWORD 11 (or 18) */\
  4388. _paddr__rx_ring2_rd_idx_addr_;\
  4389. /* DWORD 12 (or 20) */\
  4390. _paddr__rx_ring2_wr_idx_addr_;\
  4391. } POSTPACK
  4392. /* define a htt_wdi_ipa_config32_t type */
  4393. 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));
  4394. /* define a htt_wdi_ipa_config64_t type */
  4395. 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));
  4396. #if HTT_PADDR64
  4397. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4398. #else
  4399. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4400. #endif
  4401. enum htt_wdi_ipa_op_code {
  4402. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4403. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4404. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4405. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4406. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4407. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4408. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4409. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4410. /* keep this last */
  4411. HTT_WDI_IPA_OPCODE_MAX
  4412. };
  4413. /**
  4414. * @brief HTT WDI_IPA Operation Request Message
  4415. *
  4416. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4417. *
  4418. * @details
  4419. * HTT WDI_IPA Operation Request message is sent by host
  4420. * to either suspend or resume WDI_IPA TX or RX path.
  4421. * |31 24|23 16|15 8|7 0|
  4422. * |----------------+----------------+----------------+----------------|
  4423. * | op_code | Rsvd | msg_type |
  4424. * |-------------------------------------------------------------------|
  4425. *
  4426. * Header fields:
  4427. * - MSG_TYPE
  4428. * Bits 7:0
  4429. * Purpose: Identifies this as WDI_IPA Operation Request message
  4430. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4431. * - OP_CODE
  4432. * Bits 31:16
  4433. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4434. * value: = enum htt_wdi_ipa_op_code
  4435. */
  4436. PREPACK struct htt_wdi_ipa_op_request_t
  4437. {
  4438. /* DWORD 0: flags and meta-data */
  4439. A_UINT32
  4440. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4441. reserved: 8,
  4442. op_code: 16;
  4443. } POSTPACK;
  4444. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4445. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4446. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4447. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4448. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4449. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4450. do { \
  4451. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4452. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4453. } while (0)
  4454. /*
  4455. * @brief host -> target HTT_MSI_SETUP message
  4456. *
  4457. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4458. *
  4459. * @details
  4460. * After target is booted up, host can send MSI setup message so that
  4461. * target sets up HW registers based on setup message.
  4462. *
  4463. * The message would appear as follows:
  4464. * |31 24|23 16|15|14 8|7 0|
  4465. * |---------------+-----------------+-----------------+-----------------|
  4466. * | reserved | msi_type | pdev_id | msg_type |
  4467. * |---------------------------------------------------------------------|
  4468. * | msi_addr_lo |
  4469. * |---------------------------------------------------------------------|
  4470. * | msi_addr_hi |
  4471. * |---------------------------------------------------------------------|
  4472. * | msi_data |
  4473. * |---------------------------------------------------------------------|
  4474. *
  4475. * The message is interpreted as follows:
  4476. * dword0 - b'0:7 - msg_type: This will be set to
  4477. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4478. * b'8:15 - pdev_id:
  4479. * 0 (for rings at SOC/UMAC level),
  4480. * 1/2/3 mac id (for rings at LMAC level)
  4481. * b'16:23 - msi_type: identify which msi registers need to be setup
  4482. * more details can be got from enum htt_msi_setup_type
  4483. * b'24:31 - reserved
  4484. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4485. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4486. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4487. */
  4488. PREPACK struct htt_msi_setup_t {
  4489. A_UINT32 msg_type: 8,
  4490. pdev_id: 8,
  4491. msi_type: 8,
  4492. reserved: 8;
  4493. A_UINT32 msi_addr_lo;
  4494. A_UINT32 msi_addr_hi;
  4495. A_UINT32 msi_data;
  4496. } POSTPACK;
  4497. enum htt_msi_setup_type {
  4498. HTT_PPDU_END_MSI_SETUP_TYPE,
  4499. /* Insert new types here*/
  4500. };
  4501. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4502. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4503. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4504. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4505. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4506. HTT_MSI_SETUP_PDEV_ID_S)
  4507. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4508. do { \
  4509. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4510. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4511. } while (0)
  4512. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4513. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4514. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4515. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4516. HTT_MSI_SETUP_MSI_TYPE_S)
  4517. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4518. do { \
  4519. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4520. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4521. } while (0)
  4522. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4523. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4524. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4525. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4526. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4527. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4528. do { \
  4529. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4530. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4531. } while (0)
  4532. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4533. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4534. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4535. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4536. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4537. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4538. do { \
  4539. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4540. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4541. } while (0)
  4542. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4543. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4544. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4545. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4546. HTT_MSI_SETUP_MSI_DATA_S)
  4547. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4548. do { \
  4549. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4550. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4551. } while (0)
  4552. /*
  4553. * @brief host -> target HTT_SRING_SETUP message
  4554. *
  4555. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4556. *
  4557. * @details
  4558. * After target is booted up, Host can send SRING setup message for
  4559. * each host facing LMAC SRING. Target setups up HW registers based
  4560. * on setup message and confirms back to Host if response_required is set.
  4561. * Host should wait for confirmation message before sending new SRING
  4562. * setup message
  4563. *
  4564. * The message would appear as follows:
  4565. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4566. * |--------------- +-----------------+-----------------+-----------------|
  4567. * | ring_type | ring_id | pdev_id | msg_type |
  4568. * |----------------------------------------------------------------------|
  4569. * | ring_base_addr_lo |
  4570. * |----------------------------------------------------------------------|
  4571. * | ring_base_addr_hi |
  4572. * |----------------------------------------------------------------------|
  4573. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4574. * |----------------------------------------------------------------------|
  4575. * | ring_head_offset32_remote_addr_lo |
  4576. * |----------------------------------------------------------------------|
  4577. * | ring_head_offset32_remote_addr_hi |
  4578. * |----------------------------------------------------------------------|
  4579. * | ring_tail_offset32_remote_addr_lo |
  4580. * |----------------------------------------------------------------------|
  4581. * | ring_tail_offset32_remote_addr_hi |
  4582. * |----------------------------------------------------------------------|
  4583. * | ring_msi_addr_lo |
  4584. * |----------------------------------------------------------------------|
  4585. * | ring_msi_addr_hi |
  4586. * |----------------------------------------------------------------------|
  4587. * | ring_msi_data |
  4588. * |----------------------------------------------------------------------|
  4589. * | intr_timer_th |IM| intr_batch_counter_th |
  4590. * |----------------------------------------------------------------------|
  4591. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4592. * |----------------------------------------------------------------------|
  4593. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4594. * |----------------------------------------------------------------------|
  4595. * Where
  4596. * IM = sw_intr_mode
  4597. * RR = response_required
  4598. * PTCF = prefetch_timer_cfg
  4599. * IP = IPA drop flag
  4600. *
  4601. * The message is interpreted as follows:
  4602. * dword0 - b'0:7 - msg_type: This will be set to
  4603. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4604. * b'8:15 - pdev_id:
  4605. * 0 (for rings at SOC/UMAC level),
  4606. * 1/2/3 mac id (for rings at LMAC level)
  4607. * b'16:23 - ring_id: identify which ring is to setup,
  4608. * more details can be got from enum htt_srng_ring_id
  4609. * b'24:31 - ring_type: identify type of host rings,
  4610. * more details can be got from enum htt_srng_ring_type
  4611. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4612. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4613. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4614. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4615. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4616. * SW_TO_HW_RING.
  4617. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4618. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4619. * Lower 32 bits of memory address of the remote variable
  4620. * storing the 4-byte word offset that identifies the head
  4621. * element within the ring.
  4622. * (The head offset variable has type A_UINT32.)
  4623. * Valid for HW_TO_SW and SW_TO_SW rings.
  4624. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4625. * Upper 32 bits of memory address of the remote variable
  4626. * storing the 4-byte word offset that identifies the head
  4627. * element within the ring.
  4628. * (The head offset variable has type A_UINT32.)
  4629. * Valid for HW_TO_SW and SW_TO_SW rings.
  4630. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4631. * Lower 32 bits of memory address of the remote variable
  4632. * storing the 4-byte word offset that identifies the tail
  4633. * element within the ring.
  4634. * (The tail offset variable has type A_UINT32.)
  4635. * Valid for HW_TO_SW and SW_TO_SW rings.
  4636. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4637. * Upper 32 bits of memory address of the remote variable
  4638. * storing the 4-byte word offset that identifies the tail
  4639. * element within the ring.
  4640. * (The tail offset variable has type A_UINT32.)
  4641. * Valid for HW_TO_SW and SW_TO_SW rings.
  4642. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4643. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4644. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4645. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4646. * dword10 - b'0:31 - ring_msi_data: MSI data
  4647. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4648. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4649. * dword11 - b'0:14 - intr_batch_counter_th:
  4650. * batch counter threshold is in units of 4-byte words.
  4651. * HW internally maintains and increments batch count.
  4652. * (see SRING spec for detail description).
  4653. * When batch count reaches threshold value, an interrupt
  4654. * is generated by HW.
  4655. * b'15 - sw_intr_mode:
  4656. * This configuration shall be static.
  4657. * Only programmed at power up.
  4658. * 0: generate pulse style sw interrupts
  4659. * 1: generate level style sw interrupts
  4660. * b'16:31 - intr_timer_th:
  4661. * The timer init value when timer is idle or is
  4662. * initialized to start downcounting.
  4663. * In 8us units (to cover a range of 0 to 524 ms)
  4664. * dword12 - b'0:15 - intr_low_threshold:
  4665. * Used only by Consumer ring to generate ring_sw_int_p.
  4666. * Ring entries low threshold water mark, that is used
  4667. * in combination with the interrupt timer as well as
  4668. * the the clearing of the level interrupt.
  4669. * b'16:18 - prefetch_timer_cfg:
  4670. * Used only by Consumer ring to set timer mode to
  4671. * support Application prefetch handling.
  4672. * The external tail offset/pointer will be updated
  4673. * at following intervals:
  4674. * 3'b000: (Prefetch feature disabled; used only for debug)
  4675. * 3'b001: 1 usec
  4676. * 3'b010: 4 usec
  4677. * 3'b011: 8 usec (default)
  4678. * 3'b100: 16 usec
  4679. * Others: Reserved
  4680. * b'19 - response_required:
  4681. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4682. * b'20 - ipa_drop_flag:
  4683. Indicates that host will config ipa drop threshold percentage
  4684. * b'21:31 - reserved: reserved for future use
  4685. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4686. * b'8:15 - ipa drop high threshold percentage:
  4687. * b'16:31 - Reserved
  4688. */
  4689. PREPACK struct htt_sring_setup_t {
  4690. A_UINT32 msg_type: 8,
  4691. pdev_id: 8,
  4692. ring_id: 8,
  4693. ring_type: 8;
  4694. A_UINT32 ring_base_addr_lo;
  4695. A_UINT32 ring_base_addr_hi;
  4696. A_UINT32 ring_size: 16,
  4697. ring_entry_size: 8,
  4698. ring_misc_cfg_flag: 8;
  4699. A_UINT32 ring_head_offset32_remote_addr_lo;
  4700. A_UINT32 ring_head_offset32_remote_addr_hi;
  4701. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4702. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4703. A_UINT32 ring_msi_addr_lo;
  4704. A_UINT32 ring_msi_addr_hi;
  4705. A_UINT32 ring_msi_data;
  4706. A_UINT32 intr_batch_counter_th: 15,
  4707. sw_intr_mode: 1,
  4708. intr_timer_th: 16;
  4709. A_UINT32 intr_low_threshold: 16,
  4710. prefetch_timer_cfg: 3,
  4711. response_required: 1,
  4712. ipa_drop_flag: 1,
  4713. reserved1: 11;
  4714. A_UINT32 ipa_drop_low_threshold: 8,
  4715. ipa_drop_high_threshold: 8,
  4716. reserved: 16;
  4717. } POSTPACK;
  4718. enum htt_srng_ring_type {
  4719. HTT_HW_TO_SW_RING = 0,
  4720. HTT_SW_TO_HW_RING,
  4721. HTT_SW_TO_SW_RING,
  4722. /* Insert new ring types above this line */
  4723. };
  4724. enum htt_srng_ring_id {
  4725. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4726. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4727. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4728. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4729. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4730. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4731. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4732. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4733. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4734. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4735. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4736. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4737. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4738. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4739. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4740. /* Add Other SRING which can't be directly configured by host software above this line */
  4741. };
  4742. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4743. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4744. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4745. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4746. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4747. HTT_SRING_SETUP_PDEV_ID_S)
  4748. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4749. do { \
  4750. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4751. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4752. } while (0)
  4753. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4754. #define HTT_SRING_SETUP_RING_ID_S 16
  4755. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4756. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4757. HTT_SRING_SETUP_RING_ID_S)
  4758. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4761. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4762. } while (0)
  4763. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4764. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4765. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4766. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4767. HTT_SRING_SETUP_RING_TYPE_S)
  4768. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4769. do { \
  4770. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4771. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4772. } while (0)
  4773. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4774. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4775. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4776. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4777. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4778. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4779. do { \
  4780. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4781. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4782. } while (0)
  4783. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4784. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4785. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4786. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4787. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4788. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4789. do { \
  4790. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4791. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4792. } while (0)
  4793. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4794. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4795. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4796. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4797. HTT_SRING_SETUP_RING_SIZE_S)
  4798. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4799. do { \
  4800. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4801. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4802. } while (0)
  4803. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4804. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4805. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4806. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4807. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4808. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4809. do { \
  4810. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4811. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4812. } while (0)
  4813. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4814. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4815. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4816. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4817. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4818. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4819. do { \
  4820. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4821. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4822. } while (0)
  4823. /* This control bit is applicable to only Producer, which updates Ring ID field
  4824. * of each descriptor before pushing into the ring.
  4825. * 0: updates ring_id(default)
  4826. * 1: ring_id updating disabled */
  4827. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4828. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4830. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4831. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4832. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4833. do { \
  4834. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4835. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4836. } while (0)
  4837. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4838. * of each descriptor before pushing into the ring.
  4839. * 0: updates Loopcnt(default)
  4840. * 1: Loopcnt updating disabled */
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4844. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4845. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4847. do { \
  4848. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4849. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4850. } while (0)
  4851. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4852. * into security_id port of GXI/AXI. */
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4856. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4857. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4859. do { \
  4860. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4861. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4862. } while (0)
  4863. /* During MSI write operation, SRNG drives value of this register bit into
  4864. * swap bit of GXI/AXI. */
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4866. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4867. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4868. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4869. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4871. do { \
  4872. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4873. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4874. } while (0)
  4875. /* During Pointer write operation, SRNG drives value of this register bit into
  4876. * swap bit of GXI/AXI. */
  4877. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4878. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4879. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4880. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4881. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4882. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4883. do { \
  4884. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4885. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4886. } while (0)
  4887. /* During any data or TLV write operation, SRNG drives value of this register
  4888. * bit into swap bit of GXI/AXI. */
  4889. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4890. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4891. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4892. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4893. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4894. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4895. do { \
  4896. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4897. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4898. } while (0)
  4899. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4900. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4901. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4902. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4903. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4904. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4905. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4906. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4907. do { \
  4908. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4909. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4910. } while (0)
  4911. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4912. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4913. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4914. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4915. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4916. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4917. do { \
  4918. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4919. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4920. } while (0)
  4921. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4922. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4923. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4924. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4925. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4926. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4927. do { \
  4928. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4929. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4930. } while (0)
  4931. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4932. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4933. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4934. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4935. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4936. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4937. do { \
  4938. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4939. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4940. } while (0)
  4941. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4942. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4943. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4944. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4945. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4946. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4947. do { \
  4948. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4949. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4950. } while (0)
  4951. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4952. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4953. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4954. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4955. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4956. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4957. do { \
  4958. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4959. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4960. } while (0)
  4961. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4962. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4963. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4964. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4965. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4966. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4967. do { \
  4968. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4969. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4970. } while (0)
  4971. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4972. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4973. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4974. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4975. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4976. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4977. do { \
  4978. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4979. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4980. } while (0)
  4981. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4982. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4983. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4984. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4985. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4986. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4987. do { \
  4988. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4989. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4990. } while (0)
  4991. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4992. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4993. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4994. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4995. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4996. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4997. do { \
  4998. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4999. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5000. } while (0)
  5001. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5002. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5003. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5004. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5005. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5006. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5007. do { \
  5008. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5009. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5010. } while (0)
  5011. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5012. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5013. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5014. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5015. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5016. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5017. do { \
  5018. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5019. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5020. } while (0)
  5021. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5022. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5023. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5024. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5025. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5026. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5027. do { \
  5028. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5029. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5030. } while (0)
  5031. /**
  5032. * @brief host -> target RX ring selection config message
  5033. *
  5034. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5035. *
  5036. * @details
  5037. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5038. * configure RXDMA rings.
  5039. * The configuration is per ring based and includes both packet subtypes
  5040. * and PPDU/MPDU TLVs.
  5041. *
  5042. * The message would appear as follows:
  5043. *
  5044. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5045. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5046. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5047. * |-------------------------------------------------------------------|
  5048. * | rsvd2 | ring_buffer_size |
  5049. * |-------------------------------------------------------------------|
  5050. * | packet_type_enable_flags_0 |
  5051. * |-------------------------------------------------------------------|
  5052. * | packet_type_enable_flags_1 |
  5053. * |-------------------------------------------------------------------|
  5054. * | packet_type_enable_flags_2 |
  5055. * |-------------------------------------------------------------------|
  5056. * | packet_type_enable_flags_3 |
  5057. * |-------------------------------------------------------------------|
  5058. * | tlv_filter_in_flags |
  5059. * |-------------------------------------------------------------------|
  5060. * | rx_header_offset | rx_packet_offset |
  5061. * |-------------------------------------------------------------------|
  5062. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5063. * |-------------------------------------------------------------------|
  5064. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5065. * |-------------------------------------------------------------------|
  5066. * | rsvd3 | rx_attention_offset |
  5067. * |-------------------------------------------------------------------|
  5068. * | rsvd4 | mo| fp| rx_drop_threshold |
  5069. * | |ndp|ndp| |
  5070. * |-------------------------------------------------------------------|
  5071. * Where:
  5072. * PS = pkt_swap
  5073. * SS = status_swap
  5074. * OV = rx_offsets_valid
  5075. * DT = drop_thresh_valid
  5076. * The message is interpreted as follows:
  5077. * dword0 - b'0:7 - msg_type: This will be set to
  5078. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5079. * b'8:15 - pdev_id:
  5080. * 0 (for rings at SOC/UMAC level),
  5081. * 1/2/3 mac id (for rings at LMAC level)
  5082. * b'16:23 - ring_id : Identify the ring to configure.
  5083. * More details can be got from enum htt_srng_ring_id
  5084. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5085. * BUF_RING_CFG_0 defs within HW .h files,
  5086. * e.g. wmac_top_reg_seq_hwioreg.h
  5087. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5088. * BUF_RING_CFG_0 defs within HW .h files,
  5089. * e.g. wmac_top_reg_seq_hwioreg.h
  5090. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5091. * configuration fields are valid
  5092. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5093. * rx_drop_threshold field is valid
  5094. * b'28 - rx_mon_global_en: Enable/Disable global register
  5095. 8 configuration in Rx monitor module.
  5096. * b'29:31 - rsvd1: reserved for future use
  5097. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5098. * in byte units.
  5099. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5100. * b'16:18 - config_length_mgmt (MGMT):
  5101. * Represents the length of mpdu bytes for mgmt pkt.
  5102. * valid values:
  5103. * 001 - 64bytes
  5104. * 010 - 128bytes
  5105. * 100 - 256bytes
  5106. * 111 - Full mpdu bytes
  5107. * b'19:21 - config_length_ctrl (CTRL):
  5108. * Represents the length of mpdu bytes for ctrl pkt.
  5109. * valid values:
  5110. * 001 - 64bytes
  5111. * 010 - 128bytes
  5112. * 100 - 256bytes
  5113. * 111 - Full mpdu bytes
  5114. * b'22:24 - config_length_data (DATA):
  5115. * Represents the length of mpdu bytes for data pkt.
  5116. * valid values:
  5117. * 001 - 64bytes
  5118. * 010 - 128bytes
  5119. * 100 - 256bytes
  5120. * 111 - Full mpdu bytes
  5121. * b'25:26 - rx_hdr_len:
  5122. * Specifies the number of bytes of recvd packet to copy
  5123. * into the rx_hdr tlv.
  5124. * supported values for now by host:
  5125. * 01 - 64bytes
  5126. * 10 - 128bytes
  5127. * 11 - 256bytes
  5128. * default - 128 bytes
  5129. * b'27:31 - rsvd2: Reserved for future use
  5130. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5131. * Enable MGMT packet from 0b0000 to 0b1001
  5132. * bits from low to high: FP, MD, MO - 3 bits
  5133. * FP: Filter_Pass
  5134. * MD: Monitor_Direct
  5135. * MO: Monitor_Other
  5136. * 10 mgmt subtypes * 3 bits -> 30 bits
  5137. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5138. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5139. * Enable MGMT packet from 0b1010 to 0b1111
  5140. * bits from low to high: FP, MD, MO - 3 bits
  5141. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5142. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5143. * Enable CTRL packet from 0b0000 to 0b1001
  5144. * bits from low to high: FP, MD, MO - 3 bits
  5145. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5146. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5147. * Enable CTRL packet from 0b1010 to 0b1111,
  5148. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5149. * bits from low to high: FP, MD, MO - 3 bits
  5150. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5151. * dword6 - b'0:31 - tlv_filter_in_flags:
  5152. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5153. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5154. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5155. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5156. * A value of 0 will be considered as ignore this config.
  5157. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5158. * e.g. wmac_top_reg_seq_hwioreg.h
  5159. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5160. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5161. * A value of 0 will be considered as ignore this config.
  5162. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5163. * e.g. wmac_top_reg_seq_hwioreg.h
  5164. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5165. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5166. * A value of 0 will be considered as ignore this config.
  5167. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5168. * e.g. wmac_top_reg_seq_hwioreg.h
  5169. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5170. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5171. * A value of 0 will be considered as ignore this config.
  5172. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5173. * e.g. wmac_top_reg_seq_hwioreg.h
  5174. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5175. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5176. * A value of 0 will be considered as ignore this config.
  5177. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5178. * e.g. wmac_top_reg_seq_hwioreg.h
  5179. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5180. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5181. * A value of 0 will be considered as ignore this config.
  5182. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5183. * e.g. wmac_top_reg_seq_hwioreg.h
  5184. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5185. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5186. * A value of 0 will be considered as ignore this config.
  5187. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5188. * e.g. wmac_top_reg_seq_hwioreg.h
  5189. * - b'16:31 - rsvd3 for future use
  5190. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5191. * to source rings. Consumer drops packets if the available
  5192. * words in the ring falls below the configured threshold
  5193. * value.
  5194. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5195. * by host. 1 -> subscribed
  5196. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5197. * by host. 1 -> subscribed
  5198. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5199. * subscribed by host. 1 -> subscribed
  5200. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5201. * selection for the FP PHY ERR status tlv.
  5202. * 0 - wbm2rxdma_buf_source_ring
  5203. * 1 - fw2rxdma_buf_source_ring
  5204. * 2 - sw2rxdma_buf_source_ring
  5205. * 3 - no_buffer_ring
  5206. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5207. * selection for the FP PHY ERR status tlv.
  5208. * 0 - rxdma_release_ring
  5209. * 1 - rxdma2fw_ring
  5210. * 2 - rxdma2sw_ring
  5211. * 3 - rxdma2reo_ring
  5212. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5213. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5214. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5215. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5216. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5217. * 0: MSDU level logging
  5218. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5219. * 0: MSDU level logging
  5220. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5221. * 0: MSDU level logging
  5222. * - b'23 - word_mask_compaction: enable/disable word mask for
  5223. * mpdu/msdu start/end tlvs
  5224. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5225. * manager override
  5226. * - b'25:28 - rbm_override_val: return buffer manager override value
  5227. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5228. * which have to be posted to host from phy.
  5229. * Corresponding to errors defined in
  5230. * phyrx_abort_request_reason enums 0 to 31.
  5231. * Refer to RXPCU register definition header files for the
  5232. * phyrx_abort_request_reason enum definition.
  5233. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5234. * errors which have to be posted to host from phy.
  5235. * Corresponding to errors defined in
  5236. * phyrx_abort_request_reason enums 32 to 63.
  5237. * Refer to RXPCU register definition header files for the
  5238. * phyrx_abort_request_reason enum definition.
  5239. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5240. * applicable if word mask enabled
  5241. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5242. * applicable if word mask enabled
  5243. * - b'19:31 - rsvd7
  5244. * dword15- b'0:16 - rx_msdu_end_word_mask
  5245. * - b'17:31 - rsvd5
  5246. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5247. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5248. * buffer
  5249. * 1: RX_PKT TLV logging at specified offset for the
  5250. * subsequent buffer
  5251. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5252. */
  5253. PREPACK struct htt_rx_ring_selection_cfg_t {
  5254. A_UINT32 msg_type: 8,
  5255. pdev_id: 8,
  5256. ring_id: 8,
  5257. status_swap: 1,
  5258. pkt_swap: 1,
  5259. rx_offsets_valid: 1,
  5260. drop_thresh_valid: 1,
  5261. rx_mon_global_en: 1,
  5262. rsvd1: 3;
  5263. A_UINT32 ring_buffer_size: 16,
  5264. config_length_mgmt:3,
  5265. config_length_ctrl:3,
  5266. config_length_data:3,
  5267. rx_hdr_len: 2,
  5268. rsvd2: 5;
  5269. A_UINT32 packet_type_enable_flags_0;
  5270. A_UINT32 packet_type_enable_flags_1;
  5271. A_UINT32 packet_type_enable_flags_2;
  5272. A_UINT32 packet_type_enable_flags_3;
  5273. A_UINT32 tlv_filter_in_flags;
  5274. A_UINT32 rx_packet_offset: 16,
  5275. rx_header_offset: 16;
  5276. A_UINT32 rx_mpdu_end_offset: 16,
  5277. rx_mpdu_start_offset: 16;
  5278. A_UINT32 rx_msdu_end_offset: 16,
  5279. rx_msdu_start_offset: 16;
  5280. A_UINT32 rx_attn_offset: 16,
  5281. rsvd3: 16;
  5282. A_UINT32 rx_drop_threshold: 10,
  5283. fp_ndp: 1,
  5284. mo_ndp: 1,
  5285. fp_phy_err: 1,
  5286. fp_phy_err_buf_src: 2,
  5287. fp_phy_err_buf_dest: 2,
  5288. pkt_type_enable_msdu_or_mpdu_logging:3,
  5289. dma_mpdu_mgmt: 1,
  5290. dma_mpdu_ctrl: 1,
  5291. dma_mpdu_data: 1,
  5292. word_mask_compaction_enable:1,
  5293. rbm_override_enable: 1,
  5294. rbm_override_val: 4,
  5295. rsvd4: 3;
  5296. A_UINT32 phy_err_mask;
  5297. A_UINT32 phy_err_mask_cont;
  5298. A_UINT32 rx_mpdu_start_word_mask:16,
  5299. rx_mpdu_end_word_mask: 3,
  5300. rsvd7: 13;
  5301. A_UINT32 rx_msdu_end_word_mask: 17,
  5302. rsvd5: 15;
  5303. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5304. rx_pkt_tlv_offset: 15,
  5305. rsvd6: 16;
  5306. } POSTPACK;
  5307. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5308. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5309. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5310. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5311. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5312. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5313. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5314. do { \
  5315. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5316. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5317. } while (0)
  5318. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5319. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5320. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5321. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5322. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5323. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5324. do { \
  5325. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5326. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5327. } while (0)
  5328. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5329. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5330. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5331. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5332. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5333. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5334. do { \
  5335. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5336. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5337. } while (0)
  5338. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5339. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5340. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5341. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5342. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5343. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5344. do { \
  5345. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5346. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5347. } while (0)
  5348. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5349. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5350. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5351. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5352. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5353. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5354. do { \
  5355. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5356. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5357. } while (0)
  5358. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5359. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5360. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5361. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5362. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5363. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5364. do { \
  5365. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5366. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5367. } while (0)
  5368. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5369. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5370. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5371. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5372. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5373. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5374. do { \
  5375. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5376. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5377. } while (0)
  5378. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5379. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5380. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5381. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5382. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5383. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5384. do { \
  5385. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5386. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5387. } while (0)
  5388. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5389. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5390. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5391. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5392. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5393. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5394. do { \
  5395. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5396. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5397. } while (0)
  5398. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5399. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5400. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5401. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5402. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5403. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5404. do { \
  5405. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5406. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5407. } while (0)
  5408. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5409. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5410. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5411. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5412. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5413. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5414. do { \
  5415. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5416. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5417. } while (0)
  5418. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5419. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5420. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5421. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5422. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5423. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5424. do { \
  5425. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5426. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5427. } while(0)
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5431. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5432. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5434. do { \
  5435. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5436. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5437. } while (0)
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5441. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5442. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5446. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5447. } while (0)
  5448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5451. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5452. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5454. do { \
  5455. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5456. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5457. } while (0)
  5458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5461. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5462. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5466. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5467. } while (0)
  5468. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5469. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5470. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5471. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5472. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5473. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5474. do { \
  5475. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5476. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5477. } while (0)
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5479. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5480. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5481. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5482. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5483. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5484. do { \
  5485. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5486. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5487. } while (0)
  5488. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5489. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5490. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5491. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5492. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5493. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5496. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5497. } while (0)
  5498. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5499. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5500. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5501. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5502. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5503. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5506. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5507. } while (0)
  5508. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5509. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5510. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5511. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5512. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5513. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5516. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5517. } while (0)
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5519. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5520. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5521. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5522. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5524. do { \
  5525. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5526. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5527. } while (0)
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5530. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5531. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5532. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5536. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5537. } while (0)
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5540. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5541. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5542. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5543. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5546. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5547. } while (0)
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5550. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5551. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5552. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5553. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5556. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5557. } while (0)
  5558. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5559. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5560. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5561. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5562. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5563. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5566. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5567. } while (0)
  5568. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5569. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5570. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5571. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5572. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5573. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5576. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5577. } while (0)
  5578. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5579. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5580. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5581. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5582. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5583. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5586. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5587. } while (0)
  5588. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5589. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5590. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5591. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5592. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5593. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5594. do { \
  5595. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5596. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5597. } while (0)
  5598. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5599. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5600. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5601. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5602. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5603. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5604. do { \
  5605. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5606. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5607. } while (0)
  5608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5611. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5612. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5616. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5617. } while (0)
  5618. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5619. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5620. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5621. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5622. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5623. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5626. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5627. } while (0)
  5628. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5629. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5630. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5631. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5632. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5633. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5634. do { \
  5635. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5636. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5637. } while (0)
  5638. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5639. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5640. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5641. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5642. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5643. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5644. do { \
  5645. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5646. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5647. } while (0)
  5648. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5649. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5650. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5651. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5652. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5653. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5654. do { \
  5655. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5656. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5657. } while (0)
  5658. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5659. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5660. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5661. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5662. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5663. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5664. do { \
  5665. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5666. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5667. } while (0)
  5668. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5669. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5670. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5671. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5672. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5673. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5674. do { \
  5675. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5676. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5677. } while (0)
  5678. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5679. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5680. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5681. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5682. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5683. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5684. do { \
  5685. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5686. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5687. } while (0)
  5688. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5689. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5690. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5691. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5692. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5693. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5694. do { \
  5695. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5696. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5697. } while (0)
  5698. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5699. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5700. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5701. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5702. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5703. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5704. do { \
  5705. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5706. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5707. } while (0)
  5708. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5709. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5710. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5711. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5712. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5713. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5714. do { \
  5715. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5716. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5717. } while (0)
  5718. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5719. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5720. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5721. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5722. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5723. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5724. do { \
  5725. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5726. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5727. } while (0)
  5728. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5729. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5730. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5731. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5732. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5733. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5734. do { \
  5735. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5736. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5737. } while (0)
  5738. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5739. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5740. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5741. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5742. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5743. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5744. do { \
  5745. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5746. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5747. } while (0)
  5748. /*
  5749. * Subtype based MGMT frames enable bits.
  5750. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5751. */
  5752. /* association request */
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5759. /* association response */
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5766. /* Reassociation request */
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5773. /* Reassociation response */
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5780. /* Probe request */
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5787. /* Probe response */
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5794. /* Timing Advertisement */
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5801. /* Reserved */
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5808. /* Beacon */
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5815. /* ATIM */
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5822. /* Disassociation */
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5829. /* Authentication */
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5836. /* Deauthentication */
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5843. /* Action */
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5850. /* Action No Ack */
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5857. /* Reserved */
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5864. /*
  5865. * Subtype based CTRL frames enable bits.
  5866. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5867. */
  5868. /* Reserved */
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5875. /* Reserved */
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5882. /* Reserved */
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5889. /* Reserved */
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5896. /* Reserved */
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5903. /* Reserved */
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5910. /* Reserved */
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5917. /* Control Wrapper */
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5924. /* Block Ack Request */
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5931. /* Block Ack*/
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5938. /* PS-POLL */
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5945. /* RTS */
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5952. /* CTS */
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5959. /* ACK */
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5966. /* CF-END */
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5973. /* CF-END + CF-ACK */
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5980. /* Multicast data */
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5987. /* Unicast data */
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5994. /* NULL data */
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6002. do { \
  6003. HTT_CHECK_SET_VAL(httsym, value); \
  6004. (word) |= (value) << httsym##_S; \
  6005. } while (0)
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6007. (((word) & httsym##_M) >> httsym##_S)
  6008. #define htt_rx_ring_pkt_enable_subtype_set( \
  6009. word, flag, mode, type, subtype, val) \
  6010. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6011. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6012. #define htt_rx_ring_pkt_enable_subtype_get( \
  6013. word, flag, mode, type, subtype) \
  6014. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6015. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6016. /* Definition to filter in TLVs */
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6045. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6046. do { \
  6047. HTT_CHECK_SET_VAL(httsym, enable); \
  6048. (word) |= (enable) << httsym##_S; \
  6049. } while (0)
  6050. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6051. (((word) & httsym##_M) >> httsym##_S)
  6052. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6053. HTT_RX_RING_TLV_ENABLE_SET( \
  6054. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6055. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6056. HTT_RX_RING_TLV_ENABLE_GET( \
  6057. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6058. /**
  6059. * @brief host -> target TX monitor config message
  6060. *
  6061. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6062. *
  6063. * @details
  6064. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6065. * configure RXDMA rings.
  6066. * The configuration is per ring based and includes both packet types
  6067. * and PPDU/MPDU TLVs.
  6068. *
  6069. * The message would appear as follows:
  6070. *
  6071. * |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|
  6072. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6073. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6074. * |-----------+--------+--------+-----+------------------------------------|
  6075. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6076. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6077. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6078. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6079. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6080. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6081. * |------------------------------------------------------------------------|
  6082. * | tlv_filter_mask_in0 |
  6083. * |------------------------------------------------------------------------|
  6084. * | tlv_filter_mask_in1 |
  6085. * |------------------------------------------------------------------------|
  6086. * | tlv_filter_mask_in2 |
  6087. * |------------------------------------------------------------------------|
  6088. * | tlv_filter_mask_in3 |
  6089. * |-----------------+-----------------+---------------------+--------------|
  6090. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6091. * |------------------------------------------------------------------------|
  6092. * | pcu_ppdu_setup_word_mask |
  6093. * |--------------------+--+--+--+-----+---------------------+--------------|
  6094. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6095. * |------------------------------------------------------------------------|
  6096. *
  6097. * Where:
  6098. * PS = pkt_swap
  6099. * SS = status_swap
  6100. * The message is interpreted as follows:
  6101. * dword0 - b'0:7 - msg_type: This will be set to
  6102. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6103. * b'8:15 - pdev_id:
  6104. * 0 (for rings at SOC level),
  6105. * 1/2/3 mac id (for rings at LMAC level)
  6106. * b'16:23 - ring_id : Identify the ring to configure.
  6107. * More details can be got from enum htt_srng_ring_id
  6108. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6109. * BUF_RING_CFG_0 defs within HW .h files,
  6110. * e.g. wmac_top_reg_seq_hwioreg.h
  6111. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6112. * BUF_RING_CFG_0 defs within HW .h files,
  6113. * e.g. wmac_top_reg_seq_hwioreg.h
  6114. * b'26 - tx_mon_global_en: Enable/Disable global register
  6115. * configuration in Tx monitor module.
  6116. * b'27:31 - rsvd1: reserved for future use
  6117. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6118. * in byte units.
  6119. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6120. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6121. * 64, 128, 256.
  6122. * If all 3 bits are set config length is > 256.
  6123. * if val is '0', then ignore this field.
  6124. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6125. * 64, 128, 256.
  6126. * If all 3 bits are set config length is > 256.
  6127. * if val is '0', then ignore this field.
  6128. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6129. * 64, 128, 256.
  6130. * If all 3 bits are set config length is > 256.
  6131. * If val is '0', then ignore this field.
  6132. * - b'25:31 - rsvd2: Reserved for future use
  6133. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6134. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6135. * If packet_type_enable_flags is '1' for MGMT type,
  6136. * monitor will ignore this bit and allow this TLV.
  6137. * If packet_type_enable_flags is '0' for MGMT type,
  6138. * monitor will use this bit to enable/disable logging
  6139. * of this TLV.
  6140. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6141. * If packet_type_enable_flags is '1' for CTRL type,
  6142. * monitor will ignore this bit and allow this TLV.
  6143. * If packet_type_enable_flags is '0' for CTRL type,
  6144. * monitor will use this bit to enable/disable logging
  6145. * of this TLV.
  6146. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6147. * If packet_type_enable_flags is '1' for DATA type,
  6148. * monitor will ignore this bit and allow this TLV.
  6149. * If packet_type_enable_flags is '0' for DATA type,
  6150. * monitor will use this bit to enable/disable logging
  6151. * of this TLV.
  6152. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6153. * If packet_type_enable_flags is '1' for MGMT type,
  6154. * monitor will ignore this bit and allow this TLV.
  6155. * If packet_type_enable_flags is '0' for MGMT type,
  6156. * monitor will use this bit to enable/disable logging
  6157. * of this TLV.
  6158. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6159. * If packet_type_enable_flags is '1' for CTRL type,
  6160. * monitor will ignore this bit and allow this TLV.
  6161. * If packet_type_enable_flags is '0' for CTRL type,
  6162. * monitor will use this bit to enable/disable logging
  6163. * of this TLV.
  6164. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6165. * If packet_type_enable_flags is '1' for DATA type,
  6166. * monitor will ignore this bit and allow this TLV.
  6167. * If packet_type_enable_flags is '0' for DATA type,
  6168. * monitor will use this bit to enable/disable logging
  6169. * of this TLV.
  6170. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6171. * If packet_type_enable_flags is '1' for MGMT type,
  6172. * monitor will ignore this bit and allow this TLV.
  6173. * If packet_type_enable_flags is '0' for MGMT type,
  6174. * monitor will use this bit to enable/disable logging
  6175. * of this TLV.
  6176. * If filter_in_TX_MPDU_START = 1 it is recommended
  6177. * to set this bit.
  6178. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6179. * If packet_type_enable_flags is '1' for CTRL type,
  6180. * monitor will ignore this bit and allow this TLV.
  6181. * If packet_type_enable_flags is '0' for CTRL type,
  6182. * monitor will use this bit to enable/disable logging
  6183. * of this TLV.
  6184. * If filter_in_TX_MPDU_START = 1 it is recommended
  6185. * to set this bit.
  6186. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6187. * If packet_type_enable_flags is '1' for DATA type,
  6188. * monitor will ignore this bit and allow this TLV.
  6189. * If packet_type_enable_flags is '0' for DATA type,
  6190. * monitor will use this bit to enable/disable logging
  6191. * of this TLV.
  6192. * If filter_in_TX_MPDU_START = 1 it is recommended
  6193. * to set this bit.
  6194. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6195. * If packet_type_enable_flags is '1' for MGMT type,
  6196. * monitor will ignore this bit and allow this TLV.
  6197. * If packet_type_enable_flags is '0' for MGMT type,
  6198. * monitor will use this bit to enable/disable logging
  6199. * of this TLV.
  6200. * If filter_in_TX_MSDU_START = 1 it is recommended
  6201. * to set this bit.
  6202. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6203. * If packet_type_enable_flags is '1' for CTRL type,
  6204. * monitor will ignore this bit and allow this TLV.
  6205. * If packet_type_enable_flags is '0' for CTRL type,
  6206. * monitor will use this bit to enable/disable logging
  6207. * of this TLV.
  6208. * If filter_in_TX_MSDU_START = 1 it is recommended
  6209. * to set this bit.
  6210. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6211. * If packet_type_enable_flags is '1' for DATA type,
  6212. * monitor will ignore this bit and allow this TLV.
  6213. * If packet_type_enable_flags is '0' for DATA type,
  6214. * monitor will use this bit to enable/disable logging
  6215. * of this TLV.
  6216. * If filter_in_TX_MSDU_START = 1 it is recommended
  6217. * to set this bit.
  6218. * b'15:31 - rsvd3: Reserved for future use
  6219. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6220. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6221. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6222. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6223. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6224. * - b'8:15 - tx_peer_entry_word_mask:
  6225. * - b'16:23 - tx_queue_ext_word_mask:
  6226. * - b'24:31 - tx_msdu_start_word_mask:
  6227. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6228. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6229. * - b'8:15 - rxpcu_user_setup_word_mask:
  6230. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6231. * MGMT, CTRL, DATA
  6232. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6233. * 0 -> MSDU level logging is enabled
  6234. * (valid only if bit is set in
  6235. * pkt_type_enable_msdu_or_mpdu_logging)
  6236. * 1 -> MPDU level logging is enabled
  6237. * (valid only if bit is set in
  6238. * pkt_type_enable_msdu_or_mpdu_logging)
  6239. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6240. * 0 -> MSDU level logging is enabled
  6241. * (valid only if bit is set in
  6242. * pkt_type_enable_msdu_or_mpdu_logging)
  6243. * 1 -> MPDU level logging is enabled
  6244. * (valid only if bit is set in
  6245. * pkt_type_enable_msdu_or_mpdu_logging)
  6246. * - b'21 - dma_mpdu_data(D) : For DATA
  6247. * 0 -> MSDU level logging is enabled
  6248. * (valid only if bit is set in
  6249. * pkt_type_enable_msdu_or_mpdu_logging)
  6250. * 1 -> MPDU level logging is enabled
  6251. * (valid only if bit is set in
  6252. * pkt_type_enable_msdu_or_mpdu_logging)
  6253. * - b'22:31 - rsvd4 for future use
  6254. */
  6255. PREPACK struct htt_tx_monitor_cfg_t {
  6256. A_UINT32 msg_type: 8,
  6257. pdev_id: 8,
  6258. ring_id: 8,
  6259. status_swap: 1,
  6260. pkt_swap: 1,
  6261. tx_mon_global_en: 1,
  6262. rsvd1: 5;
  6263. A_UINT32 ring_buffer_size: 16,
  6264. config_length_mgmt: 3,
  6265. config_length_ctrl: 3,
  6266. config_length_data: 3,
  6267. rsvd2: 7;
  6268. A_UINT32 pkt_type_enable_flags: 3,
  6269. filter_in_tx_mpdu_start_mgmt: 1,
  6270. filter_in_tx_mpdu_start_ctrl: 1,
  6271. filter_in_tx_mpdu_start_data: 1,
  6272. filter_in_tx_msdu_start_mgmt: 1,
  6273. filter_in_tx_msdu_start_ctrl: 1,
  6274. filter_in_tx_msdu_start_data: 1,
  6275. filter_in_tx_mpdu_end_mgmt: 1,
  6276. filter_in_tx_mpdu_end_ctrl: 1,
  6277. filter_in_tx_mpdu_end_data: 1,
  6278. filter_in_tx_msdu_end_mgmt: 1,
  6279. filter_in_tx_msdu_end_ctrl: 1,
  6280. filter_in_tx_msdu_end_data: 1,
  6281. rsvd3: 17;
  6282. A_UINT32 tlv_filter_mask_in0;
  6283. A_UINT32 tlv_filter_mask_in1;
  6284. A_UINT32 tlv_filter_mask_in2;
  6285. A_UINT32 tlv_filter_mask_in3;
  6286. A_UINT32 tx_fes_setup_word_mask: 8,
  6287. tx_peer_entry_word_mask: 8,
  6288. tx_queue_ext_word_mask: 8,
  6289. tx_msdu_start_word_mask: 8;
  6290. A_UINT32 pcu_ppdu_setup_word_mask;
  6291. A_UINT32 tx_mpdu_start_word_mask: 8,
  6292. rxpcu_user_setup_word_mask: 8,
  6293. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6294. dma_mpdu_mgmt: 1,
  6295. dma_mpdu_ctrl: 1,
  6296. dma_mpdu_data: 1,
  6297. rsvd4: 10;
  6298. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6299. tx_peer_entry_v2_word_mask: 12,
  6300. rsvd5: 10;
  6301. A_UINT32 fes_status_end_word_mask: 16,
  6302. response_end_status_word_mask: 16;
  6303. A_UINT32 fes_status_prot_word_mask: 11,
  6304. rsvd6: 21;
  6305. } POSTPACK;
  6306. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6307. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6308. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6309. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6310. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6311. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6312. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6313. do { \
  6314. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6315. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6316. } while (0)
  6317. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6318. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6319. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6320. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6321. HTT_TX_MONITOR_CFG_RING_ID_S)
  6322. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6323. do { \
  6324. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6325. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6326. } while (0)
  6327. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6328. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6329. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6330. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6331. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6332. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6333. do { \
  6334. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6335. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6336. } while (0)
  6337. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6338. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6339. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6340. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6341. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6342. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6343. do { \
  6344. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6345. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6346. } while (0)
  6347. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6348. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6349. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6350. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6351. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6352. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6353. do { \
  6354. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6355. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6356. } while (0)
  6357. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6358. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6359. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6360. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6361. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6362. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6363. do { \
  6364. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6365. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6366. } while (0)
  6367. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6368. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6369. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6370. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6371. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6372. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6373. do { \
  6374. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6375. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6376. } while (0)
  6377. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6378. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6379. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6380. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6381. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6382. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6383. do { \
  6384. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6385. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6386. } while (0)
  6387. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6388. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6389. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6390. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6391. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6392. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6393. do { \
  6394. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6395. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6396. } while (0)
  6397. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6398. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6399. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6400. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6401. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6402. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6403. do { \
  6404. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6405. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6406. } while (0)
  6407. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6408. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6409. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6410. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6411. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6412. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6413. do { \
  6414. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6415. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6416. } while (0)
  6417. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6418. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6419. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6420. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6421. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6422. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6423. do { \
  6424. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6425. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6426. } while (0)
  6427. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6428. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6429. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6430. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6431. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6432. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6433. do { \
  6434. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6435. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6436. } while (0)
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6438. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6439. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6440. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6441. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6442. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6443. do { \
  6444. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6445. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6446. } while (0)
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6448. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6449. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6450. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6451. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6452. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6453. do { \
  6454. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6455. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6456. } while (0)
  6457. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6458. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6459. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6460. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6461. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6462. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6463. do { \
  6464. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6465. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6466. } while (0)
  6467. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6468. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6469. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6470. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6471. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6472. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6473. do { \
  6474. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6475. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6476. } while (0)
  6477. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6478. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6479. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6480. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6481. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6482. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6483. do { \
  6484. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6485. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6486. } while (0)
  6487. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6488. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6489. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6490. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6491. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6492. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6493. do { \
  6494. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6495. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6496. } while (0)
  6497. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6498. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6499. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6500. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6501. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6502. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6503. do { \
  6504. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6505. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6506. } while (0)
  6507. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6508. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6509. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6510. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6511. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6512. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6513. do { \
  6514. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6515. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6516. } while (0)
  6517. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6518. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6519. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6520. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6521. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6522. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6523. do { \
  6524. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6525. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6526. } while (0)
  6527. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6528. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6529. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6530. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6531. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6532. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6533. do { \
  6534. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6535. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6536. } while (0)
  6537. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6538. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6539. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6540. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6541. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6542. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6543. do { \
  6544. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6545. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6546. } while (0)
  6547. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6548. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6549. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6550. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6551. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6552. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6553. do { \
  6554. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6555. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6556. } while (0)
  6557. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6558. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6559. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6560. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6561. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6562. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6563. do { \
  6564. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6565. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6566. } while (0)
  6567. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6568. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6569. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6570. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6571. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6572. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6573. do { \
  6574. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6575. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6576. } while (0)
  6577. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6578. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6579. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6580. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6581. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6582. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6583. do { \
  6584. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6585. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6586. } while (0)
  6587. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6588. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6589. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6590. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6591. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6592. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6593. do { \
  6594. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6595. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6596. } while (0)
  6597. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6598. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6599. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6600. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6601. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6602. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6603. do { \
  6604. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6605. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6606. } while (0)
  6607. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6608. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6609. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6610. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6611. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6612. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6613. do { \
  6614. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6615. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6616. } while (0)
  6617. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6618. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6619. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6620. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6621. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6622. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6623. do { \
  6624. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6625. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6626. } while (0)
  6627. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6628. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6629. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6630. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6631. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6632. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6633. do { \
  6634. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6635. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6636. } while (0)
  6637. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6638. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6639. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6640. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6641. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6642. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6643. do { \
  6644. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6645. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6646. } while (0)
  6647. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6648. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6649. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6650. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6651. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6652. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6653. do { \
  6654. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6655. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6656. } while (0)
  6657. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6658. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6659. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6660. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6661. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6662. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6663. do { \
  6664. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6665. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6666. } while (0)
  6667. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6668. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6669. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6670. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6671. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6672. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6673. do { \
  6674. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6675. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6676. } while (0)
  6677. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6678. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6679. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6680. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6681. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6682. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6683. do { \
  6684. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6685. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6686. } while (0)
  6687. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6688. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6689. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6690. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6691. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6692. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6693. do { \
  6694. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6695. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6696. } while (0)
  6697. /*
  6698. * pkt_type_enable_flags
  6699. */
  6700. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6701. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6702. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6703. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6704. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6705. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6706. /*
  6707. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6708. */
  6709. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6710. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6711. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6712. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6713. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6714. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6715. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6716. do { \
  6717. HTT_CHECK_SET_VAL(httsym, value); \
  6718. (word) |= (value) << httsym##_S; \
  6719. } while (0)
  6720. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6721. (((word) & httsym##_M) >> httsym##_S)
  6722. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6723. * type -> MGMT, CTRL, DATA*/
  6724. #define htt_tx_ring_pkt_type_set( \
  6725. word, mode, type, val) \
  6726. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6727. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6728. #define htt_tx_ring_pkt_type_get( \
  6729. word, mode, type) \
  6730. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6731. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6732. /* Definition to filter in TLVs */
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6797. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6798. do { \
  6799. HTT_CHECK_SET_VAL(httsym, enable); \
  6800. (word) |= (enable) << httsym##_S; \
  6801. } while (0)
  6802. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6803. (((word) & httsym##_M) >> httsym##_S)
  6804. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6805. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6806. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6807. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6808. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6809. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6874. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6875. do { \
  6876. HTT_CHECK_SET_VAL(httsym, enable); \
  6877. (word) |= (enable) << httsym##_S; \
  6878. } while (0)
  6879. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6880. (((word) & httsym##_M) >> httsym##_S)
  6881. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6882. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6883. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6884. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6885. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6886. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6951. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6952. do { \
  6953. HTT_CHECK_SET_VAL(httsym, enable); \
  6954. (word) |= (enable) << httsym##_S; \
  6955. } while (0)
  6956. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6957. (((word) & httsym##_M) >> httsym##_S)
  6958. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6959. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6960. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6961. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6962. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6963. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7008. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7009. do { \
  7010. HTT_CHECK_SET_VAL(httsym, enable); \
  7011. (word) |= (enable) << httsym##_S; \
  7012. } while (0)
  7013. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7014. (((word) & httsym##_M) >> httsym##_S)
  7015. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7016. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7017. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7018. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7019. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7020. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7021. /**
  7022. * @brief host --> target Receive Flow Steering configuration message definition
  7023. *
  7024. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7025. *
  7026. * host --> target Receive Flow Steering configuration message definition.
  7027. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7028. * The reason for this is we want RFS to be configured and ready before MAC
  7029. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7030. *
  7031. * |31 24|23 16|15 9|8|7 0|
  7032. * |----------------+----------------+----------------+----------------|
  7033. * | reserved |E| msg type |
  7034. * |-------------------------------------------------------------------|
  7035. * Where E = RFS enable flag
  7036. *
  7037. * The RFS_CONFIG message consists of a single 4-byte word.
  7038. *
  7039. * Header fields:
  7040. * - MSG_TYPE
  7041. * Bits 7:0
  7042. * Purpose: identifies this as a RFS config msg
  7043. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7044. * - RFS_CONFIG
  7045. * Bit 8
  7046. * Purpose: Tells target whether to enable (1) or disable (0)
  7047. * flow steering feature when sending rx indication messages to host
  7048. */
  7049. #define HTT_H2T_RFS_CONFIG_M 0x100
  7050. #define HTT_H2T_RFS_CONFIG_S 8
  7051. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7052. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7053. HTT_H2T_RFS_CONFIG_S)
  7054. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7055. do { \
  7056. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7057. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7058. } while (0)
  7059. #define HTT_RFS_CFG_REQ_BYTES 4
  7060. /**
  7061. * @brief host -> target FW extended statistics request
  7062. *
  7063. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7064. *
  7065. * @details
  7066. * The following field definitions describe the format of the HTT host
  7067. * to target FW extended stats retrieve message.
  7068. * The message specifies the type of stats the host wants to retrieve.
  7069. *
  7070. * |31 24|23 16|15 8|7 0|
  7071. * |-----------------------------------------------------------|
  7072. * | reserved | stats type | pdev_mask | msg type |
  7073. * |-----------------------------------------------------------|
  7074. * | config param [0] |
  7075. * |-----------------------------------------------------------|
  7076. * | config param [1] |
  7077. * |-----------------------------------------------------------|
  7078. * | config param [2] |
  7079. * |-----------------------------------------------------------|
  7080. * | config param [3] |
  7081. * |-----------------------------------------------------------|
  7082. * | reserved |
  7083. * |-----------------------------------------------------------|
  7084. * | cookie LSBs |
  7085. * |-----------------------------------------------------------|
  7086. * | cookie MSBs |
  7087. * |-----------------------------------------------------------|
  7088. * Header fields:
  7089. * - MSG_TYPE
  7090. * Bits 7:0
  7091. * Purpose: identifies this is a extended stats upload request message
  7092. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7093. * - PDEV_MASK
  7094. * Bits 8:15
  7095. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7096. * Value: This is a overloaded field, refer to usage and interpretation of
  7097. * PDEV in interface document.
  7098. * Bit 8 : Reserved for SOC stats
  7099. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7100. * Indicates MACID_MASK in DBS
  7101. * - STATS_TYPE
  7102. * Bits 23:16
  7103. * Purpose: identifies which FW statistics to upload
  7104. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7105. * - Reserved
  7106. * Bits 31:24
  7107. * - CONFIG_PARAM [0]
  7108. * Bits 31:0
  7109. * Purpose: give an opaque configuration value to the specified stats type
  7110. * Value: stats-type specific configuration value
  7111. * Refer to htt_stats.h for interpretation for each stats sub_type
  7112. * - CONFIG_PARAM [1]
  7113. * Bits 31:0
  7114. * Purpose: give an opaque configuration value to the specified stats type
  7115. * Value: stats-type specific configuration value
  7116. * Refer to htt_stats.h for interpretation for each stats sub_type
  7117. * - CONFIG_PARAM [2]
  7118. * Bits 31:0
  7119. * Purpose: give an opaque configuration value to the specified stats type
  7120. * Value: stats-type specific configuration value
  7121. * Refer to htt_stats.h for interpretation for each stats sub_type
  7122. * - CONFIG_PARAM [3]
  7123. * Bits 31:0
  7124. * Purpose: give an opaque configuration value to the specified stats type
  7125. * Value: stats-type specific configuration value
  7126. * Refer to htt_stats.h for interpretation for each stats sub_type
  7127. * - Reserved [31:0] for future use.
  7128. * - COOKIE_LSBS
  7129. * Bits 31:0
  7130. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7131. * message with its preceding host->target stats request message.
  7132. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7133. * - COOKIE_MSBS
  7134. * Bits 31:0
  7135. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7136. * message with its preceding host->target stats request message.
  7137. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7138. */
  7139. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7140. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7141. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7142. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7143. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7144. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7145. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7146. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7147. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7148. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7149. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7150. do { \
  7151. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7152. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7153. } while (0)
  7154. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7155. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7156. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7157. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7158. do { \
  7159. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7160. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7161. } while (0)
  7162. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7163. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7164. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7165. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7166. do { \
  7167. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7168. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7169. } while (0)
  7170. /**
  7171. * @brief host -> target FW streaming statistics request
  7172. *
  7173. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7174. *
  7175. * @details
  7176. * The following field definitions describe the format of the HTT host
  7177. * to target message that requests the target to start or stop producing
  7178. * ongoing stats of the specified type.
  7179. *
  7180. * |31|30 |23 16|15 8|7 0|
  7181. * |-----------------------------------------------------------|
  7182. * |EN| reserved | stats type | reserved | msg type |
  7183. * |-----------------------------------------------------------|
  7184. * | config param [0] |
  7185. * |-----------------------------------------------------------|
  7186. * | config param [1] |
  7187. * |-----------------------------------------------------------|
  7188. * | config param [2] |
  7189. * |-----------------------------------------------------------|
  7190. * | config param [3] |
  7191. * |-----------------------------------------------------------|
  7192. * Where:
  7193. * - EN is an enable/disable flag
  7194. * Header fields:
  7195. * - MSG_TYPE
  7196. * Bits 7:0
  7197. * Purpose: identifies this is a streaming stats upload request message
  7198. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7199. * - STATS_TYPE
  7200. * Bits 23:16
  7201. * Purpose: identifies which FW statistics to upload
  7202. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7203. * Only the htt_dbg_ext_stats_type values identified as streaming
  7204. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7205. * - ENABLE
  7206. * Bit 31
  7207. * Purpose: enable/disable the target's ongoing stats of the specified type
  7208. * Value:
  7209. * 0 - disable ongoing production of the specified stats type
  7210. * 1 - enable ongoing production of the specified stats type
  7211. * - CONFIG_PARAM [0]
  7212. * Bits 31:0
  7213. * Purpose: give an opaque configuration value to the specified stats type
  7214. * Value: stats-type specific configuration value
  7215. * Refer to htt_stats.h for interpretation for each stats sub_type
  7216. * - CONFIG_PARAM [1]
  7217. * Bits 31:0
  7218. * Purpose: give an opaque configuration value to the specified stats type
  7219. * Value: stats-type specific configuration value
  7220. * Refer to htt_stats.h for interpretation for each stats sub_type
  7221. * - CONFIG_PARAM [2]
  7222. * Bits 31:0
  7223. * Purpose: give an opaque configuration value to the specified stats type
  7224. * Value: stats-type specific configuration value
  7225. * Refer to htt_stats.h for interpretation for each stats sub_type
  7226. * - CONFIG_PARAM [3]
  7227. * Bits 31:0
  7228. * Purpose: give an opaque configuration value to the specified stats type
  7229. * Value: stats-type specific configuration value
  7230. * Refer to htt_stats.h for interpretation for each stats sub_type
  7231. */
  7232. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7233. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7234. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7235. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7236. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7237. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7238. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7239. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7240. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7241. do { \
  7242. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7243. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7244. } while (0)
  7245. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7246. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7247. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7248. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7249. do { \
  7250. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7251. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7252. } while (0)
  7253. /**
  7254. * @brief host -> target FW PPDU_STATS request message
  7255. *
  7256. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7257. *
  7258. * @details
  7259. * The following field definitions describe the format of the HTT host
  7260. * to target FW for PPDU_STATS_CFG msg.
  7261. * The message allows the host to configure the PPDU_STATS_IND messages
  7262. * produced by the target.
  7263. *
  7264. * |31 24|23 16|15 8|7 0|
  7265. * |-----------------------------------------------------------|
  7266. * | REQ bit mask | pdev_mask | msg type |
  7267. * |-----------------------------------------------------------|
  7268. * Header fields:
  7269. * - MSG_TYPE
  7270. * Bits 7:0
  7271. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7272. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7273. * - PDEV_MASK
  7274. * Bits 8:15
  7275. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7276. * Value: This is a overloaded field, refer to usage and interpretation of
  7277. * PDEV in interface document.
  7278. * Bit 8 : Reserved for SOC stats
  7279. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7280. * Indicates MACID_MASK in DBS
  7281. * - REQ_TLV_BIT_MASK
  7282. * Bits 16:31
  7283. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7284. * needs to be included in the target's PPDU_STATS_IND messages.
  7285. * Value: refer htt_ppdu_stats_tlv_tag_t
  7286. *
  7287. */
  7288. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7289. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7290. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7291. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7292. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7293. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7294. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7295. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7296. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7297. do { \
  7298. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7299. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7300. } while (0)
  7301. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7302. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7303. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7304. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7305. do { \
  7306. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7307. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7308. } while (0)
  7309. /**
  7310. * @brief Host-->target HTT RX FSE setup message
  7311. *
  7312. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7313. *
  7314. * @details
  7315. * Through this message, the host will provide details of the flow tables
  7316. * in host DDR along with hash keys.
  7317. * This message can be sent per SOC or per PDEV, which is differentiated
  7318. * by pdev id values.
  7319. * The host will allocate flow search table and sends table size,
  7320. * physical DMA address of flow table, and hash keys to firmware to
  7321. * program into the RXOLE FSE HW block.
  7322. *
  7323. * The following field definitions describe the format of the RX FSE setup
  7324. * message sent from the host to target
  7325. *
  7326. * Header fields:
  7327. * dword0 - b'7:0 - msg_type: This will be set to
  7328. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7329. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7330. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7331. * pdev's LMAC ring.
  7332. * b'31:16 - reserved : Reserved for future use
  7333. * dword1 - b'19:0 - number of records: This field indicates the number of
  7334. * entries in the flow table. For example: 8k number of
  7335. * records is equivalent to
  7336. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7337. * b'27:20 - max search: This field specifies the skid length to FSE
  7338. * parser HW module whenever match is not found at the
  7339. * exact index pointed by hash.
  7340. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7341. * Refer htt_ip_da_sa_prefix below for more details.
  7342. * b'31:30 - reserved: Reserved for future use
  7343. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7344. * table allocated by host in DDR
  7345. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7346. * table allocated by host in DDR
  7347. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7348. * entry hashing
  7349. *
  7350. *
  7351. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7352. * |---------------------------------------------------------------|
  7353. * | reserved | pdev_id | MSG_TYPE |
  7354. * |---------------------------------------------------------------|
  7355. * |resvd|IPDSA| max_search | Number of records |
  7356. * |---------------------------------------------------------------|
  7357. * | base address lo |
  7358. * |---------------------------------------------------------------|
  7359. * | base address high |
  7360. * |---------------------------------------------------------------|
  7361. * | toeplitz key 31_0 |
  7362. * |---------------------------------------------------------------|
  7363. * | toeplitz key 63_32 |
  7364. * |---------------------------------------------------------------|
  7365. * | toeplitz key 95_64 |
  7366. * |---------------------------------------------------------------|
  7367. * | toeplitz key 127_96 |
  7368. * |---------------------------------------------------------------|
  7369. * | toeplitz key 159_128 |
  7370. * |---------------------------------------------------------------|
  7371. * | toeplitz key 191_160 |
  7372. * |---------------------------------------------------------------|
  7373. * | toeplitz key 223_192 |
  7374. * |---------------------------------------------------------------|
  7375. * | toeplitz key 255_224 |
  7376. * |---------------------------------------------------------------|
  7377. * | toeplitz key 287_256 |
  7378. * |---------------------------------------------------------------|
  7379. * | reserved | toeplitz key 314_288(26:0 bits) |
  7380. * |---------------------------------------------------------------|
  7381. * where:
  7382. * IPDSA = ip_da_sa
  7383. */
  7384. /**
  7385. * @brief: htt_ip_da_sa_prefix
  7386. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7387. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7388. * documentation per RFC3849
  7389. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7390. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7391. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7392. */
  7393. enum htt_ip_da_sa_prefix {
  7394. HTT_RX_IPV6_20010db8,
  7395. HTT_RX_IPV4_MAPPED_IPV6,
  7396. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7397. HTT_RX_IPV6_64FF9B,
  7398. };
  7399. /**
  7400. * @brief Host-->target HTT RX FISA configure and enable
  7401. *
  7402. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7403. *
  7404. * @details
  7405. * The host will send this command down to configure and enable the FISA
  7406. * operational params.
  7407. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7408. * register.
  7409. * Should configure both the MACs.
  7410. *
  7411. * dword0 - b'7:0 - msg_type:
  7412. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7413. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7414. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7415. * pdev's LMAC ring.
  7416. * b'31:16 - reserved : Reserved for future use
  7417. *
  7418. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7419. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7420. * packets. 1 flow search will be skipped
  7421. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7422. * tcp,udp packets
  7423. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7424. * calculation
  7425. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7426. * calculation
  7427. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7428. * calculation
  7429. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7430. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7431. * length
  7432. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7433. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7434. * length
  7435. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7436. * num jump
  7437. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7438. * num jump
  7439. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7440. * data type switch has happened for MPDU Sequence num jump
  7441. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7442. * for MPDU Sequence num jump
  7443. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7444. * for decrypt errors
  7445. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7446. * while aggregating a msdu
  7447. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7448. * The aggregation is done until (number of MSDUs aggregated
  7449. * < LIMIT + 1)
  7450. * b'31:18 - Reserved
  7451. *
  7452. * fisa_control_value - 32bit value FW can write to register
  7453. *
  7454. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7455. * Threshold value for FISA timeout (units are microseconds).
  7456. * When the global timestamp exceeds this threshold, FISA
  7457. * aggregation will be restarted.
  7458. * A value of 0 means timeout is disabled.
  7459. * Compare the threshold register with timestamp field in
  7460. * flow entry to generate timeout for the flow.
  7461. *
  7462. * |31 18 |17 16|15 8|7 0|
  7463. * |-------------------------------------------------------------|
  7464. * | reserved | pdev_mask | msg type |
  7465. * |-------------------------------------------------------------|
  7466. * | reserved | FISA_CTRL |
  7467. * |-------------------------------------------------------------|
  7468. * | FISA_TIMEOUT_THRESH |
  7469. * |-------------------------------------------------------------|
  7470. */
  7471. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7472. A_UINT32 msg_type:8,
  7473. pdev_id:8,
  7474. reserved0:16;
  7475. /**
  7476. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7477. * [17:0]
  7478. */
  7479. union {
  7480. /*
  7481. * fisa_control_bits structure is deprecated.
  7482. * Please use fisa_control_bits_v2 going forward.
  7483. */
  7484. struct {
  7485. A_UINT32 fisa_enable: 1,
  7486. ipsec_skip_search: 1,
  7487. nontcp_skip_search: 1,
  7488. add_ipv4_fixed_hdr_len: 1,
  7489. add_ipv6_fixed_hdr_len: 1,
  7490. add_tcp_fixed_hdr_len: 1,
  7491. add_udp_hdr_len: 1,
  7492. chksum_cum_ip_len_en: 1,
  7493. disable_tid_check: 1,
  7494. disable_ta_check: 1,
  7495. disable_qos_check: 1,
  7496. disable_raw_check: 1,
  7497. disable_decrypt_err_check: 1,
  7498. disable_msdu_drop_check: 1,
  7499. fisa_aggr_limit: 4,
  7500. reserved: 14;
  7501. } fisa_control_bits;
  7502. struct {
  7503. A_UINT32 fisa_enable: 1,
  7504. fisa_aggr_limit: 4,
  7505. reserved: 27;
  7506. } fisa_control_bits_v2;
  7507. A_UINT32 fisa_control_value;
  7508. } u_fisa_control;
  7509. /**
  7510. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7511. * timeout threshold for aggregation. Unit in usec.
  7512. * [31:0]
  7513. */
  7514. A_UINT32 fisa_timeout_threshold;
  7515. } POSTPACK;
  7516. /* DWord 0: pdev-ID */
  7517. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7518. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7519. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7520. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7521. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7522. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7523. do { \
  7524. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7525. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7526. } while (0)
  7527. /* Dword 1: fisa_control_value fisa config */
  7528. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7529. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7530. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7531. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7532. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7533. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7534. do { \
  7535. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7536. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7537. } while (0)
  7538. /* Dword 1: fisa_control_value ipsec_skip_search */
  7539. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7540. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7541. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7542. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7543. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7544. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7545. do { \
  7546. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7547. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7548. } while (0)
  7549. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7550. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7551. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7552. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7553. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7554. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7555. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7556. do { \
  7557. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7558. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7559. } while (0)
  7560. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7561. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7562. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7563. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7564. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7565. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7566. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7567. do { \
  7568. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7569. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7570. } while (0)
  7571. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7572. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7573. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7574. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7575. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7576. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7577. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7578. do { \
  7579. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7580. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7581. } while (0)
  7582. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7583. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7584. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7585. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7586. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7587. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7588. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7589. do { \
  7590. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7591. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7592. } while (0)
  7593. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7594. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7595. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7596. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7597. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7598. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7599. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7600. do { \
  7601. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7602. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7603. } while (0)
  7604. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7605. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7606. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7607. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7608. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7609. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7610. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7611. do { \
  7612. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7613. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7614. } while (0)
  7615. /* Dword 1: fisa_control_value disable_tid_check */
  7616. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7617. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7618. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7619. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7620. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7621. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7622. do { \
  7623. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7624. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7625. } while (0)
  7626. /* Dword 1: fisa_control_value disable_ta_check */
  7627. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7628. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7629. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7630. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7631. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7632. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7633. do { \
  7634. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7635. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7636. } while (0)
  7637. /* Dword 1: fisa_control_value disable_qos_check */
  7638. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7639. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7640. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7641. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7642. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7643. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7644. do { \
  7645. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7646. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7647. } while (0)
  7648. /* Dword 1: fisa_control_value disable_raw_check */
  7649. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7650. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7651. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7652. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7653. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7654. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7655. do { \
  7656. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7657. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7658. } while (0)
  7659. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7660. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7661. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7662. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7663. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7664. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7665. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7666. do { \
  7667. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7668. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7669. } while (0)
  7670. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7671. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7672. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7673. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7674. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7675. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7676. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7677. do { \
  7678. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7679. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7680. } while (0)
  7681. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7682. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7683. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7684. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7685. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7686. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7687. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7688. do { \
  7689. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7690. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7691. } while (0)
  7692. /* Dword 1: fisa_control_value fisa config */
  7693. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7694. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7695. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7696. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7697. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7698. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7699. do { \
  7700. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7701. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7702. } while (0)
  7703. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7704. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7705. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7706. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7707. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7708. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7709. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7710. do { \
  7711. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7712. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7713. } while (0)
  7714. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7715. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7716. pdev_id:8,
  7717. reserved0:16;
  7718. A_UINT32 num_records:20,
  7719. max_search:8,
  7720. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7721. reserved1:2;
  7722. A_UINT32 base_addr_lo;
  7723. A_UINT32 base_addr_hi;
  7724. A_UINT32 toeplitz31_0;
  7725. A_UINT32 toeplitz63_32;
  7726. A_UINT32 toeplitz95_64;
  7727. A_UINT32 toeplitz127_96;
  7728. A_UINT32 toeplitz159_128;
  7729. A_UINT32 toeplitz191_160;
  7730. A_UINT32 toeplitz223_192;
  7731. A_UINT32 toeplitz255_224;
  7732. A_UINT32 toeplitz287_256;
  7733. A_UINT32 toeplitz314_288:27,
  7734. reserved2:5;
  7735. } POSTPACK;
  7736. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7737. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7738. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7739. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7740. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7741. /* DWORD 0: Pdev ID */
  7742. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7743. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7744. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7745. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7746. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7747. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7748. do { \
  7749. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7750. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7751. } while (0)
  7752. /* DWORD 1:num of records */
  7753. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7754. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7755. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7756. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7757. HTT_RX_FSE_SETUP_NUM_REC_S)
  7758. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7759. do { \
  7760. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7761. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7762. } while (0)
  7763. /* DWORD 1:max_search */
  7764. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7765. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7766. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7767. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7768. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7769. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7770. do { \
  7771. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7772. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7773. } while (0)
  7774. /* DWORD 1:ip_da_sa prefix */
  7775. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7776. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7777. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7778. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7779. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7780. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7781. do { \
  7782. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7783. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7784. } while (0)
  7785. /* DWORD 2: Base Address LO */
  7786. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7787. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7788. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7789. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7790. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7791. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7792. do { \
  7793. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7794. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7795. } while (0)
  7796. /* DWORD 3: Base Address High */
  7797. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7798. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7799. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7800. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7801. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7802. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7803. do { \
  7804. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7805. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7806. } while (0)
  7807. /* DWORD 4-12: Hash Value */
  7808. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7809. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7810. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7811. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7812. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7813. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7814. do { \
  7815. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7816. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7817. } while (0)
  7818. /* DWORD 13: Hash Value 314:288 bits */
  7819. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7820. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7821. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7822. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7823. do { \
  7824. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7825. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7826. } while (0)
  7827. /**
  7828. * @brief Host-->target HTT RX FSE operation message
  7829. *
  7830. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7831. *
  7832. * @details
  7833. * The host will send this Flow Search Engine (FSE) operation message for
  7834. * every flow add/delete operation.
  7835. * The FSE operation includes FSE full cache invalidation or individual entry
  7836. * invalidation.
  7837. * This message can be sent per SOC or per PDEV which is differentiated
  7838. * by pdev id values.
  7839. *
  7840. * |31 16|15 8|7 1|0|
  7841. * |-------------------------------------------------------------|
  7842. * | reserved | pdev_id | MSG_TYPE |
  7843. * |-------------------------------------------------------------|
  7844. * | reserved | operation |I|
  7845. * |-------------------------------------------------------------|
  7846. * | ip_src_addr_31_0 |
  7847. * |-------------------------------------------------------------|
  7848. * | ip_src_addr_63_32 |
  7849. * |-------------------------------------------------------------|
  7850. * | ip_src_addr_95_64 |
  7851. * |-------------------------------------------------------------|
  7852. * | ip_src_addr_127_96 |
  7853. * |-------------------------------------------------------------|
  7854. * | ip_dst_addr_31_0 |
  7855. * |-------------------------------------------------------------|
  7856. * | ip_dst_addr_63_32 |
  7857. * |-------------------------------------------------------------|
  7858. * | ip_dst_addr_95_64 |
  7859. * |-------------------------------------------------------------|
  7860. * | ip_dst_addr_127_96 |
  7861. * |-------------------------------------------------------------|
  7862. * | l4_dst_port | l4_src_port |
  7863. * | (32-bit SPI incase of IPsec) |
  7864. * |-------------------------------------------------------------|
  7865. * | reserved | l4_proto |
  7866. * |-------------------------------------------------------------|
  7867. *
  7868. * where I is 1-bit ipsec_valid.
  7869. *
  7870. * The following field definitions describe the format of the RX FSE operation
  7871. * message sent from the host to target for every add/delete flow entry to flow
  7872. * table.
  7873. *
  7874. * Header fields:
  7875. * dword0 - b'7:0 - msg_type: This will be set to
  7876. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7877. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7878. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7879. * specified pdev's LMAC ring.
  7880. * b'31:16 - reserved : Reserved for future use
  7881. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7882. * (Internet Protocol Security).
  7883. * IPsec describes the framework for providing security at
  7884. * IP layer. IPsec is defined for both versions of IP:
  7885. * IPV4 and IPV6.
  7886. * Please refer to htt_rx_flow_proto enumeration below for
  7887. * more info.
  7888. * ipsec_valid = 1 for IPSEC packets
  7889. * ipsec_valid = 0 for IP Packets
  7890. * b'7:1 - operation: This indicates types of FSE operation.
  7891. * Refer to htt_rx_fse_operation enumeration:
  7892. * 0 - No Cache Invalidation required
  7893. * 1 - Cache invalidate only one entry given by IP
  7894. * src/dest address at DWORD[2:9]
  7895. * 2 - Complete FSE Cache Invalidation
  7896. * 3 - FSE Disable
  7897. * 4 - FSE Enable
  7898. * b'31:8 - reserved: Reserved for future use
  7899. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7900. * for per flow addition/deletion
  7901. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7902. * and the subsequent 3 A_UINT32 will be padding bytes.
  7903. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7904. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7905. * from 0 to 65535 but only 0 to 1023 are designated as
  7906. * well-known ports. Refer to [RFC1700] for more details.
  7907. * This field is valid only if
  7908. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7909. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7910. * range from 0 to 65535 but only 0 to 1023 are designated
  7911. * as well-known ports. Refer to [RFC1700] for more details.
  7912. * This field is valid only if
  7913. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7914. * - SPI (31:0): Security Parameters Index is an
  7915. * identification tag added to the header while using IPsec
  7916. * for tunneling the IP traffici.
  7917. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7918. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7919. * Assigned Internet Protocol Numbers.
  7920. * l4_proto numbers for standard protocol like UDP/TCP
  7921. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7922. * l4_proto = 17 for UDP etc.
  7923. * b'31:8 - reserved: Reserved for future use.
  7924. *
  7925. */
  7926. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7927. A_UINT32 msg_type:8,
  7928. pdev_id:8,
  7929. reserved0:16;
  7930. A_UINT32 ipsec_valid:1,
  7931. operation:7,
  7932. reserved1:24;
  7933. A_UINT32 ip_src_addr_31_0;
  7934. A_UINT32 ip_src_addr_63_32;
  7935. A_UINT32 ip_src_addr_95_64;
  7936. A_UINT32 ip_src_addr_127_96;
  7937. A_UINT32 ip_dest_addr_31_0;
  7938. A_UINT32 ip_dest_addr_63_32;
  7939. A_UINT32 ip_dest_addr_95_64;
  7940. A_UINT32 ip_dest_addr_127_96;
  7941. union {
  7942. A_UINT32 spi;
  7943. struct {
  7944. A_UINT32 l4_src_port:16,
  7945. l4_dest_port:16;
  7946. } ip;
  7947. } u;
  7948. A_UINT32 l4_proto:8,
  7949. reserved:24;
  7950. } POSTPACK;
  7951. /**
  7952. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7953. *
  7954. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7955. *
  7956. * @details
  7957. * The host will send this Full monitor mode register configuration message.
  7958. * This message can be sent per SOC or per PDEV which is differentiated
  7959. * by pdev id values.
  7960. *
  7961. * |31 16|15 11|10 8|7 3|2|1|0|
  7962. * |-------------------------------------------------------------|
  7963. * | reserved | pdev_id | MSG_TYPE |
  7964. * |-------------------------------------------------------------|
  7965. * | reserved |Release Ring |N|Z|E|
  7966. * |-------------------------------------------------------------|
  7967. *
  7968. * where E is 1-bit full monitor mode enable/disable.
  7969. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7970. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7971. *
  7972. * The following field definitions describe the format of the full monitor
  7973. * mode configuration message sent from the host to target for each pdev.
  7974. *
  7975. * Header fields:
  7976. * dword0 - b'7:0 - msg_type: This will be set to
  7977. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7978. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7979. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7980. * specified pdev's LMAC ring.
  7981. * b'31:16 - reserved : Reserved for future use.
  7982. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7983. * monitor mode rxdma register is to be enabled or disabled.
  7984. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7985. * additional descriptors at ppdu end for zero mpdus
  7986. * enabled or disabled.
  7987. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7988. * additional descriptors at ppdu end for non zero mpdus
  7989. * enabled or disabled.
  7990. * b'10:3 - release_ring: This indicates the destination ring
  7991. * selection for the descriptor at the end of PPDU
  7992. * 0 - REO ring select
  7993. * 1 - FW ring select
  7994. * 2 - SW ring select
  7995. * 3 - Release ring select
  7996. * Refer to htt_rx_full_mon_release_ring.
  7997. * b'31:11 - reserved for future use
  7998. */
  7999. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8000. A_UINT32 msg_type:8,
  8001. pdev_id:8,
  8002. reserved0:16;
  8003. A_UINT32 full_monitor_mode_enable:1,
  8004. addnl_descs_zero_mpdus_end:1,
  8005. addnl_descs_non_zero_mpdus_end:1,
  8006. release_ring:8,
  8007. reserved1:21;
  8008. } POSTPACK;
  8009. /**
  8010. * Enumeration for full monitor mode destination ring select
  8011. * 0 - REO destination ring select
  8012. * 1 - FW destination ring select
  8013. * 2 - SW destination ring select
  8014. * 3 - Release destination ring select
  8015. */
  8016. enum htt_rx_full_mon_release_ring {
  8017. HTT_RX_MON_RING_REO,
  8018. HTT_RX_MON_RING_FW,
  8019. HTT_RX_MON_RING_SW,
  8020. HTT_RX_MON_RING_RELEASE,
  8021. };
  8022. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8023. /* DWORD 0: Pdev ID */
  8024. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8025. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8026. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8027. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8028. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8029. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8030. do { \
  8031. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8032. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8033. } while (0)
  8034. /* DWORD 1:ENABLE */
  8035. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8036. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8037. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8038. do { \
  8039. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8040. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8041. } while (0)
  8042. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8043. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8044. /* DWORD 1:ZERO_MPDU */
  8045. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8046. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8047. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8048. do { \
  8049. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8050. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8051. } while (0)
  8052. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8053. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8054. /* DWORD 1:NON_ZERO_MPDU */
  8055. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8056. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8057. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8058. do { \
  8059. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8060. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8061. } while (0)
  8062. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8063. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8064. /* DWORD 1:RELEASE_RINGS */
  8065. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8066. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8067. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8068. do { \
  8069. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8070. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8071. } while (0)
  8072. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8073. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8074. /**
  8075. * Enumeration for IP Protocol or IPSEC Protocol
  8076. * IPsec describes the framework for providing security at IP layer.
  8077. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8078. */
  8079. enum htt_rx_flow_proto {
  8080. HTT_RX_FLOW_IP_PROTO,
  8081. HTT_RX_FLOW_IPSEC_PROTO,
  8082. };
  8083. /**
  8084. * Enumeration for FSE Cache Invalidation
  8085. * 0 - No Cache Invalidation required
  8086. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8087. * 2 - Complete FSE Cache Invalidation
  8088. * 3 - FSE Disable
  8089. * 4 - FSE Enable
  8090. */
  8091. enum htt_rx_fse_operation {
  8092. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8093. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8094. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8095. HTT_RX_FSE_DISABLE,
  8096. HTT_RX_FSE_ENABLE,
  8097. };
  8098. /* DWORD 0: Pdev ID */
  8099. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8100. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8101. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8102. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8103. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8104. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8105. do { \
  8106. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8107. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8108. } while (0)
  8109. /* DWORD 1:IP PROTO or IPSEC */
  8110. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8111. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8112. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8113. do { \
  8114. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8115. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8116. } while (0)
  8117. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8118. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8119. /* DWORD 1:FSE Operation */
  8120. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8121. #define HTT_RX_FSE_OPERATION_S 1
  8122. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8123. do { \
  8124. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8125. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8126. } while (0)
  8127. #define HTT_RX_FSE_OPERATION_GET(word) \
  8128. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8129. /* DWORD 2-9:IP Address */
  8130. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8131. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8132. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8133. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8134. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8135. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8136. do { \
  8137. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8138. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8139. } while (0)
  8140. /* DWORD 10:Source Port Number */
  8141. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8142. #define HTT_RX_FSE_SOURCEPORT_S 0
  8143. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8144. do { \
  8145. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8146. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8147. } while (0)
  8148. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8149. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8150. /* DWORD 11:Destination Port Number */
  8151. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8152. #define HTT_RX_FSE_DESTPORT_S 16
  8153. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8154. do { \
  8155. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8156. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8157. } while (0)
  8158. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8159. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8160. /* DWORD 10-11:SPI (In case of IPSEC) */
  8161. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8162. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8163. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8164. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8165. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8166. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8167. do { \
  8168. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8169. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8170. } while (0)
  8171. /* DWORD 12:L4 PROTO */
  8172. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8173. #define HTT_RX_FSE_L4_PROTO_S 0
  8174. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8175. do { \
  8176. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8177. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8178. } while (0)
  8179. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8180. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8181. /**
  8182. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8183. *
  8184. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8185. *
  8186. * |31 24|23 |15 8|7 2|1|0|
  8187. * |----------------+----------------+----------------+----------------|
  8188. * | reserved | pdev_id | msg_type |
  8189. * |---------------------------------+----------------+----------------|
  8190. * | reserved |E|F|
  8191. * |---------------------------------+----------------+----------------|
  8192. * Where E = Configure the target to provide the 3-tuple hash value in
  8193. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8194. * F = Configure the target to provide the 3-tuple hash value in
  8195. * flow_id_toeplitz field of rx_msdu_start tlv
  8196. *
  8197. * The following field definitions describe the format of the 3 tuple hash value
  8198. * message sent from the host to target as part of initialization sequence.
  8199. *
  8200. * Header fields:
  8201. * dword0 - b'7:0 - msg_type: This will be set to
  8202. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8203. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8204. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8205. * specified pdev's LMAC ring.
  8206. * b'31:16 - reserved : Reserved for future use
  8207. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8208. * b'1 - toeplitz_hash_2_or_4_field_enable
  8209. * b'31:2 - reserved : Reserved for future use
  8210. * ---------+------+----------------------------------------------------------
  8211. * bit1 | bit0 | Functionality
  8212. * ---------+------+----------------------------------------------------------
  8213. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8214. * | | in flow_id_toeplitz field
  8215. * ---------+------+----------------------------------------------------------
  8216. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8217. * | | in toeplitz_hash_2_or_4 field
  8218. * ---------+------+----------------------------------------------------------
  8219. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8220. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8221. * ---------+------+----------------------------------------------------------
  8222. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8223. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8224. * | | toeplitz_hash_2_or_4 field
  8225. *----------------------------------------------------------------------------
  8226. */
  8227. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8228. A_UINT32 msg_type :8,
  8229. pdev_id :8,
  8230. reserved0 :16;
  8231. A_UINT32 flow_id_toeplitz_field_enable :1,
  8232. toeplitz_hash_2_or_4_field_enable :1,
  8233. reserved1 :30;
  8234. } POSTPACK;
  8235. /* DWORD0 : pdev_id configuration Macros */
  8236. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8237. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8238. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8239. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8240. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8241. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8242. do { \
  8243. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8244. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8245. } while (0)
  8246. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8247. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8248. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8249. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8250. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8251. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8252. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8253. do { \
  8254. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8255. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8256. } while (0)
  8257. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8258. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8259. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8260. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8261. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8262. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8263. do { \
  8264. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8265. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8266. } while (0)
  8267. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8268. /**
  8269. * @brief host --> target Host PA Address Size
  8270. *
  8271. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8272. *
  8273. * @details
  8274. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8275. * provide the physical start address and size of each of the memory
  8276. * areas within host DDR that the target FW may need to access.
  8277. *
  8278. * For example, the host can use this message to allow the target FW
  8279. * to set up access to the host's pools of TQM link descriptors.
  8280. * The message would appear as follows:
  8281. *
  8282. * |31 24|23 16|15 8|7 0|
  8283. * |----------------+----------------+----------------+----------------|
  8284. * | reserved | num_entries | msg_type |
  8285. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8286. * | mem area 0 size |
  8287. * |----------------+----------------+----------------+----------------|
  8288. * | mem area 0 physical_address_lo |
  8289. * |----------------+----------------+----------------+----------------|
  8290. * | mem area 0 physical_address_hi |
  8291. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8292. * | mem area 1 size |
  8293. * |----------------+----------------+----------------+----------------|
  8294. * | mem area 1 physical_address_lo |
  8295. * |----------------+----------------+----------------+----------------|
  8296. * | mem area 1 physical_address_hi |
  8297. * |----------------+----------------+----------------+----------------|
  8298. * ...
  8299. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8300. * | mem area N size |
  8301. * |----------------+----------------+----------------+----------------|
  8302. * | mem area N physical_address_lo |
  8303. * |----------------+----------------+----------------+----------------|
  8304. * | mem area N physical_address_hi |
  8305. * |----------------+----------------+----------------+----------------|
  8306. *
  8307. * The message is interpreted as follows:
  8308. * dword0 - b'0:7 - msg_type: This will be set to
  8309. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8310. * b'8:15 - number_entries: Indicated the number of host memory
  8311. * areas specified within the remainder of the message
  8312. * b'16:31 - reserved.
  8313. * dword1 - b'0:31 - memory area 0 size in bytes
  8314. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8315. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8316. * and similar for memory area 1 through memory area N.
  8317. */
  8318. PREPACK struct htt_h2t_host_paddr_size {
  8319. A_UINT32 msg_type: 8,
  8320. num_entries: 8,
  8321. reserved: 16;
  8322. } POSTPACK;
  8323. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8324. A_UINT32 size;
  8325. A_UINT32 physical_address_lo;
  8326. A_UINT32 physical_address_hi;
  8327. } POSTPACK;
  8328. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8329. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8330. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8331. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8332. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8333. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8334. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8335. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8336. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8337. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8338. do { \
  8339. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8340. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8341. } while (0)
  8342. /**
  8343. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8344. *
  8345. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8346. *
  8347. * @details
  8348. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8349. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8350. *
  8351. * The message would appear as follows:
  8352. *
  8353. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8354. * |---------------------------------+---+---+----------+-+-----------|
  8355. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8356. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8357. *
  8358. *
  8359. * The message is interpreted as follows:
  8360. * dword0 - b'0:7 - msg_type: This will be set to
  8361. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8362. * b'8 - override bit to drive MSDUs to PPE ring
  8363. * b'9:13 - REO destination ring indication
  8364. * b'14 - Multi buffer msdu override enable bit
  8365. * b'15 - Intra BSS override
  8366. * b'16 - Decap raw override
  8367. * b'17 - Decap Native wifi override
  8368. * b'18 - IP frag override
  8369. * b'19:31 - reserved
  8370. */
  8371. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8372. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8373. override: 1,
  8374. reo_destination_indication: 5,
  8375. multi_buffer_msdu_override_en: 1,
  8376. intra_bss_override: 1,
  8377. decap_raw_override: 1,
  8378. decap_nwifi_override: 1,
  8379. ip_frag_override: 1,
  8380. reserved: 13;
  8381. } POSTPACK;
  8382. /* DWORD 0: Override */
  8383. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8384. #define HTT_PPE_CFG_OVERRIDE_S 8
  8385. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8386. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8387. HTT_PPE_CFG_OVERRIDE_S)
  8388. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8389. do { \
  8390. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8391. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8392. } while (0)
  8393. /* DWORD 0: REO Destination Indication*/
  8394. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8395. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8396. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8397. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8398. HTT_PPE_CFG_REO_DEST_IND_S)
  8399. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8400. do { \
  8401. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8402. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8403. } while (0)
  8404. /* DWORD 0: Multi buffer MSDU override */
  8405. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8406. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8407. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8408. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8409. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8410. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8411. do { \
  8412. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8413. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8414. } while (0)
  8415. /* DWORD 0: Intra BSS override */
  8416. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8417. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8418. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8419. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8420. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8421. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8422. do { \
  8423. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8424. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8425. } while (0)
  8426. /* DWORD 0: Decap RAW override */
  8427. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8428. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8429. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8430. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8431. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8432. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8433. do { \
  8434. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8435. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8436. } while (0)
  8437. /* DWORD 0: Decap NWIFI override */
  8438. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8439. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8440. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8441. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8442. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8443. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8444. do { \
  8445. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8446. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8447. } while (0)
  8448. /* DWORD 0: IP frag override */
  8449. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8450. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8451. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8452. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8453. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8454. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8455. do { \
  8456. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8457. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8458. } while (0)
  8459. /*
  8460. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8461. *
  8462. * @details
  8463. * The following field definitions describe the format of the HTT host
  8464. * to target FW VDEV TX RX stats retrieve message.
  8465. * The message specifies the type of stats the host wants to retrieve.
  8466. *
  8467. * |31 27|26 25|24 17|16|15 8|7 0|
  8468. * |-----------------------------------------------------------|
  8469. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8470. * |-----------------------------------------------------------|
  8471. * | vdev_id lower bitmask |
  8472. * |-----------------------------------------------------------|
  8473. * | vdev_id upper bitmask |
  8474. * |-----------------------------------------------------------|
  8475. * Header fields:
  8476. * Where:
  8477. * dword0 - b'7:0 - msg_type: This will be set to
  8478. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8479. * b'15:8 - pdev id
  8480. * b'16(E) - Enable/Disable the vdev HW stats
  8481. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8482. * b'25:26(R) - Reset stats bits
  8483. * 0: don't reset stats
  8484. * 1: reset stats once
  8485. * 2: reset stats at the start of each periodic interval
  8486. * b'27:31 - reserved for future use
  8487. * dword1 - b'0:31 - vdev_id lower bitmask
  8488. * dword2 - b'0:31 - vdev_id upper bitmask
  8489. */
  8490. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8491. A_UINT32 msg_type :8,
  8492. pdev_id :8,
  8493. enable :1,
  8494. periodic_interval :8,
  8495. reset_stats_bits :2,
  8496. reserved0 :5;
  8497. A_UINT32 vdev_id_lower_bitmask;
  8498. A_UINT32 vdev_id_upper_bitmask;
  8499. } POSTPACK;
  8500. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8501. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8502. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8503. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8504. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8505. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8506. do { \
  8507. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8508. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8509. } while (0)
  8510. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8511. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8512. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8513. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8514. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8515. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8516. do { \
  8517. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8518. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8519. } while (0)
  8520. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8521. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8522. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8523. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8524. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8525. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8526. do { \
  8527. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8528. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8529. } while (0)
  8530. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8531. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8532. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8533. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8534. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8535. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8536. do { \
  8537. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8538. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8539. } while (0)
  8540. /*
  8541. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8542. *
  8543. * @details
  8544. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8545. * the default MSDU queues for one of the TIDs within the specified peer
  8546. * to the specified service class.
  8547. * The TID is indirectly specified - each service class is associated
  8548. * with a TID. All default MSDU queues for this peer-TID will be
  8549. * linked to the service class in question.
  8550. *
  8551. * |31 16|15 8|7 0|
  8552. * |------------------------------+--------------+--------------|
  8553. * | peer ID | svc class ID | msg type |
  8554. * |------------------------------------------------------------|
  8555. * Header fields:
  8556. * dword0 - b'7:0 - msg_type: This will be set to
  8557. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8558. * b'15:8 - service class ID
  8559. * b'31:16 - peer ID
  8560. */
  8561. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8562. A_UINT32 msg_type :8,
  8563. svc_class_id :8,
  8564. peer_id :16;
  8565. } POSTPACK;
  8566. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8567. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8568. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8569. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8570. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8571. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8572. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8573. do { \
  8574. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8575. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8576. } while (0)
  8577. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8578. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8579. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8580. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8581. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8582. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8583. do { \
  8584. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8585. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8586. } while (0)
  8587. /*
  8588. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8589. *
  8590. * @details
  8591. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8592. * remove the linkage of the specified peer-TID's MSDU queues to
  8593. * service classes.
  8594. *
  8595. * |31 16|15 8|7 0|
  8596. * |------------------------------+--------------+--------------|
  8597. * | peer ID | svc class ID | msg type |
  8598. * |------------------------------------------------------------|
  8599. * Header fields:
  8600. * dword0 - b'7:0 - msg_type: This will be set to
  8601. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8602. * b'15:8 - service class ID
  8603. * b'31:16 - peer ID
  8604. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8605. * value for peer ID indicates that the target should
  8606. * apply the UNMAP_REQ to all peers.
  8607. */
  8608. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8609. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8610. A_UINT32 msg_type :8,
  8611. svc_class_id :8,
  8612. peer_id :16;
  8613. } POSTPACK;
  8614. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8615. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8616. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8617. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8618. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8619. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8620. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8621. do { \
  8622. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8623. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8624. } while (0)
  8625. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8626. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8627. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8628. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8629. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8630. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8631. do { \
  8632. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8633. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8634. } while (0)
  8635. /*
  8636. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8637. *
  8638. * @details
  8639. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8640. * request the target to report what service class the default MSDU queues
  8641. * of the specified TIDs within the peer are linked to.
  8642. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8643. * to report what service class (if any) the default MSDU queues for
  8644. * each of the specified TIDs are linked to.
  8645. *
  8646. * |31 16|15 8|7 1| 0|
  8647. * |------------------------------+--------------+--------------|
  8648. * | peer ID | TID mask | msg type |
  8649. * |------------------------------------------------------------|
  8650. * | reserved |ETO|
  8651. * |------------------------------------------------------------|
  8652. * Header fields:
  8653. * dword0 - b'7:0 - msg_type: This will be set to
  8654. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8655. * b'15:8 - TID mask
  8656. * b'31:16 - peer ID
  8657. * dword1 - b'0 - "Existing Tids Only" flag
  8658. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8659. * message generated by this REQ will only show the
  8660. * mapping for TIDs that actually exist in the target's
  8661. * peer object.
  8662. * Any TIDs that are covered by a MAP_REQ but which
  8663. * do not actually exist will be shown as being
  8664. * unmapped (i.e. svc class ID 0xff).
  8665. * If this flag is cleared, the MAP_REPORT_CONF message
  8666. * will consider not only the mapping of TIDs currently
  8667. * existing in the peer, but also the mapping that will
  8668. * be applied for any TID objects created within this
  8669. * peer in the future.
  8670. * b'31:1 - reserved for future use
  8671. */
  8672. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8673. A_UINT32 msg_type :8,
  8674. tid_mask :8,
  8675. peer_id :16;
  8676. A_UINT32 existing_tids_only:1,
  8677. reserved :31;
  8678. } POSTPACK;
  8679. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8680. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8681. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8682. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8683. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8684. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8685. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8686. do { \
  8687. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8688. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8689. } while (0)
  8690. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8691. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8692. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8693. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8694. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8695. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8696. do { \
  8697. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8698. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8699. } while (0)
  8700. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8701. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8702. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8703. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8704. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8705. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8706. do { \
  8707. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8708. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8709. } while (0)
  8710. /**
  8711. * @brief Format of shared memory between Host and Target
  8712. * for UMAC hang recovery feature messaging.
  8713. * @details
  8714. * This is shared memory between Host and Target allocated
  8715. * and used in chips where UMAC hang recovery feature is supported.
  8716. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8717. * then host interprets it as a new message from target.
  8718. * Host clears that particular read bit in t2h_msg after each read
  8719. * operation. It is vice versa for h2t_msg. At any given point
  8720. * of time there is expected to be only one bit set
  8721. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8722. *
  8723. * The message is interpreted as follows:
  8724. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8725. * added for debuggability purpose.
  8726. * dword1 - b'0 - do_pre_reset
  8727. * b'1 - do_post_reset_start
  8728. * b'2 - do_post_reset_complete
  8729. * b'3:31 - rsvd_t2h
  8730. * dword2 - b'0 - pre_reset_done
  8731. * b'1 - post_reset_start_done
  8732. * b'2 - post_reset_complete_done
  8733. * b'3:31 - rsvd_h2t
  8734. */
  8735. PREPACK typedef struct {
  8736. /** Magic number added for debuggability. */
  8737. A_UINT32 magic_num;
  8738. union {
  8739. /*
  8740. * BIT [0] :- T2H msg to do pre-reset
  8741. * BIT [1] :- T2H msg to do post-reset start
  8742. * BIT [2] :- T2H msg to do post-reset complete
  8743. * BIT [31 : 3] :- reserved
  8744. */
  8745. A_UINT32 t2h_msg;
  8746. struct {
  8747. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8748. do_post_reset_start : 1, /* BIT [1] */
  8749. do_post_reset_complete : 1, /* BIT [2] */
  8750. rsvd_t2h : 29; /* BIT [31 : 3] */
  8751. };
  8752. };
  8753. union {
  8754. /*
  8755. * BIT [0] :- H2T msg to send pre-reset done
  8756. * BIT [1] :- H2T msg to send post-reset start done
  8757. * BIT [2] :- H2T msg to send post-reset complete done
  8758. * BIT [31 : 3] :- reserved
  8759. */
  8760. A_UINT32 h2t_msg;
  8761. struct {
  8762. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8763. post_reset_start_done : 1, /* BIT [1] */
  8764. post_reset_complete_done : 1, /* BIT [2] */
  8765. rsvd_h2t : 29; /* BIT [31 : 3] */
  8766. };
  8767. };
  8768. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8769. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8770. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8771. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8772. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8773. /* dword1 - b'0 - do_pre_reset */
  8774. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8775. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8776. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8777. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8778. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8779. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8780. do { \
  8781. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8782. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8783. } while (0)
  8784. /* dword1 - b'1 - do_post_reset_start */
  8785. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8786. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8787. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8788. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8789. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8790. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8791. do { \
  8792. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8793. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8794. } while (0)
  8795. /* dword1 - b'2 - do_post_reset_complete */
  8796. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8797. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8798. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8799. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8800. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8801. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8802. do { \
  8803. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8804. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8805. } while (0)
  8806. /* dword2 - b'0 - pre_reset_done */
  8807. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8808. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8809. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8810. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8811. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8812. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8813. do { \
  8814. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8815. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8816. } while (0)
  8817. /* dword2 - b'1 - post_reset_start_done */
  8818. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8819. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8820. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8821. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8822. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8823. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8824. do { \
  8825. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8826. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8827. } while (0)
  8828. /* dword2 - b'2 - post_reset_complete_done */
  8829. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8830. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8831. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8832. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8833. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8834. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8835. do { \
  8836. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8837. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8838. } while (0)
  8839. /**
  8840. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8841. *
  8842. * @details
  8843. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8844. * by the host to provide prerequisite info to target for the UMAC hang
  8845. * recovery feature.
  8846. * The info sent in this H2T message are T2H message method, H2T message
  8847. * method, T2H MSI interrupt number and physical start address, size of
  8848. * the shared memory (refers to the shared memory dedicated for messaging
  8849. * between host and target when the DUT is in UMAC hang recovery mode).
  8850. * This H2T message is expected to be only sent if the WMI service bit
  8851. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8852. *
  8853. * |31 16|15 12|11 8|7 0|
  8854. * |-------------------------------+--------------+--------------+------------|
  8855. * | reserved |h2t msg method|t2h msg method| msg_type |
  8856. * |--------------------------------------------------------------------------|
  8857. * | t2h msi interrupt number |
  8858. * |--------------------------------------------------------------------------|
  8859. * | shared memory area size |
  8860. * |--------------------------------------------------------------------------|
  8861. * | shared memory area physical address low |
  8862. * |--------------------------------------------------------------------------|
  8863. * | shared memory area physical address high |
  8864. * |--------------------------------------------------------------------------|
  8865. *
  8866. * The message is interpreted as follows:
  8867. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8868. * b'8:11 - t2h_msg_method: indicates method to be used for
  8869. * T2H communication in UMAC hang recovery mode.
  8870. * Value zero indicates MSI interrupt (default method).
  8871. * Refer to htt_umac_hang_recovery_msg_method enum.
  8872. * b'12:15 - h2t_msg_method: indicates method to be used for
  8873. * H2T communication in UMAC hang recovery mode.
  8874. * Value zero indicates polling by target for this h2t msg
  8875. * during UMAC hang recovery mode.
  8876. * Refer to htt_umac_hang_recovery_msg_method enum.
  8877. * b'16:31 - reserved.
  8878. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8879. * T2H communication in UMAC hang recovery mode.
  8880. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8881. * only when in UMAC hang recovery mode.
  8882. * This refers to size in bytes.
  8883. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8884. * of the shared memory dedicated for messaging only when
  8885. * in UMAC hang recovery mode.
  8886. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8887. * of the shared memory dedicated for messaging only when
  8888. * in UMAC hang recovery mode.
  8889. */
  8890. /* t2h_msg_method and h2t_msg_method */
  8891. enum htt_umac_hang_recovery_msg_method {
  8892. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8893. };
  8894. PREPACK typedef struct {
  8895. A_UINT32 msg_type : 8,
  8896. t2h_msg_method : 4,
  8897. h2t_msg_method : 4,
  8898. reserved : 16;
  8899. A_UINT32 t2h_msi_data;
  8900. /* size bytes and physical address of shared memory. */
  8901. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8902. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8903. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8904. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8905. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8906. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8907. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8908. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8909. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8910. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8911. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8912. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8913. do { \
  8914. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8915. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8916. } while (0)
  8917. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8918. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8919. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8920. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8921. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8922. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8923. do { \
  8924. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8925. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8926. } while (0)
  8927. /*=== target -> host messages ===============================================*/
  8928. enum htt_t2h_msg_type {
  8929. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8930. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8931. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8932. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8933. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8934. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8935. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8936. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8937. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8938. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8939. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8940. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8941. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8942. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8943. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8944. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8945. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8946. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8947. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8948. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8949. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8950. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8951. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8952. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8953. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8954. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8955. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8956. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8957. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8958. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8959. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8960. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8961. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8962. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8963. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8964. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8965. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8966. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8967. /* TX_OFFLOAD_DELIVER_IND:
  8968. * Forward the target's locally-generated packets to the host,
  8969. * to provide to the monitor mode interface.
  8970. */
  8971. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8972. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8973. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8974. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8975. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8976. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8977. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8978. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8979. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8980. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8981. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8982. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8983. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8984. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8985. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  8986. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  8987. HTT_T2H_MSG_TYPE_TEST,
  8988. /* keep this last */
  8989. HTT_T2H_NUM_MSGS
  8990. };
  8991. /*
  8992. * HTT target to host message type -
  8993. * stored in bits 7:0 of the first word of the message
  8994. */
  8995. #define HTT_T2H_MSG_TYPE_M 0xff
  8996. #define HTT_T2H_MSG_TYPE_S 0
  8997. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8998. do { \
  8999. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9000. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9001. } while (0)
  9002. #define HTT_T2H_MSG_TYPE_GET(word) \
  9003. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9004. /**
  9005. * @brief target -> host version number confirmation message definition
  9006. *
  9007. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9008. *
  9009. * |31 24|23 16|15 8|7 0|
  9010. * |----------------+----------------+----------------+----------------|
  9011. * | reserved | major number | minor number | msg type |
  9012. * |-------------------------------------------------------------------|
  9013. * : option request TLV (optional) |
  9014. * :...................................................................:
  9015. *
  9016. * The VER_CONF message may consist of a single 4-byte word, or may be
  9017. * extended with TLVs that specify HTT options selected by the target.
  9018. * The following option TLVs may be appended to the VER_CONF message:
  9019. * - LL_BUS_ADDR_SIZE
  9020. * - HL_SUPPRESS_TX_COMPL_IND
  9021. * - MAX_TX_QUEUE_GROUPS
  9022. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9023. * may be appended to the VER_CONF message (but only one TLV of each type).
  9024. *
  9025. * Header fields:
  9026. * - MSG_TYPE
  9027. * Bits 7:0
  9028. * Purpose: identifies this as a version number confirmation message
  9029. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9030. * - VER_MINOR
  9031. * Bits 15:8
  9032. * Purpose: Specify the minor number of the HTT message library version
  9033. * in use by the target firmware.
  9034. * The minor number specifies the specific revision within a range
  9035. * of fundamentally compatible HTT message definition revisions.
  9036. * Compatible revisions involve adding new messages or perhaps
  9037. * adding new fields to existing messages, in a backwards-compatible
  9038. * manner.
  9039. * Incompatible revisions involve changing the message type values,
  9040. * or redefining existing messages.
  9041. * Value: minor number
  9042. * - VER_MAJOR
  9043. * Bits 15:8
  9044. * Purpose: Specify the major number of the HTT message library version
  9045. * in use by the target firmware.
  9046. * The major number specifies the family of minor revisions that are
  9047. * fundamentally compatible with each other, but not with prior or
  9048. * later families.
  9049. * Value: major number
  9050. */
  9051. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9052. #define HTT_VER_CONF_MINOR_S 8
  9053. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9054. #define HTT_VER_CONF_MAJOR_S 16
  9055. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9056. do { \
  9057. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9058. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9059. } while (0)
  9060. #define HTT_VER_CONF_MINOR_GET(word) \
  9061. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9062. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9063. do { \
  9064. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9065. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9066. } while (0)
  9067. #define HTT_VER_CONF_MAJOR_GET(word) \
  9068. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9069. #define HTT_VER_CONF_BYTES 4
  9070. /**
  9071. * @brief - target -> host HTT Rx In order indication message
  9072. *
  9073. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9074. *
  9075. * @details
  9076. *
  9077. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9078. * |----------------+-------------------+---------------------+---------------|
  9079. * | peer ID | P| F| O| ext TID | msg type |
  9080. * |--------------------------------------------------------------------------|
  9081. * | MSDU count | Reserved | vdev id |
  9082. * |--------------------------------------------------------------------------|
  9083. * | MSDU 0 bus address (bits 31:0) |
  9084. #if HTT_PADDR64
  9085. * | MSDU 0 bus address (bits 63:32) |
  9086. #endif
  9087. * |--------------------------------------------------------------------------|
  9088. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9089. * |--------------------------------------------------------------------------|
  9090. * | MSDU 1 bus address (bits 31:0) |
  9091. #if HTT_PADDR64
  9092. * | MSDU 1 bus address (bits 63:32) |
  9093. #endif
  9094. * |--------------------------------------------------------------------------|
  9095. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9096. * |--------------------------------------------------------------------------|
  9097. */
  9098. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9099. *
  9100. * @details
  9101. * bits
  9102. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9103. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9104. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9105. * | | frag | | | | fail |chksum fail|
  9106. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9107. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9108. */
  9109. struct htt_rx_in_ord_paddr_ind_hdr_t
  9110. {
  9111. A_UINT32 /* word 0 */
  9112. msg_type: 8,
  9113. ext_tid: 5,
  9114. offload: 1,
  9115. frag: 1,
  9116. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9117. peer_id: 16;
  9118. A_UINT32 /* word 1 */
  9119. vap_id: 8,
  9120. /* NOTE:
  9121. * This reserved_1 field is not truly reserved - certain targets use
  9122. * this field internally to store debug information, and do not zero
  9123. * out the contents of the field before uploading the message to the
  9124. * host. Thus, any host-target communication supported by this field
  9125. * is limited to using values that are never used by the debug
  9126. * information stored by certain targets in the reserved_1 field.
  9127. * In particular, the targets in question don't use the value 0x3
  9128. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9129. * so this previously-unused value within these bits is available to
  9130. * use as the host / target PKT_CAPTURE_MODE flag.
  9131. */
  9132. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9133. /* if pkt_capture_mode == 0x3, host should
  9134. * send rx frames to monitor mode interface
  9135. */
  9136. msdu_cnt: 16;
  9137. };
  9138. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9139. {
  9140. A_UINT32 dma_addr;
  9141. A_UINT32
  9142. length: 16,
  9143. fw_desc: 8,
  9144. msdu_info:8;
  9145. };
  9146. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9147. {
  9148. A_UINT32 dma_addr_lo;
  9149. A_UINT32 dma_addr_hi;
  9150. A_UINT32
  9151. length: 16,
  9152. fw_desc: 8,
  9153. msdu_info:8;
  9154. };
  9155. #if HTT_PADDR64
  9156. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9157. #else
  9158. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9159. #endif
  9160. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9161. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9162. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9163. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9164. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9165. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9166. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9167. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9168. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9169. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9170. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9171. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9172. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9173. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9174. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9175. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9176. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9177. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9178. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9179. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9180. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9181. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9182. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9183. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9184. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9185. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9186. /* for systems using 64-bit format for bus addresses */
  9187. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9188. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9189. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9190. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9191. /* for systems using 32-bit format for bus addresses */
  9192. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9193. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9194. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9195. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9196. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9197. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9198. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9199. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9200. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9201. do { \
  9202. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9203. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9204. } while (0)
  9205. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9206. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9207. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9208. do { \
  9209. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9210. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9211. } while (0)
  9212. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9213. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9214. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9217. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9218. } while (0)
  9219. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9220. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9221. /*
  9222. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9223. * deliver the rx frames to the monitor mode interface.
  9224. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9225. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9226. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9227. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9228. */
  9229. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9230. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9231. do { \
  9232. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9233. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9234. } while (0)
  9235. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9236. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9237. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9238. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9239. do { \
  9240. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9241. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9242. } while (0)
  9243. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9244. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9245. /* for systems using 64-bit format for bus addresses */
  9246. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9247. do { \
  9248. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9249. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9250. } while (0)
  9251. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9252. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9253. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9254. do { \
  9255. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9256. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9257. } while (0)
  9258. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9259. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9260. /* for systems using 32-bit format for bus addresses */
  9261. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9262. do { \
  9263. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9264. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9265. } while (0)
  9266. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9267. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9268. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9269. do { \
  9270. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9271. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9272. } while (0)
  9273. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9274. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9275. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9276. do { \
  9277. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9278. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9279. } while (0)
  9280. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9281. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9282. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9283. do { \
  9284. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9285. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9286. } while (0)
  9287. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9288. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9289. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9290. do { \
  9291. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9292. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9293. } while (0)
  9294. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9295. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9296. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9297. do { \
  9298. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9299. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9300. } while (0)
  9301. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9302. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9303. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9304. do { \
  9305. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9306. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9307. } while (0)
  9308. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9309. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9310. /* definitions used within target -> host rx indication message */
  9311. PREPACK struct htt_rx_ind_hdr_prefix_t
  9312. {
  9313. A_UINT32 /* word 0 */
  9314. msg_type: 8,
  9315. ext_tid: 5,
  9316. release_valid: 1,
  9317. flush_valid: 1,
  9318. reserved0: 1,
  9319. peer_id: 16;
  9320. A_UINT32 /* word 1 */
  9321. flush_start_seq_num: 6,
  9322. flush_end_seq_num: 6,
  9323. release_start_seq_num: 6,
  9324. release_end_seq_num: 6,
  9325. num_mpdu_ranges: 8;
  9326. } POSTPACK;
  9327. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9328. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9329. #define HTT_TGT_RSSI_INVALID 0x80
  9330. PREPACK struct htt_rx_ppdu_desc_t
  9331. {
  9332. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9333. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9334. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9335. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9336. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9337. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9338. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9339. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9340. A_UINT32 /* word 0 */
  9341. rssi_cmb: 8,
  9342. timestamp_submicrosec: 8,
  9343. phy_err_code: 8,
  9344. phy_err: 1,
  9345. legacy_rate: 4,
  9346. legacy_rate_sel: 1,
  9347. end_valid: 1,
  9348. start_valid: 1;
  9349. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9350. union {
  9351. A_UINT32 /* word 1 */
  9352. rssi0_pri20: 8,
  9353. rssi0_ext20: 8,
  9354. rssi0_ext40: 8,
  9355. rssi0_ext80: 8;
  9356. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9357. } u0;
  9358. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9359. union {
  9360. A_UINT32 /* word 2 */
  9361. rssi1_pri20: 8,
  9362. rssi1_ext20: 8,
  9363. rssi1_ext40: 8,
  9364. rssi1_ext80: 8;
  9365. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9366. } u1;
  9367. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9368. union {
  9369. A_UINT32 /* word 3 */
  9370. rssi2_pri20: 8,
  9371. rssi2_ext20: 8,
  9372. rssi2_ext40: 8,
  9373. rssi2_ext80: 8;
  9374. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9375. } u2;
  9376. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9377. union {
  9378. A_UINT32 /* word 4 */
  9379. rssi3_pri20: 8,
  9380. rssi3_ext20: 8,
  9381. rssi3_ext40: 8,
  9382. rssi3_ext80: 8;
  9383. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9384. } u3;
  9385. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9386. A_UINT32 tsf32; /* word 5 */
  9387. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9388. A_UINT32 timestamp_microsec; /* word 6 */
  9389. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9390. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9391. A_UINT32 /* word 7 */
  9392. vht_sig_a1: 24,
  9393. preamble_type: 8;
  9394. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9395. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9396. A_UINT32 /* word 8 */
  9397. vht_sig_a2: 24,
  9398. /* sa_ant_matrix
  9399. * For cases where a single rx chain has options to be connected to
  9400. * different rx antennas, show which rx antennas were in use during
  9401. * receipt of a given PPDU.
  9402. * This sa_ant_matrix provides a bitmask of the antennas used while
  9403. * receiving this frame.
  9404. */
  9405. sa_ant_matrix: 8;
  9406. } POSTPACK;
  9407. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9408. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9409. PREPACK struct htt_rx_ind_hdr_suffix_t
  9410. {
  9411. A_UINT32 /* word 0 */
  9412. fw_rx_desc_bytes: 16,
  9413. reserved0: 16;
  9414. } POSTPACK;
  9415. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9416. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9417. PREPACK struct htt_rx_ind_hdr_t
  9418. {
  9419. struct htt_rx_ind_hdr_prefix_t prefix;
  9420. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9421. struct htt_rx_ind_hdr_suffix_t suffix;
  9422. } POSTPACK;
  9423. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9424. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9425. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9426. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9427. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9428. /*
  9429. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9430. * the offset into the HTT rx indication message at which the
  9431. * FW rx PPDU descriptor resides
  9432. */
  9433. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9434. /*
  9435. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9436. * the offset into the HTT rx indication message at which the
  9437. * header suffix (FW rx MSDU byte count) resides
  9438. */
  9439. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9440. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9441. /*
  9442. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9443. * the offset into the HTT rx indication message at which the per-MSDU
  9444. * information starts
  9445. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9446. * per-MSDU information portion of the message. The per-MSDU info itself
  9447. * starts at byte 12.
  9448. */
  9449. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9450. /**
  9451. * @brief target -> host rx indication message definition
  9452. *
  9453. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9454. *
  9455. * @details
  9456. * The following field definitions describe the format of the rx indication
  9457. * message sent from the target to the host.
  9458. * The message consists of three major sections:
  9459. * 1. a fixed-length header
  9460. * 2. a variable-length list of firmware rx MSDU descriptors
  9461. * 3. one or more 4-octet MPDU range information elements
  9462. * The fixed length header itself has two sub-sections
  9463. * 1. the message meta-information, including identification of the
  9464. * sender and type of the received data, and a 4-octet flush/release IE
  9465. * 2. the firmware rx PPDU descriptor
  9466. *
  9467. * The format of the message is depicted below.
  9468. * in this depiction, the following abbreviations are used for information
  9469. * elements within the message:
  9470. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9471. * elements associated with the PPDU start are valid.
  9472. * Specifically, the following fields are valid only if SV is set:
  9473. * RSSI (all variants), L, legacy rate, preamble type, service,
  9474. * VHT-SIG-A
  9475. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9476. * elements associated with the PPDU end are valid.
  9477. * Specifically, the following fields are valid only if EV is set:
  9478. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9479. * - L - Legacy rate selector - if legacy rates are used, this flag
  9480. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9481. * (L == 0) PHY.
  9482. * - P - PHY error flag - boolean indication of whether the rx frame had
  9483. * a PHY error
  9484. *
  9485. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9486. * |----------------+-------------------+---------------------+---------------|
  9487. * | peer ID | |RV|FV| ext TID | msg type |
  9488. * |--------------------------------------------------------------------------|
  9489. * | num | release | release | flush | flush |
  9490. * | MPDU | end | start | end | start |
  9491. * | ranges | seq num | seq num | seq num | seq num |
  9492. * |==========================================================================|
  9493. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9494. * |V|V| | rate | | | timestamp | RSSI |
  9495. * |--------------------------------------------------------------------------|
  9496. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9497. * |--------------------------------------------------------------------------|
  9498. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9499. * |--------------------------------------------------------------------------|
  9500. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9501. * |--------------------------------------------------------------------------|
  9502. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9503. * |--------------------------------------------------------------------------|
  9504. * | TSF LSBs |
  9505. * |--------------------------------------------------------------------------|
  9506. * | microsec timestamp |
  9507. * |--------------------------------------------------------------------------|
  9508. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9509. * |--------------------------------------------------------------------------|
  9510. * | service | HT-SIG / VHT-SIG-A2 |
  9511. * |==========================================================================|
  9512. * | reserved | FW rx desc bytes |
  9513. * |--------------------------------------------------------------------------|
  9514. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9515. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9516. * |--------------------------------------------------------------------------|
  9517. * : : :
  9518. * |--------------------------------------------------------------------------|
  9519. * | alignment | MSDU Rx |
  9520. * | padding | desc Bn |
  9521. * |--------------------------------------------------------------------------|
  9522. * | reserved | MPDU range status | MPDU count |
  9523. * |--------------------------------------------------------------------------|
  9524. * : reserved : MPDU range status : MPDU count :
  9525. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9526. *
  9527. * Header fields:
  9528. * - MSG_TYPE
  9529. * Bits 7:0
  9530. * Purpose: identifies this as an rx indication message
  9531. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9532. * - EXT_TID
  9533. * Bits 12:8
  9534. * Purpose: identify the traffic ID of the rx data, including
  9535. * special "extended" TID values for multicast, broadcast, and
  9536. * non-QoS data frames
  9537. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9538. * - FLUSH_VALID (FV)
  9539. * Bit 13
  9540. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9541. * is valid
  9542. * Value:
  9543. * 1 -> flush IE is valid and needs to be processed
  9544. * 0 -> flush IE is not valid and should be ignored
  9545. * - REL_VALID (RV)
  9546. * Bit 13
  9547. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9548. * is valid
  9549. * Value:
  9550. * 1 -> release IE is valid and needs to be processed
  9551. * 0 -> release IE is not valid and should be ignored
  9552. * - PEER_ID
  9553. * Bits 31:16
  9554. * Purpose: Identify, by ID, which peer sent the rx data
  9555. * Value: ID of the peer who sent the rx data
  9556. * - FLUSH_SEQ_NUM_START
  9557. * Bits 5:0
  9558. * Purpose: Indicate the start of a series of MPDUs to flush
  9559. * Not all MPDUs within this series are necessarily valid - the host
  9560. * must check each sequence number within this range to see if the
  9561. * corresponding MPDU is actually present.
  9562. * This field is only valid if the FV bit is set.
  9563. * Value:
  9564. * The sequence number for the first MPDUs to check to flush.
  9565. * The sequence number is masked by 0x3f.
  9566. * - FLUSH_SEQ_NUM_END
  9567. * Bits 11:6
  9568. * Purpose: Indicate the end of a series of MPDUs to flush
  9569. * Value:
  9570. * The sequence number one larger than the sequence number of the
  9571. * last MPDU to check to flush.
  9572. * The sequence number is masked by 0x3f.
  9573. * Not all MPDUs within this series are necessarily valid - the host
  9574. * must check each sequence number within this range to see if the
  9575. * corresponding MPDU is actually present.
  9576. * This field is only valid if the FV bit is set.
  9577. * - REL_SEQ_NUM_START
  9578. * Bits 17:12
  9579. * Purpose: Indicate the start of a series of MPDUs to release.
  9580. * All MPDUs within this series are present and valid - the host
  9581. * need not check each sequence number within this range to see if
  9582. * the corresponding MPDU is actually present.
  9583. * This field is only valid if the RV bit is set.
  9584. * Value:
  9585. * The sequence number for the first MPDUs to check to release.
  9586. * The sequence number is masked by 0x3f.
  9587. * - REL_SEQ_NUM_END
  9588. * Bits 23:18
  9589. * Purpose: Indicate the end of a series of MPDUs to release.
  9590. * Value:
  9591. * The sequence number one larger than the sequence number of the
  9592. * last MPDU to check to release.
  9593. * The sequence number is masked by 0x3f.
  9594. * All MPDUs within this series are present and valid - the host
  9595. * need not check each sequence number within this range to see if
  9596. * the corresponding MPDU is actually present.
  9597. * This field is only valid if the RV bit is set.
  9598. * - NUM_MPDU_RANGES
  9599. * Bits 31:24
  9600. * Purpose: Indicate how many ranges of MPDUs are present.
  9601. * Each MPDU range consists of a series of contiguous MPDUs within the
  9602. * rx frame sequence which all have the same MPDU status.
  9603. * Value: 1-63 (typically a small number, like 1-3)
  9604. *
  9605. * Rx PPDU descriptor fields:
  9606. * - RSSI_CMB
  9607. * Bits 7:0
  9608. * Purpose: Combined RSSI from all active rx chains, across the active
  9609. * bandwidth.
  9610. * Value: RSSI dB units w.r.t. noise floor
  9611. * - TIMESTAMP_SUBMICROSEC
  9612. * Bits 15:8
  9613. * Purpose: high-resolution timestamp
  9614. * Value:
  9615. * Sub-microsecond time of PPDU reception.
  9616. * This timestamp ranges from [0,MAC clock MHz).
  9617. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9618. * to form a high-resolution, large range rx timestamp.
  9619. * - PHY_ERR_CODE
  9620. * Bits 23:16
  9621. * Purpose:
  9622. * If the rx frame processing resulted in a PHY error, indicate what
  9623. * type of rx PHY error occurred.
  9624. * Value:
  9625. * This field is valid if the "P" (PHY_ERR) flag is set.
  9626. * TBD: document/specify the values for this field
  9627. * - PHY_ERR
  9628. * Bit 24
  9629. * Purpose: indicate whether the rx PPDU had a PHY error
  9630. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9631. * - LEGACY_RATE
  9632. * Bits 28:25
  9633. * Purpose:
  9634. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9635. * specify which rate was used.
  9636. * Value:
  9637. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9638. * flag.
  9639. * If LEGACY_RATE_SEL is 0:
  9640. * 0x8: OFDM 48 Mbps
  9641. * 0x9: OFDM 24 Mbps
  9642. * 0xA: OFDM 12 Mbps
  9643. * 0xB: OFDM 6 Mbps
  9644. * 0xC: OFDM 54 Mbps
  9645. * 0xD: OFDM 36 Mbps
  9646. * 0xE: OFDM 18 Mbps
  9647. * 0xF: OFDM 9 Mbps
  9648. * If LEGACY_RATE_SEL is 1:
  9649. * 0x8: CCK 11 Mbps long preamble
  9650. * 0x9: CCK 5.5 Mbps long preamble
  9651. * 0xA: CCK 2 Mbps long preamble
  9652. * 0xB: CCK 1 Mbps long preamble
  9653. * 0xC: CCK 11 Mbps short preamble
  9654. * 0xD: CCK 5.5 Mbps short preamble
  9655. * 0xE: CCK 2 Mbps short preamble
  9656. * - LEGACY_RATE_SEL
  9657. * Bit 29
  9658. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9659. * Value:
  9660. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9661. * used a legacy rate.
  9662. * 0 -> OFDM, 1 -> CCK
  9663. * - END_VALID
  9664. * Bit 30
  9665. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9666. * the start of the PPDU are valid. Specifically, the following
  9667. * fields are only valid if END_VALID is set:
  9668. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9669. * TIMESTAMP_SUBMICROSEC
  9670. * Value:
  9671. * 0 -> rx PPDU desc end fields are not valid
  9672. * 1 -> rx PPDU desc end fields are valid
  9673. * - START_VALID
  9674. * Bit 31
  9675. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9676. * the end of the PPDU are valid. Specifically, the following
  9677. * fields are only valid if START_VALID is set:
  9678. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9679. * VHT-SIG-A
  9680. * Value:
  9681. * 0 -> rx PPDU desc start fields are not valid
  9682. * 1 -> rx PPDU desc start fields are valid
  9683. * - RSSI0_PRI20
  9684. * Bits 7:0
  9685. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9686. * Value: RSSI dB units w.r.t. noise floor
  9687. *
  9688. * - RSSI0_EXT20
  9689. * Bits 7:0
  9690. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9691. * (if the rx bandwidth was >= 40 MHz)
  9692. * Value: RSSI dB units w.r.t. noise floor
  9693. * - RSSI0_EXT40
  9694. * Bits 7:0
  9695. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9696. * (if the rx bandwidth was >= 80 MHz)
  9697. * Value: RSSI dB units w.r.t. noise floor
  9698. * - RSSI0_EXT80
  9699. * Bits 7:0
  9700. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9701. * (if the rx bandwidth was >= 160 MHz)
  9702. * Value: RSSI dB units w.r.t. noise floor
  9703. *
  9704. * - RSSI1_PRI20
  9705. * Bits 7:0
  9706. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9707. * Value: RSSI dB units w.r.t. noise floor
  9708. * - RSSI1_EXT20
  9709. * Bits 7:0
  9710. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9711. * (if the rx bandwidth was >= 40 MHz)
  9712. * Value: RSSI dB units w.r.t. noise floor
  9713. * - RSSI1_EXT40
  9714. * Bits 7:0
  9715. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9716. * (if the rx bandwidth was >= 80 MHz)
  9717. * Value: RSSI dB units w.r.t. noise floor
  9718. * - RSSI1_EXT80
  9719. * Bits 7:0
  9720. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9721. * (if the rx bandwidth was >= 160 MHz)
  9722. * Value: RSSI dB units w.r.t. noise floor
  9723. *
  9724. * - RSSI2_PRI20
  9725. * Bits 7:0
  9726. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9727. * Value: RSSI dB units w.r.t. noise floor
  9728. * - RSSI2_EXT20
  9729. * Bits 7:0
  9730. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9731. * (if the rx bandwidth was >= 40 MHz)
  9732. * Value: RSSI dB units w.r.t. noise floor
  9733. * - RSSI2_EXT40
  9734. * Bits 7:0
  9735. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9736. * (if the rx bandwidth was >= 80 MHz)
  9737. * Value: RSSI dB units w.r.t. noise floor
  9738. * - RSSI2_EXT80
  9739. * Bits 7:0
  9740. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9741. * (if the rx bandwidth was >= 160 MHz)
  9742. * Value: RSSI dB units w.r.t. noise floor
  9743. *
  9744. * - RSSI3_PRI20
  9745. * Bits 7:0
  9746. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9747. * Value: RSSI dB units w.r.t. noise floor
  9748. * - RSSI3_EXT20
  9749. * Bits 7:0
  9750. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9751. * (if the rx bandwidth was >= 40 MHz)
  9752. * Value: RSSI dB units w.r.t. noise floor
  9753. * - RSSI3_EXT40
  9754. * Bits 7:0
  9755. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9756. * (if the rx bandwidth was >= 80 MHz)
  9757. * Value: RSSI dB units w.r.t. noise floor
  9758. * - RSSI3_EXT80
  9759. * Bits 7:0
  9760. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9761. * (if the rx bandwidth was >= 160 MHz)
  9762. * Value: RSSI dB units w.r.t. noise floor
  9763. *
  9764. * - TSF32
  9765. * Bits 31:0
  9766. * Purpose: specify the time the rx PPDU was received, in TSF units
  9767. * Value: 32 LSBs of the TSF
  9768. * - TIMESTAMP_MICROSEC
  9769. * Bits 31:0
  9770. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9771. * Value: PPDU rx time, in microseconds
  9772. * - VHT_SIG_A1
  9773. * Bits 23:0
  9774. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9775. * from the rx PPDU
  9776. * Value:
  9777. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9778. * VHT-SIG-A1 data.
  9779. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9780. * first 24 bits of the HT-SIG data.
  9781. * Otherwise, this field is invalid.
  9782. * Refer to the the 802.11 protocol for the definition of the
  9783. * HT-SIG and VHT-SIG-A1 fields
  9784. * - VHT_SIG_A2
  9785. * Bits 23:0
  9786. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9787. * from the rx PPDU
  9788. * Value:
  9789. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9790. * VHT-SIG-A2 data.
  9791. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9792. * last 24 bits of the HT-SIG data.
  9793. * Otherwise, this field is invalid.
  9794. * Refer to the the 802.11 protocol for the definition of the
  9795. * HT-SIG and VHT-SIG-A2 fields
  9796. * - PREAMBLE_TYPE
  9797. * Bits 31:24
  9798. * Purpose: indicate the PHY format of the received burst
  9799. * Value:
  9800. * 0x4: Legacy (OFDM/CCK)
  9801. * 0x8: HT
  9802. * 0x9: HT with TxBF
  9803. * 0xC: VHT
  9804. * 0xD: VHT with TxBF
  9805. * - SERVICE
  9806. * Bits 31:24
  9807. * Purpose: TBD
  9808. * Value: TBD
  9809. *
  9810. * Rx MSDU descriptor fields:
  9811. * - FW_RX_DESC_BYTES
  9812. * Bits 15:0
  9813. * Purpose: Indicate how many bytes in the Rx indication are used for
  9814. * FW Rx descriptors
  9815. *
  9816. * Payload fields:
  9817. * - MPDU_COUNT
  9818. * Bits 7:0
  9819. * Purpose: Indicate how many sequential MPDUs share the same status.
  9820. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9821. * - MPDU_STATUS
  9822. * Bits 15:8
  9823. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9824. * received successfully.
  9825. * Value:
  9826. * 0x1: success
  9827. * 0x2: FCS error
  9828. * 0x3: duplicate error
  9829. * 0x4: replay error
  9830. * 0x5: invalid peer
  9831. */
  9832. /* header fields */
  9833. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9834. #define HTT_RX_IND_EXT_TID_S 8
  9835. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9836. #define HTT_RX_IND_FLUSH_VALID_S 13
  9837. #define HTT_RX_IND_REL_VALID_M 0x4000
  9838. #define HTT_RX_IND_REL_VALID_S 14
  9839. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9840. #define HTT_RX_IND_PEER_ID_S 16
  9841. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9842. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9843. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9844. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9845. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9846. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9847. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9848. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9849. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9850. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9851. /* rx PPDU descriptor fields */
  9852. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9853. #define HTT_RX_IND_RSSI_CMB_S 0
  9854. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9855. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9856. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9857. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9858. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9859. #define HTT_RX_IND_PHY_ERR_S 24
  9860. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9861. #define HTT_RX_IND_LEGACY_RATE_S 25
  9862. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9863. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9864. #define HTT_RX_IND_END_VALID_M 0x40000000
  9865. #define HTT_RX_IND_END_VALID_S 30
  9866. #define HTT_RX_IND_START_VALID_M 0x80000000
  9867. #define HTT_RX_IND_START_VALID_S 31
  9868. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9869. #define HTT_RX_IND_RSSI_PRI20_S 0
  9870. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9871. #define HTT_RX_IND_RSSI_EXT20_S 8
  9872. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9873. #define HTT_RX_IND_RSSI_EXT40_S 16
  9874. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9875. #define HTT_RX_IND_RSSI_EXT80_S 24
  9876. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9877. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9878. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9879. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9880. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9881. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9882. #define HTT_RX_IND_SERVICE_M 0xff000000
  9883. #define HTT_RX_IND_SERVICE_S 24
  9884. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9885. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9886. /* rx MSDU descriptor fields */
  9887. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9888. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9889. /* payload fields */
  9890. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9891. #define HTT_RX_IND_MPDU_COUNT_S 0
  9892. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9893. #define HTT_RX_IND_MPDU_STATUS_S 8
  9894. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9895. do { \
  9896. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9897. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9898. } while (0)
  9899. #define HTT_RX_IND_EXT_TID_GET(word) \
  9900. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9901. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9902. do { \
  9903. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9904. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9905. } while (0)
  9906. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9907. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9908. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9909. do { \
  9910. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9911. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9912. } while (0)
  9913. #define HTT_RX_IND_REL_VALID_GET(word) \
  9914. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9915. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9916. do { \
  9917. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9918. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9919. } while (0)
  9920. #define HTT_RX_IND_PEER_ID_GET(word) \
  9921. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9922. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9923. do { \
  9924. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9925. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9926. } while (0)
  9927. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9928. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9929. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9930. do { \
  9931. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9932. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9933. } while (0)
  9934. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9935. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9936. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9937. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9938. do { \
  9939. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9940. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9941. } while (0)
  9942. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9943. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9944. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9945. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9946. do { \
  9947. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9948. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9949. } while (0)
  9950. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9951. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9952. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9953. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9954. do { \
  9955. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9956. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9957. } while (0)
  9958. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9959. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9960. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9961. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9962. do { \
  9963. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9964. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9965. } while (0)
  9966. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9967. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9968. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9969. /* FW rx PPDU descriptor fields */
  9970. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9971. do { \
  9972. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9973. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9974. } while (0)
  9975. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9976. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9977. HTT_RX_IND_RSSI_CMB_S)
  9978. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9979. do { \
  9980. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9981. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9982. } while (0)
  9983. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9984. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9985. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9986. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9987. do { \
  9988. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9989. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9990. } while (0)
  9991. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9992. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9993. HTT_RX_IND_PHY_ERR_CODE_S)
  9994. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9995. do { \
  9996. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9997. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9998. } while (0)
  9999. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10000. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10001. HTT_RX_IND_PHY_ERR_S)
  10002. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10003. do { \
  10004. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10005. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10006. } while (0)
  10007. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10008. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10009. HTT_RX_IND_LEGACY_RATE_S)
  10010. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10011. do { \
  10012. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10013. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10014. } while (0)
  10015. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10016. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10017. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10018. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10019. do { \
  10020. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10021. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10022. } while (0)
  10023. #define HTT_RX_IND_END_VALID_GET(word) \
  10024. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10025. HTT_RX_IND_END_VALID_S)
  10026. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10027. do { \
  10028. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10029. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10030. } while (0)
  10031. #define HTT_RX_IND_START_VALID_GET(word) \
  10032. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10033. HTT_RX_IND_START_VALID_S)
  10034. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10035. do { \
  10036. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10037. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10038. } while (0)
  10039. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10040. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10041. HTT_RX_IND_RSSI_PRI20_S)
  10042. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10043. do { \
  10044. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10045. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10046. } while (0)
  10047. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10048. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10049. HTT_RX_IND_RSSI_EXT20_S)
  10050. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10051. do { \
  10052. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10053. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10054. } while (0)
  10055. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10056. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10057. HTT_RX_IND_RSSI_EXT40_S)
  10058. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10059. do { \
  10060. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10061. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10062. } while (0)
  10063. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10064. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10065. HTT_RX_IND_RSSI_EXT80_S)
  10066. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10067. do { \
  10068. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10069. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10070. } while (0)
  10071. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10072. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10073. HTT_RX_IND_VHT_SIG_A1_S)
  10074. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10075. do { \
  10076. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10077. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10078. } while (0)
  10079. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10080. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10081. HTT_RX_IND_VHT_SIG_A2_S)
  10082. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10083. do { \
  10084. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10085. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10086. } while (0)
  10087. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10088. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10089. HTT_RX_IND_PREAMBLE_TYPE_S)
  10090. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10091. do { \
  10092. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10093. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10094. } while (0)
  10095. #define HTT_RX_IND_SERVICE_GET(word) \
  10096. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10097. HTT_RX_IND_SERVICE_S)
  10098. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10099. do { \
  10100. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10101. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10102. } while (0)
  10103. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10104. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10105. HTT_RX_IND_SA_ANT_MATRIX_S)
  10106. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10107. do { \
  10108. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10109. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10110. } while (0)
  10111. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10112. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10113. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10114. do { \
  10115. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10116. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10117. } while (0)
  10118. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10119. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10120. #define HTT_RX_IND_HL_BYTES \
  10121. (HTT_RX_IND_HDR_BYTES + \
  10122. 4 /* single FW rx MSDU descriptor */ + \
  10123. 4 /* single MPDU range information element */)
  10124. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10125. /* Could we use one macro entry? */
  10126. #define HTT_WORD_SET(word, field, value) \
  10127. do { \
  10128. HTT_CHECK_SET_VAL(field, value); \
  10129. (word) |= ((value) << field ## _S); \
  10130. } while (0)
  10131. #define HTT_WORD_GET(word, field) \
  10132. (((word) & field ## _M) >> field ## _S)
  10133. PREPACK struct hl_htt_rx_ind_base {
  10134. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10135. } POSTPACK;
  10136. /*
  10137. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10138. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10139. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10140. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10141. * htt_rx_ind_hl_rx_desc_t.
  10142. */
  10143. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10144. struct htt_rx_ind_hl_rx_desc_t {
  10145. A_UINT8 ver;
  10146. A_UINT8 len;
  10147. struct {
  10148. A_UINT8
  10149. first_msdu: 1,
  10150. last_msdu: 1,
  10151. c3_failed: 1,
  10152. c4_failed: 1,
  10153. ipv6: 1,
  10154. tcp: 1,
  10155. udp: 1,
  10156. reserved: 1;
  10157. } flags;
  10158. /* NOTE: no reserved space - don't append any new fields here */
  10159. };
  10160. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10161. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10162. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10163. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10164. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10165. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10166. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10167. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10168. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10169. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10170. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10171. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10172. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10173. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10174. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10175. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10176. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10177. /* This structure is used in HL, the basic descriptor information
  10178. * used by host. the structure is translated by FW from HW desc
  10179. * or generated by FW. But in HL monitor mode, the host would use
  10180. * the same structure with LL.
  10181. */
  10182. PREPACK struct hl_htt_rx_desc_base {
  10183. A_UINT32
  10184. seq_num:12,
  10185. encrypted:1,
  10186. chan_info_present:1,
  10187. resv0:2,
  10188. mcast_bcast:1,
  10189. fragment:1,
  10190. key_id_oct:8,
  10191. resv1:6;
  10192. A_UINT32
  10193. pn_31_0;
  10194. union {
  10195. struct {
  10196. A_UINT16 pn_47_32;
  10197. A_UINT16 pn_63_48;
  10198. } pn16;
  10199. A_UINT32 pn_63_32;
  10200. } u0;
  10201. A_UINT32
  10202. pn_95_64;
  10203. A_UINT32
  10204. pn_127_96;
  10205. } POSTPACK;
  10206. /*
  10207. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10208. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10209. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10210. * Please see htt_chan_change_t for description of the fields.
  10211. */
  10212. PREPACK struct htt_chan_info_t
  10213. {
  10214. A_UINT32 primary_chan_center_freq_mhz: 16,
  10215. contig_chan1_center_freq_mhz: 16;
  10216. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10217. phy_mode: 8,
  10218. reserved: 8;
  10219. } POSTPACK;
  10220. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10221. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10222. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10223. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10224. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10225. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10226. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10227. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10228. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10229. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10230. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10231. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10232. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10233. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10234. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10235. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10236. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10237. /* Channel information */
  10238. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10239. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10240. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10241. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10242. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10243. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10244. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10245. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10246. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10247. do { \
  10248. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10249. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10250. } while (0)
  10251. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10252. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10253. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10254. do { \
  10255. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10256. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10257. } while (0)
  10258. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10259. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10260. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10261. do { \
  10262. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10263. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10264. } while (0)
  10265. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10266. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10267. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10268. do { \
  10269. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10270. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10271. } while (0)
  10272. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10273. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10274. /*
  10275. * @brief target -> host message definition for FW offloaded pkts
  10276. *
  10277. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10278. *
  10279. * @details
  10280. * The following field definitions describe the format of the firmware
  10281. * offload deliver message sent from the target to the host.
  10282. *
  10283. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10284. *
  10285. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10286. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10287. * | reserved_1 | msg type |
  10288. * |--------------------------------------------------------------------------|
  10289. * | phy_timestamp_l32 |
  10290. * |--------------------------------------------------------------------------|
  10291. * | WORD2 (see below) |
  10292. * |--------------------------------------------------------------------------|
  10293. * | seqno | framectrl |
  10294. * |--------------------------------------------------------------------------|
  10295. * | reserved_3 | vdev_id | tid_num|
  10296. * |--------------------------------------------------------------------------|
  10297. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10298. * |--------------------------------------------------------------------------|
  10299. *
  10300. * where:
  10301. * STAT = status
  10302. * F = format (802.3 vs. 802.11)
  10303. *
  10304. * definition for word 2
  10305. *
  10306. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10307. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10308. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10309. * |--------------------------------------------------------------------------|
  10310. *
  10311. * where:
  10312. * PR = preamble
  10313. * BF = beamformed
  10314. */
  10315. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10316. {
  10317. A_UINT32 /* word 0 */
  10318. msg_type:8, /* [ 7: 0] */
  10319. reserved_1:24; /* [31: 8] */
  10320. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10321. A_UINT32 /* word 2 */
  10322. /* preamble:
  10323. * 0-OFDM,
  10324. * 1-CCk,
  10325. * 2-HT,
  10326. * 3-VHT
  10327. */
  10328. preamble: 2, /* [1:0] */
  10329. /* mcs:
  10330. * In case of HT preamble interpret
  10331. * MCS along with NSS.
  10332. * Valid values for HT are 0 to 7.
  10333. * HT mcs 0 with NSS 2 is mcs 8.
  10334. * Valid values for VHT are 0 to 9.
  10335. */
  10336. mcs: 4, /* [5:2] */
  10337. /* rate:
  10338. * This is applicable only for
  10339. * CCK and OFDM preamble type
  10340. * rate 0: OFDM 48 Mbps,
  10341. * 1: OFDM 24 Mbps,
  10342. * 2: OFDM 12 Mbps
  10343. * 3: OFDM 6 Mbps
  10344. * 4: OFDM 54 Mbps
  10345. * 5: OFDM 36 Mbps
  10346. * 6: OFDM 18 Mbps
  10347. * 7: OFDM 9 Mbps
  10348. * rate 0: CCK 11 Mbps Long
  10349. * 1: CCK 5.5 Mbps Long
  10350. * 2: CCK 2 Mbps Long
  10351. * 3: CCK 1 Mbps Long
  10352. * 4: CCK 11 Mbps Short
  10353. * 5: CCK 5.5 Mbps Short
  10354. * 6: CCK 2 Mbps Short
  10355. */
  10356. rate : 3, /* [ 8: 6] */
  10357. rssi : 8, /* [16: 9] units=dBm */
  10358. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10359. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10360. stbc : 1, /* [22] */
  10361. sgi : 1, /* [23] */
  10362. ldpc : 1, /* [24] */
  10363. beamformed: 1, /* [25] */
  10364. reserved_2: 6; /* [31:26] */
  10365. A_UINT32 /* word 3 */
  10366. framectrl:16, /* [15: 0] */
  10367. seqno:16; /* [31:16] */
  10368. A_UINT32 /* word 4 */
  10369. tid_num:5, /* [ 4: 0] actual TID number */
  10370. vdev_id:8, /* [12: 5] */
  10371. reserved_3:19; /* [31:13] */
  10372. A_UINT32 /* word 5 */
  10373. /* status:
  10374. * 0: tx_ok
  10375. * 1: retry
  10376. * 2: drop
  10377. * 3: filtered
  10378. * 4: abort
  10379. * 5: tid delete
  10380. * 6: sw abort
  10381. * 7: dropped by peer migration
  10382. */
  10383. status:3, /* [2:0] */
  10384. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10385. tx_mpdu_bytes:16, /* [19:4] */
  10386. /* Indicates retry count of offloaded/local generated Data tx frames */
  10387. tx_retry_cnt:6, /* [25:20] */
  10388. reserved_4:6; /* [31:26] */
  10389. } POSTPACK;
  10390. /* FW offload deliver ind message header fields */
  10391. /* DWORD one */
  10392. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10393. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10394. /* DWORD two */
  10395. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10396. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10397. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10398. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10399. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10400. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10401. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10402. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10403. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10404. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10405. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10406. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10407. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10408. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10409. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10410. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10411. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10412. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10413. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10414. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10415. /* DWORD three*/
  10416. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10417. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10418. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10419. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10420. /* DWORD four */
  10421. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10422. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10423. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10424. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10425. /* DWORD five */
  10426. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10427. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10428. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10429. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10430. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10431. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10432. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10433. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10434. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10435. do { \
  10436. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10437. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10438. } while (0)
  10439. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10440. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10441. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10442. do { \
  10443. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10444. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10445. } while (0)
  10446. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10447. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10448. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10449. do { \
  10450. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10451. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10452. } while (0)
  10453. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10454. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10455. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10456. do { \
  10457. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10458. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10459. } while (0)
  10460. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10461. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10462. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10463. do { \
  10464. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10465. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10466. } while (0)
  10467. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10468. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10469. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10470. do { \
  10471. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10472. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10473. } while (0)
  10474. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10475. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10476. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10477. do { \
  10478. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10479. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10480. } while (0)
  10481. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10482. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10483. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10484. do { \
  10485. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10486. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10487. } while (0)
  10488. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10489. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10490. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10491. do { \
  10492. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10493. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10494. } while (0)
  10495. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10496. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10497. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10498. do { \
  10499. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10500. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10501. } while (0)
  10502. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10503. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10504. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10505. do { \
  10506. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10507. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10508. } while (0)
  10509. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10510. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10511. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10512. do { \
  10513. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10514. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10515. } while (0)
  10516. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10517. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10518. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10519. do { \
  10520. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10521. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10522. } while (0)
  10523. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10524. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10525. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10526. do { \
  10527. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10528. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10529. } while (0)
  10530. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10531. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10532. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10533. do { \
  10534. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10535. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10536. } while (0)
  10537. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10538. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10539. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10540. do { \
  10541. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10542. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10543. } while (0)
  10544. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10545. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10546. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10547. do { \
  10548. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10549. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10550. } while (0)
  10551. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10552. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10553. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10554. do { \
  10555. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10556. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10557. } while (0)
  10558. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10559. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10560. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10561. do { \
  10562. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10563. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10564. } while (0)
  10565. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10566. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10567. /*
  10568. * @brief target -> host rx reorder flush message definition
  10569. *
  10570. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10571. *
  10572. * @details
  10573. * The following field definitions describe the format of the rx flush
  10574. * message sent from the target to the host.
  10575. * The message consists of a 4-octet header, followed by one or more
  10576. * 4-octet payload information elements.
  10577. *
  10578. * |31 24|23 8|7 0|
  10579. * |--------------------------------------------------------------|
  10580. * | TID | peer ID | msg type |
  10581. * |--------------------------------------------------------------|
  10582. * | seq num end | seq num start | MPDU status | reserved |
  10583. * |--------------------------------------------------------------|
  10584. * First DWORD:
  10585. * - MSG_TYPE
  10586. * Bits 7:0
  10587. * Purpose: identifies this as an rx flush message
  10588. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10589. * - PEER_ID
  10590. * Bits 23:8 (only bits 18:8 actually used)
  10591. * Purpose: identify which peer's rx data is being flushed
  10592. * Value: (rx) peer ID
  10593. * - TID
  10594. * Bits 31:24 (only bits 27:24 actually used)
  10595. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10596. * Value: traffic identifier
  10597. * Second DWORD:
  10598. * - MPDU_STATUS
  10599. * Bits 15:8
  10600. * Purpose:
  10601. * Indicate whether the flushed MPDUs should be discarded or processed.
  10602. * Value:
  10603. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10604. * stages of rx processing
  10605. * other: discard the MPDUs
  10606. * It is anticipated that flush messages will always have
  10607. * MPDU status == 1, but the status flag is included for
  10608. * flexibility.
  10609. * - SEQ_NUM_START
  10610. * Bits 23:16
  10611. * Purpose:
  10612. * Indicate the start of a series of consecutive MPDUs being flushed.
  10613. * Not all MPDUs within this range are necessarily valid - the host
  10614. * must check each sequence number within this range to see if the
  10615. * corresponding MPDU is actually present.
  10616. * Value:
  10617. * The sequence number for the first MPDU in the sequence.
  10618. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10619. * - SEQ_NUM_END
  10620. * Bits 30:24
  10621. * Purpose:
  10622. * Indicate the end of a series of consecutive MPDUs being flushed.
  10623. * Value:
  10624. * The sequence number one larger than the sequence number of the
  10625. * last MPDU being flushed.
  10626. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10627. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10628. * are to be released for further rx processing.
  10629. * Not all MPDUs within this range are necessarily valid - the host
  10630. * must check each sequence number within this range to see if the
  10631. * corresponding MPDU is actually present.
  10632. */
  10633. /* first DWORD */
  10634. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10635. #define HTT_RX_FLUSH_PEER_ID_S 8
  10636. #define HTT_RX_FLUSH_TID_M 0xff000000
  10637. #define HTT_RX_FLUSH_TID_S 24
  10638. /* second DWORD */
  10639. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10640. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10641. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10642. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10643. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10644. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10645. #define HTT_RX_FLUSH_BYTES 8
  10646. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10647. do { \
  10648. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10649. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10650. } while (0)
  10651. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10652. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10653. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10654. do { \
  10655. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10656. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10657. } while (0)
  10658. #define HTT_RX_FLUSH_TID_GET(word) \
  10659. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10660. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10661. do { \
  10662. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10663. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10664. } while (0)
  10665. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10666. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10667. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10668. do { \
  10669. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10670. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10671. } while (0)
  10672. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10673. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10674. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10675. do { \
  10676. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10677. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10678. } while (0)
  10679. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10680. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10681. /*
  10682. * @brief target -> host rx pn check indication message
  10683. *
  10684. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10685. *
  10686. * @details
  10687. * The following field definitions describe the format of the Rx PN check
  10688. * indication message sent from the target to the host.
  10689. * The message consists of a 4-octet header, followed by the start and
  10690. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10691. * IE is one octet containing the sequence number that failed the PN
  10692. * check.
  10693. *
  10694. * |31 24|23 8|7 0|
  10695. * |--------------------------------------------------------------|
  10696. * | TID | peer ID | msg type |
  10697. * |--------------------------------------------------------------|
  10698. * | Reserved | PN IE count | seq num end | seq num start|
  10699. * |--------------------------------------------------------------|
  10700. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10701. * |--------------------------------------------------------------|
  10702. * First DWORD:
  10703. * - MSG_TYPE
  10704. * Bits 7:0
  10705. * Purpose: Identifies this as an rx pn check indication message
  10706. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10707. * - PEER_ID
  10708. * Bits 23:8 (only bits 18:8 actually used)
  10709. * Purpose: identify which peer
  10710. * Value: (rx) peer ID
  10711. * - TID
  10712. * Bits 31:24 (only bits 27:24 actually used)
  10713. * Purpose: identify traffic identifier
  10714. * Value: traffic identifier
  10715. * Second DWORD:
  10716. * - SEQ_NUM_START
  10717. * Bits 7:0
  10718. * Purpose:
  10719. * Indicates the starting sequence number of the MPDU in this
  10720. * series of MPDUs that went though PN check.
  10721. * Value:
  10722. * The sequence number for the first MPDU in the sequence.
  10723. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10724. * - SEQ_NUM_END
  10725. * Bits 15:8
  10726. * Purpose:
  10727. * Indicates the ending sequence number of the MPDU in this
  10728. * series of MPDUs that went though PN check.
  10729. * Value:
  10730. * The sequence number one larger then the sequence number of the last
  10731. * MPDU being flushed.
  10732. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10733. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10734. * for invalid PN numbers and are ready to be released for further processing.
  10735. * Not all MPDUs within this range are necessarily valid - the host
  10736. * must check each sequence number within this range to see if the
  10737. * corresponding MPDU is actually present.
  10738. * - PN_IE_COUNT
  10739. * Bits 23:16
  10740. * Purpose:
  10741. * Used to determine the variable number of PN information elements in this
  10742. * message
  10743. *
  10744. * PN information elements:
  10745. * - PN_IE_x-
  10746. * Purpose:
  10747. * Each PN information element contains the sequence number of the MPDU that
  10748. * has failed the target PN check.
  10749. * Value:
  10750. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10751. * that failed the PN check.
  10752. */
  10753. /* first DWORD */
  10754. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10755. #define HTT_RX_PN_IND_PEER_ID_S 8
  10756. #define HTT_RX_PN_IND_TID_M 0xff000000
  10757. #define HTT_RX_PN_IND_TID_S 24
  10758. /* second DWORD */
  10759. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10760. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10761. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10762. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10763. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10764. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10765. #define HTT_RX_PN_IND_BYTES 8
  10766. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10767. do { \
  10768. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10769. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10770. } while (0)
  10771. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10772. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10773. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10774. do { \
  10775. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10776. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10777. } while (0)
  10778. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10779. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10780. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10781. do { \
  10782. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10783. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10784. } while (0)
  10785. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10786. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10787. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10788. do { \
  10789. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10790. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10791. } while (0)
  10792. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10793. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10794. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10795. do { \
  10796. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10797. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10798. } while (0)
  10799. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10800. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10801. /*
  10802. * @brief target -> host rx offload deliver message for LL system
  10803. *
  10804. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10805. *
  10806. * @details
  10807. * In a low latency system this message is sent whenever the offload
  10808. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10809. * The DMA of the actual packets into host memory is done before sending out
  10810. * this message. This message indicates only how many MSDUs to reap. The
  10811. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10812. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10813. * DMA'd by the MAC directly into host memory these packets do not contain
  10814. * the MAC descriptors in the header portion of the packet. Instead they contain
  10815. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10816. * message, the packets are delivered directly to the NW stack without going
  10817. * through the regular reorder buffering and PN checking path since it has
  10818. * already been done in target.
  10819. *
  10820. * |31 24|23 16|15 8|7 0|
  10821. * |-----------------------------------------------------------------------|
  10822. * | Total MSDU count | reserved | msg type |
  10823. * |-----------------------------------------------------------------------|
  10824. *
  10825. * @brief target -> host rx offload deliver message for HL system
  10826. *
  10827. * @details
  10828. * In a high latency system this message is sent whenever the offload manager
  10829. * flushes out the packets it has coalesced in its coalescing buffer. The
  10830. * actual packets are also carried along with this message. When the host
  10831. * receives this message, it is expected to deliver these packets to the NW
  10832. * stack directly instead of routing them through the reorder buffering and
  10833. * PN checking path since it has already been done in target.
  10834. *
  10835. * |31 24|23 16|15 8|7 0|
  10836. * |-----------------------------------------------------------------------|
  10837. * | Total MSDU count | reserved | msg type |
  10838. * |-----------------------------------------------------------------------|
  10839. * | peer ID | MSDU length |
  10840. * |-----------------------------------------------------------------------|
  10841. * | MSDU payload | FW Desc | tid | vdev ID |
  10842. * |-----------------------------------------------------------------------|
  10843. * | MSDU payload contd. |
  10844. * |-----------------------------------------------------------------------|
  10845. * | peer ID | MSDU length |
  10846. * |-----------------------------------------------------------------------|
  10847. * | MSDU payload | FW Desc | tid | vdev ID |
  10848. * |-----------------------------------------------------------------------|
  10849. * | MSDU payload contd. |
  10850. * |-----------------------------------------------------------------------|
  10851. *
  10852. */
  10853. /* first DWORD */
  10854. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10855. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10856. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10857. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10858. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10859. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10860. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10861. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10862. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10863. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10864. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10865. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10866. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10867. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10868. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10869. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10870. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10871. do { \
  10872. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10873. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10874. } while (0)
  10875. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10876. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10877. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10878. do { \
  10879. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10880. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10881. } while (0)
  10882. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10883. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10884. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10885. do { \
  10886. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10887. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10888. } while (0)
  10889. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10890. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10891. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10892. do { \
  10893. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10894. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10895. } while (0)
  10896. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10897. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10898. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10899. do { \
  10900. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10901. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10902. } while (0)
  10903. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10904. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10905. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10906. do { \
  10907. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10908. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10909. } while (0)
  10910. /**
  10911. * @brief target -> host rx peer map/unmap message definition
  10912. *
  10913. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10914. *
  10915. * @details
  10916. * The following diagram shows the format of the rx peer map message sent
  10917. * from the target to the host. This layout assumes the target operates
  10918. * as little-endian.
  10919. *
  10920. * This message always contains a SW peer ID. The main purpose of the
  10921. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10922. * with, so that the host can use that peer ID to determine which peer
  10923. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10924. * other purposes, such as identifying during tx completions which peer
  10925. * the tx frames in question were transmitted to.
  10926. *
  10927. * In certain generations of chips, the peer map message also contains
  10928. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10929. * to identify which peer the frame needs to be forwarded to (i.e. the
  10930. * peer associated with the Destination MAC Address within the packet),
  10931. * and particularly which vdev needs to transmit the frame (for cases
  10932. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10933. * meaning as AST_INDEX_0.
  10934. * This DA-based peer ID that is provided for certain rx frames
  10935. * (the rx frames that need to be re-transmitted as tx frames)
  10936. * is the ID that the HW uses for referring to the peer in question,
  10937. * rather than the peer ID that the SW+FW use to refer to the peer.
  10938. *
  10939. *
  10940. * |31 24|23 16|15 8|7 0|
  10941. * |-----------------------------------------------------------------------|
  10942. * | SW peer ID | VDEV ID | msg type |
  10943. * |-----------------------------------------------------------------------|
  10944. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10945. * |-----------------------------------------------------------------------|
  10946. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10947. * |-----------------------------------------------------------------------|
  10948. *
  10949. *
  10950. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10951. *
  10952. * The following diagram shows the format of the rx peer unmap message sent
  10953. * from the target to the host.
  10954. *
  10955. * |31 24|23 16|15 8|7 0|
  10956. * |-----------------------------------------------------------------------|
  10957. * | SW peer ID | VDEV ID | msg type |
  10958. * |-----------------------------------------------------------------------|
  10959. *
  10960. * The following field definitions describe the format of the rx peer map
  10961. * and peer unmap messages sent from the target to the host.
  10962. * - MSG_TYPE
  10963. * Bits 7:0
  10964. * Purpose: identifies this as an rx peer map or peer unmap message
  10965. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10966. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10967. * - VDEV_ID
  10968. * Bits 15:8
  10969. * Purpose: Indicates which virtual device the peer is associated
  10970. * with.
  10971. * Value: vdev ID (used in the host to look up the vdev object)
  10972. * - PEER_ID (a.k.a. SW_PEER_ID)
  10973. * Bits 31:16
  10974. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10975. * freeing (unmap)
  10976. * Value: (rx) peer ID
  10977. * - MAC_ADDR_L32 (peer map only)
  10978. * Bits 31:0
  10979. * Purpose: Identifies which peer node the peer ID is for.
  10980. * Value: lower 4 bytes of peer node's MAC address
  10981. * - MAC_ADDR_U16 (peer map only)
  10982. * Bits 15:0
  10983. * Purpose: Identifies which peer node the peer ID is for.
  10984. * Value: upper 2 bytes of peer node's MAC address
  10985. * - HW_PEER_ID
  10986. * Bits 31:16
  10987. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10988. * address, so for rx frames marked for rx --> tx forwarding, the
  10989. * host can determine from the HW peer ID provided as meta-data with
  10990. * the rx frame which peer the frame is supposed to be forwarded to.
  10991. * Value: ID used by the MAC HW to identify the peer
  10992. */
  10993. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10994. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10995. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10996. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10997. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10998. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10999. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11000. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11001. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11002. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11003. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11004. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11005. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11006. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11007. do { \
  11008. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11009. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11010. } while (0)
  11011. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11012. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11013. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11014. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11015. do { \
  11016. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11017. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11018. } while (0)
  11019. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11020. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11021. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11022. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11023. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11024. do { \
  11025. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11026. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11027. } while (0)
  11028. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11029. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11030. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11031. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11032. #define HTT_RX_PEER_MAP_BYTES 12
  11033. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11034. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11035. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11036. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11037. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11038. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11039. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11040. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11041. #define HTT_RX_PEER_UNMAP_BYTES 4
  11042. /**
  11043. * @brief target -> host rx peer map V2 message definition
  11044. *
  11045. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11046. *
  11047. * @details
  11048. * The following diagram shows the format of the rx peer map v2 message sent
  11049. * from the target to the host. This layout assumes the target operates
  11050. * as little-endian.
  11051. *
  11052. * This message always contains a SW peer ID. The main purpose of the
  11053. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11054. * with, so that the host can use that peer ID to determine which peer
  11055. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11056. * other purposes, such as identifying during tx completions which peer
  11057. * the tx frames in question were transmitted to.
  11058. *
  11059. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11060. * is used during rx --> tx frame forwarding to identify which peer the
  11061. * frame needs to be forwarded to (i.e. the peer associated with the
  11062. * Destination MAC Address within the packet), and particularly which vdev
  11063. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11064. * This DA-based peer ID that is provided for certain rx frames
  11065. * (the rx frames that need to be re-transmitted as tx frames)
  11066. * is the ID that the HW uses for referring to the peer in question,
  11067. * rather than the peer ID that the SW+FW use to refer to the peer.
  11068. *
  11069. * The HW peer id here is the same meaning as AST_INDEX_0.
  11070. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11071. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11072. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11073. * AST is valid.
  11074. *
  11075. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11076. * |-------------------------------------------------------------------------|
  11077. * | SW peer ID | VDEV ID | msg type |
  11078. * |-------------------------------------------------------------------------|
  11079. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11080. * |-------------------------------------------------------------------------|
  11081. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11082. * |-------------------------------------------------------------------------|
  11083. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11084. * |-------------------------------------------------------------------------|
  11085. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11086. * |-------------------------------------------------------------------------|
  11087. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11088. * |-------------------------------------------------------------------------|
  11089. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11090. * |-------------------------------------------------------------------------|
  11091. * | Reserved_2 |
  11092. * |-------------------------------------------------------------------------|
  11093. * Where:
  11094. * NH = Next Hop
  11095. * ASTVM = AST valid mask
  11096. * OA = on-chip AST valid bit
  11097. * ASTFM = AST flow mask
  11098. *
  11099. * The following field definitions describe the format of the rx peer map v2
  11100. * messages sent from the target to the host.
  11101. * - MSG_TYPE
  11102. * Bits 7:0
  11103. * Purpose: identifies this as an rx peer map v2 message
  11104. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11105. * - VDEV_ID
  11106. * Bits 15:8
  11107. * Purpose: Indicates which virtual device the peer is associated with.
  11108. * Value: vdev ID (used in the host to look up the vdev object)
  11109. * - SW_PEER_ID
  11110. * Bits 31:16
  11111. * Purpose: The peer ID (index) that WAL is allocating
  11112. * Value: (rx) peer ID
  11113. * - MAC_ADDR_L32
  11114. * Bits 31:0
  11115. * Purpose: Identifies which peer node the peer ID is for.
  11116. * Value: lower 4 bytes of peer node's MAC address
  11117. * - MAC_ADDR_U16
  11118. * Bits 15:0
  11119. * Purpose: Identifies which peer node the peer ID is for.
  11120. * Value: upper 2 bytes of peer node's MAC address
  11121. * - HW_PEER_ID / AST_INDEX_0
  11122. * Bits 31:16
  11123. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11124. * address, so for rx frames marked for rx --> tx forwarding, the
  11125. * host can determine from the HW peer ID provided as meta-data with
  11126. * the rx frame which peer the frame is supposed to be forwarded to.
  11127. * Value: ID used by the MAC HW to identify the peer
  11128. * - AST_HASH_VALUE
  11129. * Bits 15:0
  11130. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11131. * override feature.
  11132. * - NEXT_HOP
  11133. * Bit 16
  11134. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11135. * (Wireless Distribution System).
  11136. * - AST_VALID_MASK
  11137. * Bits 19:17
  11138. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11139. * - ONCHIP_AST_VALID_FLAG
  11140. * Bit 20
  11141. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11142. * is valid.
  11143. * - AST_INDEX_1
  11144. * Bits 15:0
  11145. * Purpose: indicate the second AST index for this peer
  11146. * - AST_0_FLOW_MASK
  11147. * Bits 19:16
  11148. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11149. * - AST_1_FLOW_MASK
  11150. * Bits 23:20
  11151. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11152. * - AST_2_FLOW_MASK
  11153. * Bits 27:24
  11154. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11155. * - AST_3_FLOW_MASK
  11156. * Bits 31:28
  11157. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11158. * - AST_INDEX_2
  11159. * Bits 15:0
  11160. * Purpose: indicate the third AST index for this peer
  11161. * - TID_VALID_HI_PRI
  11162. * Bits 23:16
  11163. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11164. * - TID_VALID_LOW_PRI
  11165. * Bits 31:24
  11166. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11167. * - AST_INDEX_3
  11168. * Bits 15:0
  11169. * Purpose: indicate the fourth AST index for this peer
  11170. * - ONCHIP_AST_IDX / RESERVED
  11171. * Bits 31:16
  11172. * Purpose: This field is valid only when split AST feature is enabled.
  11173. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11174. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11175. * address, this ast_idx is used for LMAC modules for RXPCU.
  11176. * Value: ID used by the LMAC HW to identify the peer
  11177. */
  11178. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11179. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11180. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11181. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11182. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11183. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11184. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11185. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11186. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11187. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11188. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11189. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11190. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11191. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11192. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11193. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11194. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11195. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11196. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11197. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11198. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11199. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11200. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11201. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11202. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11203. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11204. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11205. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11206. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11207. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11208. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11209. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11210. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11211. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11212. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11213. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11214. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11215. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11216. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11217. do { \
  11218. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11219. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11220. } while (0)
  11221. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11222. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11223. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11224. do { \
  11225. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11226. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11227. } while (0)
  11228. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11229. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11230. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11231. do { \
  11232. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11233. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11234. } while (0)
  11235. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11236. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11237. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11238. do { \
  11239. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11240. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11241. } while (0)
  11242. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11243. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11244. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11245. do { \
  11246. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11247. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11248. } while (0)
  11249. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11250. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11251. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11252. do { \
  11253. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11254. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11255. } while (0)
  11256. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11257. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11258. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11259. do { \
  11260. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11261. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11262. } while (0)
  11263. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11264. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11265. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11266. do { \
  11267. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11268. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11269. } while (0)
  11270. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11271. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11272. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11273. do { \
  11274. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11275. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11276. } while (0)
  11277. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11278. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11279. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11280. do { \
  11281. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11282. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11283. } while (0)
  11284. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11285. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11286. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11287. do { \
  11288. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11289. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11290. } while (0)
  11291. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11292. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11293. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11294. do { \
  11295. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11296. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11297. } while (0)
  11298. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11299. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11300. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11301. do { \
  11302. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11303. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11304. } while (0)
  11305. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11306. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11307. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11308. do { \
  11309. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11310. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11311. } while (0)
  11312. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11313. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11314. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11315. do { \
  11316. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11317. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11318. } while (0)
  11319. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11320. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11321. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11322. do { \
  11323. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11324. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11325. } while (0)
  11326. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11327. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11328. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11329. do { \
  11330. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11331. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11332. } while (0)
  11333. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11334. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11335. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11336. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11337. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11338. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11339. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11340. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11341. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11342. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11343. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11344. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11345. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11346. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11347. /**
  11348. * @brief target -> host rx peer map V3 message definition
  11349. *
  11350. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11351. *
  11352. * @details
  11353. * The following diagram shows the format of the rx peer map v3 message sent
  11354. * from the target to the host.
  11355. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11356. * This layout assumes the target operates as little-endian.
  11357. *
  11358. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11359. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11360. * | SW peer ID | VDEV ID | msg type |
  11361. * |-----------------+--------------------+-----------------+-----------------|
  11362. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11363. * |-----------------+--------------------+-----------------+-----------------|
  11364. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11365. * |-----------------+--------+-----------+-----------------+-----------------|
  11366. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11367. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11368. * | (8bits) | | (4bits) | |
  11369. * |-----------------+--------+--+--+--+--------------------------------------|
  11370. * | RESERVED |E |O | | |
  11371. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11372. * | |V |V | | |
  11373. * |-----------------+--------------------+-----------------------------------|
  11374. * | HTT_MSDU_IDX_ | RESERVED | |
  11375. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11376. * | (8bits) | | |
  11377. * |-----------------+--------------------+-----------------------------------|
  11378. * | Reserved_2 |
  11379. * |--------------------------------------------------------------------------|
  11380. * | Reserved_3 |
  11381. * |--------------------------------------------------------------------------|
  11382. *
  11383. * Where:
  11384. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11385. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11386. * NH = Next Hop
  11387. * The following field definitions describe the format of the rx peer map v3
  11388. * messages sent from the target to the host.
  11389. * - MSG_TYPE
  11390. * Bits 7:0
  11391. * Purpose: identifies this as a peer map v3 message
  11392. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11393. * - VDEV_ID
  11394. * Bits 15:8
  11395. * Purpose: Indicates which virtual device the peer is associated with.
  11396. * - SW_PEER_ID
  11397. * Bits 31:16
  11398. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11399. * - MAC_ADDR_L32
  11400. * Bits 31:0
  11401. * Purpose: Identifies which peer node the peer ID is for.
  11402. * Value: lower 4 bytes of peer node's MAC address
  11403. * - MAC_ADDR_U16
  11404. * Bits 15:0
  11405. * Purpose: Identifies which peer node the peer ID is for.
  11406. * Value: upper 2 bytes of peer node's MAC address
  11407. * - MULTICAST_SW_PEER_ID
  11408. * Bits 31:16
  11409. * Purpose: The multicast peer ID (index)
  11410. * Value: set to HTT_INVALID_PEER if not valid
  11411. * - HW_PEER_ID / AST_INDEX
  11412. * Bits 15:0
  11413. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11414. * address, so for rx frames marked for rx --> tx forwarding, the
  11415. * host can determine from the HW peer ID provided as meta-data with
  11416. * the rx frame which peer the frame is supposed to be forwarded to.
  11417. * - CACHE_SET_NUM
  11418. * Bits 19:16
  11419. * Purpose: Cache Set Number for AST_INDEX
  11420. * Cache set number that should be used to cache the index based
  11421. * search results, for address and flow search.
  11422. * This value should be equal to LSB 4 bits of the hash value
  11423. * of match data, in case of search index points to an entry which
  11424. * may be used in content based search also. The value can be
  11425. * anything when the entry pointed by search index will not be
  11426. * used for content based search.
  11427. * - HTT_MSDU_IDX_VALID_MASK
  11428. * Bits 31:24
  11429. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11430. * - ONCHIP_AST_IDX / RESERVED
  11431. * Bits 15:0
  11432. * Purpose: This field is valid only when split AST feature is enabled.
  11433. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11434. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11435. * address, this ast_idx is used for LMAC modules for RXPCU.
  11436. * - NEXT_HOP
  11437. * Bits 16
  11438. * Purpose: Flag indicates next_hop AST entry used for WDS
  11439. * (Wireless Distribution System).
  11440. * - ONCHIP_AST_VALID
  11441. * Bits 17
  11442. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11443. * - EXT_AST_VALID
  11444. * Bits 18
  11445. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11446. * - EXT_AST_INDEX
  11447. * Bits 15:0
  11448. * Purpose: This field describes Extended AST index
  11449. * Valid if EXT_AST_VALID flag set
  11450. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11451. * Bits 31:24
  11452. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11453. */
  11454. /* dword 0 */
  11455. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11456. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11457. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11458. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11459. /* dword 1 */
  11460. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11461. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11462. /* dword 2 */
  11463. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11464. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11465. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11466. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11467. /* dword 3 */
  11468. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11469. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11470. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11471. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11472. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11473. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11474. /* dword 4 */
  11475. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11476. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11477. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11478. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11479. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11480. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11481. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11482. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11483. /* dword 5 */
  11484. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11485. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11486. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11487. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11488. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11489. do { \
  11490. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11491. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11492. } while (0)
  11493. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11494. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11495. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11496. do { \
  11497. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11498. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11499. } while (0)
  11500. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11501. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11502. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11503. do { \
  11504. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11505. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11506. } while (0)
  11507. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11508. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11509. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11510. do { \
  11511. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11512. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11513. } while (0)
  11514. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11515. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11516. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11517. do { \
  11518. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11519. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11520. } while (0)
  11521. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11522. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11523. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11524. do { \
  11525. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11526. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11527. } while (0)
  11528. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11529. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11530. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11531. do { \
  11532. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11533. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11534. } while (0)
  11535. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11536. (((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)
  11537. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11538. do { \
  11539. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11540. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11541. } while (0)
  11542. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11543. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11544. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11545. do { \
  11546. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11547. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11548. } while (0)
  11549. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11550. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11551. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11552. do { \
  11553. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11554. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11555. } while (0)
  11556. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11557. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11558. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11559. do { \
  11560. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11561. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11562. } while (0)
  11563. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11564. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11565. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11566. do { \
  11567. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11568. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11569. } while (0)
  11570. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11571. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11572. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11573. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11574. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11575. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11576. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11577. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11578. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11579. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11580. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11581. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11582. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11583. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11584. /**
  11585. * @brief target -> host rx peer unmap V2 message definition
  11586. *
  11587. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11588. *
  11589. * The following diagram shows the format of the rx peer unmap message sent
  11590. * from the target to the host.
  11591. *
  11592. * |31 24|23 16|15 8|7 0|
  11593. * |-----------------------------------------------------------------------|
  11594. * | SW peer ID | VDEV ID | msg type |
  11595. * |-----------------------------------------------------------------------|
  11596. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11597. * |-----------------------------------------------------------------------|
  11598. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11599. * |-----------------------------------------------------------------------|
  11600. * | Peer Delete Duration |
  11601. * |-----------------------------------------------------------------------|
  11602. * | Reserved_0 | WDS Free Count |
  11603. * |-----------------------------------------------------------------------|
  11604. * | Reserved_1 |
  11605. * |-----------------------------------------------------------------------|
  11606. * | Reserved_2 |
  11607. * |-----------------------------------------------------------------------|
  11608. *
  11609. *
  11610. * The following field definitions describe the format of the rx peer unmap
  11611. * messages sent from the target to the host.
  11612. * - MSG_TYPE
  11613. * Bits 7:0
  11614. * Purpose: identifies this as an rx peer unmap v2 message
  11615. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11616. * - VDEV_ID
  11617. * Bits 15:8
  11618. * Purpose: Indicates which virtual device the peer is associated
  11619. * with.
  11620. * Value: vdev ID (used in the host to look up the vdev object)
  11621. * - SW_PEER_ID
  11622. * Bits 31:16
  11623. * Purpose: The peer ID (index) that WAL is freeing
  11624. * Value: (rx) peer ID
  11625. * - MAC_ADDR_L32
  11626. * Bits 31:0
  11627. * Purpose: Identifies which peer node the peer ID is for.
  11628. * Value: lower 4 bytes of peer node's MAC address
  11629. * - MAC_ADDR_U16
  11630. * Bits 15:0
  11631. * Purpose: Identifies which peer node the peer ID is for.
  11632. * Value: upper 2 bytes of peer node's MAC address
  11633. * - NEXT_HOP
  11634. * Bits 16
  11635. * Purpose: Bit indicates next_hop AST entry used for WDS
  11636. * (Wireless Distribution System).
  11637. * - PEER_DELETE_DURATION
  11638. * Bits 31:0
  11639. * Purpose: Time taken to delete peer, in msec,
  11640. * Used for monitoring / debugging PEER delete response delay
  11641. * - PEER_WDS_FREE_COUNT
  11642. * Bits 15:0
  11643. * Purpose: Count of WDS entries deleted associated to peer deleted
  11644. */
  11645. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11646. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11647. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11648. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11649. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11650. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11651. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11652. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11653. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11654. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11655. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11656. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11657. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11658. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11659. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11660. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11661. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11662. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11663. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11664. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11665. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11666. do { \
  11667. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11668. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11669. } while (0)
  11670. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11671. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11672. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11673. do { \
  11674. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11675. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11676. } while (0)
  11677. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11678. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11679. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11680. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11681. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11682. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11683. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11684. /**
  11685. * @brief target -> host rx peer mlo map message definition
  11686. *
  11687. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11688. *
  11689. * @details
  11690. * The following diagram shows the format of the rx mlo peer map message sent
  11691. * from the target to the host. This layout assumes the target operates
  11692. * as little-endian.
  11693. *
  11694. * MCC:
  11695. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11696. *
  11697. * WIN:
  11698. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11699. * It will be sent on the Assoc Link.
  11700. *
  11701. * This message always contains a MLO peer ID. The main purpose of the
  11702. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11703. * with, so that the host can use that MLO peer ID to determine which peer
  11704. * transmitted the rx frame.
  11705. *
  11706. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11707. * |-------------------------------------------------------------------------|
  11708. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11709. * |-------------------------------------------------------------------------|
  11710. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11711. * |-------------------------------------------------------------------------|
  11712. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11713. * |-------------------------------------------------------------------------|
  11714. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11715. * |-------------------------------------------------------------------------|
  11716. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11717. * |-------------------------------------------------------------------------|
  11718. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11719. * |-------------------------------------------------------------------------|
  11720. * |RSVD |
  11721. * |-------------------------------------------------------------------------|
  11722. * |RSVD |
  11723. * |-------------------------------------------------------------------------|
  11724. * | htt_tlv_hdr_t |
  11725. * |-------------------------------------------------------------------------|
  11726. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11727. * |-------------------------------------------------------------------------|
  11728. * | htt_tlv_hdr_t |
  11729. * |-------------------------------------------------------------------------|
  11730. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11731. * |-------------------------------------------------------------------------|
  11732. * | htt_tlv_hdr_t |
  11733. * |-------------------------------------------------------------------------|
  11734. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11735. * |-------------------------------------------------------------------------|
  11736. *
  11737. * Where:
  11738. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11739. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11740. * V (valid) - 1 Bit Bit17
  11741. * CHIPID - 3 Bits
  11742. * TIDMASK - 8 Bits
  11743. * CACHE_SET_NUM - 8 Bits
  11744. *
  11745. * The following field definitions describe the format of the rx MLO peer map
  11746. * messages sent from the target to the host.
  11747. * - MSG_TYPE
  11748. * Bits 7:0
  11749. * Purpose: identifies this as an rx mlo peer map message
  11750. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11751. *
  11752. * - MLO_PEER_ID
  11753. * Bits 23:8
  11754. * Purpose: The MLO peer ID (index).
  11755. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11756. * Value: MLO peer ID
  11757. *
  11758. * - NUMLINK
  11759. * Bits: 26:24 (3Bits)
  11760. * Purpose: Indicate the max number of logical links supported per client.
  11761. * Value: number of logical links
  11762. *
  11763. * - PRC
  11764. * Bits: 29:27 (3Bits)
  11765. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11766. * if there is migration of the primary chip.
  11767. * Value: Primary REO CHIPID
  11768. *
  11769. * - MAC_ADDR_L32
  11770. * Bits 31:0
  11771. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11772. * Value: lower 4 bytes of peer node's MAC address
  11773. *
  11774. * - MAC_ADDR_U16
  11775. * Bits 15:0
  11776. * Purpose: Identifies which peer node the peer ID is for.
  11777. * Value: upper 2 bytes of peer node's MAC address
  11778. *
  11779. * - PRIMARY_TCL_AST_IDX
  11780. * Bits 15:0
  11781. * Purpose: Primary TCL AST index for this peer.
  11782. *
  11783. * - V
  11784. * 1 Bit Position 16
  11785. * Purpose: If the ast idx is valid.
  11786. *
  11787. * - CHIPID
  11788. * Bits 19:17
  11789. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11790. *
  11791. * - TIDMASK
  11792. * Bits 27:20
  11793. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11794. *
  11795. * - CACHE_SET_NUM
  11796. * Bits 31:28
  11797. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11798. * Cache set number that should be used to cache the index based
  11799. * search results, for address and flow search.
  11800. * This value should be equal to LSB four bits of the hash value
  11801. * of match data, in case of search index points to an entry which
  11802. * may be used in content based search also. The value can be
  11803. * anything when the entry pointed by search index will not be
  11804. * used for content based search.
  11805. *
  11806. * - htt_tlv_hdr_t
  11807. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11808. *
  11809. * Bits 11:0
  11810. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11811. *
  11812. * Bits 23:12
  11813. * Purpose: Length, Length of the value that follows the header
  11814. *
  11815. * Bits 31:28
  11816. * Purpose: Reserved.
  11817. *
  11818. *
  11819. * - SW_PEER_ID
  11820. * Bits 15:0
  11821. * Purpose: The peer ID (index) that WAL is allocating
  11822. * Value: (rx) peer ID
  11823. *
  11824. * - VDEV_ID
  11825. * Bits 23:16
  11826. * Purpose: Indicates which virtual device the peer is associated with.
  11827. * Value: vdev ID (used in the host to look up the vdev object)
  11828. *
  11829. * - CHIPID
  11830. * Bits 26:24
  11831. * Purpose: Indicates which Chip id the peer is associated with.
  11832. * Value: chip ID (Provided by Host as part of QMI exchange)
  11833. */
  11834. typedef enum {
  11835. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11836. } MLO_PEER_MAP_TLV_TAG_ID;
  11837. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11838. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11839. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11840. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11841. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11842. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11843. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11844. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11845. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11846. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11847. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11848. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11849. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11850. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11851. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11852. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11853. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11854. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11855. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11856. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11857. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11858. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11859. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11860. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11861. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11862. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11863. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11864. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11865. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11866. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11867. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11868. do { \
  11869. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11870. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11871. } while (0)
  11872. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11873. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11874. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11875. do { \
  11876. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11877. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11878. } while (0)
  11879. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11880. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11881. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11882. do { \
  11883. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11884. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11885. } while (0)
  11886. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11887. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11888. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11889. do { \
  11890. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11891. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11892. } while (0)
  11893. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11894. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11895. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11896. do { \
  11897. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11898. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11899. } while (0)
  11900. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11901. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11902. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11903. do { \
  11904. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11905. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11906. } while (0)
  11907. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11908. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11909. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11910. do { \
  11911. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11912. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11913. } while (0)
  11914. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11915. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11916. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11917. do { \
  11918. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11919. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11920. } while (0)
  11921. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11922. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11923. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11924. do { \
  11925. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11926. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11927. } while (0)
  11928. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11929. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11930. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11931. do { \
  11932. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11933. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11934. } while (0)
  11935. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11936. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11937. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11938. do { \
  11939. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11940. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11941. } while (0)
  11942. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11943. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11944. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11945. do { \
  11946. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11947. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11948. } while (0)
  11949. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11950. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11951. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11952. do { \
  11953. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11954. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11955. } while (0)
  11956. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11957. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11958. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11959. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11960. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11961. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11962. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11963. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11964. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11965. *
  11966. * The following diagram shows the format of the rx mlo peer unmap message sent
  11967. * from the target to the host.
  11968. *
  11969. * |31 24|23 16|15 8|7 0|
  11970. * |-----------------------------------------------------------------------|
  11971. * | RSVD_24_31 | MLO peer ID | msg type |
  11972. * |-----------------------------------------------------------------------|
  11973. */
  11974. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11975. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11976. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11977. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11978. /**
  11979. * @brief target -> host message specifying security parameters
  11980. *
  11981. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11982. *
  11983. * @details
  11984. * The following diagram shows the format of the security specification
  11985. * message sent from the target to the host.
  11986. * This security specification message tells the host whether a PN check is
  11987. * necessary on rx data frames, and if so, how large the PN counter is.
  11988. * This message also tells the host about the security processing to apply
  11989. * to defragmented rx frames - specifically, whether a Message Integrity
  11990. * Check is required, and the Michael key to use.
  11991. *
  11992. * |31 24|23 16|15|14 8|7 0|
  11993. * |-----------------------------------------------------------------------|
  11994. * | peer ID | U| security type | msg type |
  11995. * |-----------------------------------------------------------------------|
  11996. * | Michael Key K0 |
  11997. * |-----------------------------------------------------------------------|
  11998. * | Michael Key K1 |
  11999. * |-----------------------------------------------------------------------|
  12000. * | WAPI RSC Low0 |
  12001. * |-----------------------------------------------------------------------|
  12002. * | WAPI RSC Low1 |
  12003. * |-----------------------------------------------------------------------|
  12004. * | WAPI RSC Hi0 |
  12005. * |-----------------------------------------------------------------------|
  12006. * | WAPI RSC Hi1 |
  12007. * |-----------------------------------------------------------------------|
  12008. *
  12009. * The following field definitions describe the format of the security
  12010. * indication message sent from the target to the host.
  12011. * - MSG_TYPE
  12012. * Bits 7:0
  12013. * Purpose: identifies this as a security specification message
  12014. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12015. * - SEC_TYPE
  12016. * Bits 14:8
  12017. * Purpose: specifies which type of security applies to the peer
  12018. * Value: htt_sec_type enum value
  12019. * - UNICAST
  12020. * Bit 15
  12021. * Purpose: whether this security is applied to unicast or multicast data
  12022. * Value: 1 -> unicast, 0 -> multicast
  12023. * - PEER_ID
  12024. * Bits 31:16
  12025. * Purpose: The ID number for the peer the security specification is for
  12026. * Value: peer ID
  12027. * - MICHAEL_KEY_K0
  12028. * Bits 31:0
  12029. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12030. * Value: Michael Key K0 (if security type is TKIP)
  12031. * - MICHAEL_KEY_K1
  12032. * Bits 31:0
  12033. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12034. * Value: Michael Key K1 (if security type is TKIP)
  12035. * - WAPI_RSC_LOW0
  12036. * Bits 31:0
  12037. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12038. * Value: WAPI RSC Low0 (if security type is WAPI)
  12039. * - WAPI_RSC_LOW1
  12040. * Bits 31:0
  12041. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12042. * Value: WAPI RSC Low1 (if security type is WAPI)
  12043. * - WAPI_RSC_HI0
  12044. * Bits 31:0
  12045. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12046. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12047. * - WAPI_RSC_HI1
  12048. * Bits 31:0
  12049. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12050. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12051. */
  12052. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12053. #define HTT_SEC_IND_SEC_TYPE_S 8
  12054. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12055. #define HTT_SEC_IND_UNICAST_S 15
  12056. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12057. #define HTT_SEC_IND_PEER_ID_S 16
  12058. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12059. do { \
  12060. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12061. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12062. } while (0)
  12063. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12064. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12065. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12066. do { \
  12067. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12068. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12069. } while (0)
  12070. #define HTT_SEC_IND_UNICAST_GET(word) \
  12071. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12072. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12073. do { \
  12074. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12075. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12076. } while (0)
  12077. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12078. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12079. #define HTT_SEC_IND_BYTES 28
  12080. /**
  12081. * @brief target -> host rx ADDBA / DELBA message definitions
  12082. *
  12083. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12084. *
  12085. * @details
  12086. * The following diagram shows the format of the rx ADDBA message sent
  12087. * from the target to the host:
  12088. *
  12089. * |31 20|19 16|15 8|7 0|
  12090. * |---------------------------------------------------------------------|
  12091. * | peer ID | TID | window size | msg type |
  12092. * |---------------------------------------------------------------------|
  12093. *
  12094. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12095. *
  12096. * The following diagram shows the format of the rx DELBA message sent
  12097. * from the target to the host:
  12098. *
  12099. * |31 20|19 16|15 10|9 8|7 0|
  12100. * |---------------------------------------------------------------------|
  12101. * | peer ID | TID | window size | IR| msg type |
  12102. * |---------------------------------------------------------------------|
  12103. *
  12104. * The following field definitions describe the format of the rx ADDBA
  12105. * and DELBA messages sent from the target to the host.
  12106. * - MSG_TYPE
  12107. * Bits 7:0
  12108. * Purpose: identifies this as an rx ADDBA or DELBA message
  12109. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12110. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12111. * - IR (initiator / recipient)
  12112. * Bits 9:8 (DELBA only)
  12113. * Purpose: specify whether the DELBA handshake was initiated by the
  12114. * local STA/AP, or by the peer STA/AP
  12115. * Value:
  12116. * 0 - unspecified
  12117. * 1 - initiator (a.k.a. originator)
  12118. * 2 - recipient (a.k.a. responder)
  12119. * 3 - unused / reserved
  12120. * - WIN_SIZE
  12121. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12122. * Purpose: Specifies the length of the block ack window (max = 64).
  12123. * Value:
  12124. * block ack window length specified by the received ADDBA/DELBA
  12125. * management message.
  12126. * - TID
  12127. * Bits 19:16
  12128. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12129. * Value:
  12130. * TID specified by the received ADDBA or DELBA management message.
  12131. * - PEER_ID
  12132. * Bits 31:20
  12133. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12134. * Value:
  12135. * ID (hash value) used by the host for fast, direct lookup of
  12136. * host SW peer info, including rx reorder states.
  12137. */
  12138. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12139. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12140. #define HTT_RX_ADDBA_TID_M 0xf0000
  12141. #define HTT_RX_ADDBA_TID_S 16
  12142. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12143. #define HTT_RX_ADDBA_PEER_ID_S 20
  12144. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12145. do { \
  12146. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12147. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12148. } while (0)
  12149. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12150. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12151. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12152. do { \
  12153. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12154. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12155. } while (0)
  12156. #define HTT_RX_ADDBA_TID_GET(word) \
  12157. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12158. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12159. do { \
  12160. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12161. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12162. } while (0)
  12163. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12164. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12165. #define HTT_RX_ADDBA_BYTES 4
  12166. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12167. #define HTT_RX_DELBA_INITIATOR_S 8
  12168. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12169. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12170. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12171. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12172. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12173. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12174. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12175. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12176. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12177. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12178. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12179. do { \
  12180. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12181. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12182. } while (0)
  12183. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12184. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12185. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12186. do { \
  12187. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12188. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12189. } while (0)
  12190. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12191. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12192. #define HTT_RX_DELBA_BYTES 4
  12193. /**
  12194. * @brief target -> host rx ADDBA / DELBA message definitions
  12195. *
  12196. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12197. *
  12198. * @details
  12199. * The following diagram shows the format of the rx ADDBA extn message sent
  12200. * from the target to the host:
  12201. *
  12202. * |31 20|19 16|15 13|12 8|7 0|
  12203. * |---------------------------------------------------------------------|
  12204. * | peer ID | TID | reserved | msg type |
  12205. * |---------------------------------------------------------------------|
  12206. * | reserved | window size |
  12207. * |---------------------------------------------------------------------|
  12208. *
  12209. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12210. *
  12211. * The following diagram shows the format of the rx DELBA message sent
  12212. * from the target to the host:
  12213. *
  12214. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12215. * |---------------------------------------------------------------------|
  12216. * | peer ID | TID | reserved | IR| msg type |
  12217. * |---------------------------------------------------------------------|
  12218. * | reserved | window size |
  12219. * |---------------------------------------------------------------------|
  12220. *
  12221. * The following field definitions describe the format of the rx ADDBA
  12222. * and DELBA messages sent from the target to the host.
  12223. * - MSG_TYPE
  12224. * Bits 7:0
  12225. * Purpose: identifies this as an rx ADDBA or DELBA message
  12226. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12227. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12228. * - IR (initiator / recipient)
  12229. * Bits 9:8 (DELBA only)
  12230. * Purpose: specify whether the DELBA handshake was initiated by the
  12231. * local STA/AP, or by the peer STA/AP
  12232. * Value:
  12233. * 0 - unspecified
  12234. * 1 - initiator (a.k.a. originator)
  12235. * 2 - recipient (a.k.a. responder)
  12236. * 3 - unused / reserved
  12237. * Value:
  12238. * block ack window length specified by the received ADDBA/DELBA
  12239. * management message.
  12240. * - TID
  12241. * Bits 19:16
  12242. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12243. * Value:
  12244. * TID specified by the received ADDBA or DELBA management message.
  12245. * - PEER_ID
  12246. * Bits 31:20
  12247. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12248. * Value:
  12249. * ID (hash value) used by the host for fast, direct lookup of
  12250. * host SW peer info, including rx reorder states.
  12251. * == DWORD 1
  12252. * - WIN_SIZE
  12253. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12254. * Purpose: Specifies the length of the block ack window (max = 8191).
  12255. */
  12256. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12257. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12258. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12259. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12260. /*--- Dword 0 ---*/
  12261. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12262. do { \
  12263. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12264. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12265. } while (0)
  12266. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12267. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12268. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12269. do { \
  12270. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12271. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12272. } while (0)
  12273. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12274. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12275. /*--- Dword 1 ---*/
  12276. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12277. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12278. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12279. do { \
  12280. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12281. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12282. } while (0)
  12283. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12284. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12285. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12286. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12287. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12288. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12289. #define HTT_RX_DELBA_EXTN_TID_S 16
  12290. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12291. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12292. /*--- Dword 0 ---*/
  12293. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12294. do { \
  12295. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12296. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12297. } while (0)
  12298. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12299. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12300. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12301. do { \
  12302. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12303. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12304. } while (0)
  12305. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12306. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12307. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12308. do { \
  12309. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12310. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12311. } while (0)
  12312. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12313. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12314. /*--- Dword 1 ---*/
  12315. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12316. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12317. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12318. do { \
  12319. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12320. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12321. } while (0)
  12322. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12323. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12324. #define HTT_RX_DELBA_EXTN_BYTES 8
  12325. /**
  12326. * @brief tx queue group information element definition
  12327. *
  12328. * @details
  12329. * The following diagram shows the format of the tx queue group
  12330. * information element, which can be included in target --> host
  12331. * messages to specify the number of tx "credits" (tx descriptors
  12332. * for LL, or tx buffers for HL) available to a particular group
  12333. * of host-side tx queues, and which host-side tx queues belong to
  12334. * the group.
  12335. *
  12336. * |31|30 24|23 16|15|14|13 0|
  12337. * |------------------------------------------------------------------------|
  12338. * | X| reserved | tx queue grp ID | A| S| credit count |
  12339. * |------------------------------------------------------------------------|
  12340. * | vdev ID mask | AC mask |
  12341. * |------------------------------------------------------------------------|
  12342. *
  12343. * The following definitions describe the fields within the tx queue group
  12344. * information element:
  12345. * - credit_count
  12346. * Bits 13:1
  12347. * Purpose: specify how many tx credits are available to the tx queue group
  12348. * Value: An absolute or relative, positive or negative credit value
  12349. * The 'A' bit specifies whether the value is absolute or relative.
  12350. * The 'S' bit specifies whether the value is positive or negative.
  12351. * A negative value can only be relative, not absolute.
  12352. * An absolute value replaces any prior credit value the host has for
  12353. * the tx queue group in question.
  12354. * A relative value is added to the prior credit value the host has for
  12355. * the tx queue group in question.
  12356. * - sign
  12357. * Bit 14
  12358. * Purpose: specify whether the credit count is positive or negative
  12359. * Value: 0 -> positive, 1 -> negative
  12360. * - absolute
  12361. * Bit 15
  12362. * Purpose: specify whether the credit count is absolute or relative
  12363. * Value: 0 -> relative, 1 -> absolute
  12364. * - txq_group_id
  12365. * Bits 23:16
  12366. * Purpose: indicate which tx queue group's credit and/or membership are
  12367. * being specified
  12368. * Value: 0 to max_tx_queue_groups-1
  12369. * - reserved
  12370. * Bits 30:16
  12371. * Value: 0x0
  12372. * - eXtension
  12373. * Bit 31
  12374. * Purpose: specify whether another tx queue group info element follows
  12375. * Value: 0 -> no more tx queue group information elements
  12376. * 1 -> another tx queue group information element immediately follows
  12377. * - ac_mask
  12378. * Bits 15:0
  12379. * Purpose: specify which Access Categories belong to the tx queue group
  12380. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12381. * the tx queue group.
  12382. * The AC bit-mask values are obtained by left-shifting by the
  12383. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12384. * - vdev_id_mask
  12385. * Bits 31:16
  12386. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12387. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12388. * belong to the tx queue group.
  12389. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12390. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12391. */
  12392. PREPACK struct htt_txq_group {
  12393. A_UINT32
  12394. credit_count: 14,
  12395. sign: 1,
  12396. absolute: 1,
  12397. tx_queue_group_id: 8,
  12398. reserved0: 7,
  12399. extension: 1;
  12400. A_UINT32
  12401. ac_mask: 16,
  12402. vdev_id_mask: 16;
  12403. } POSTPACK;
  12404. /* first word */
  12405. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12406. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12407. #define HTT_TXQ_GROUP_SIGN_S 14
  12408. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12409. #define HTT_TXQ_GROUP_ABS_S 15
  12410. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12411. #define HTT_TXQ_GROUP_ID_S 16
  12412. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12413. #define HTT_TXQ_GROUP_EXT_S 31
  12414. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12415. /* second word */
  12416. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12417. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12418. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12419. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12420. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12421. do { \
  12422. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12423. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12424. } while (0)
  12425. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12426. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12427. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12428. do { \
  12429. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12430. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12431. } while (0)
  12432. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12433. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12434. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12435. do { \
  12436. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12437. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12438. } while (0)
  12439. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12440. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12441. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12442. do { \
  12443. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12444. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12445. } while (0)
  12446. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12447. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12448. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12449. do { \
  12450. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12451. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12452. } while (0)
  12453. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12454. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12455. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12456. do { \
  12457. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12458. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12459. } while (0)
  12460. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12461. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12462. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12463. do { \
  12464. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12465. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12466. } while (0)
  12467. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12468. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12469. /**
  12470. * @brief target -> host TX completion indication message definition
  12471. *
  12472. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12473. *
  12474. * @details
  12475. * The following diagram shows the format of the TX completion indication sent
  12476. * from the target to the host
  12477. *
  12478. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12479. * |-------------------------------------------------------------------|
  12480. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12481. * |-------------------------------------------------------------------|
  12482. * payload:| MSDU1 ID | MSDU0 ID |
  12483. * |-------------------------------------------------------------------|
  12484. * : MSDU3 ID | MSDU2 ID :
  12485. * |-------------------------------------------------------------------|
  12486. * | struct htt_tx_compl_ind_append_retries |
  12487. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12488. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12489. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12490. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12491. * |-------------------------------------------------------------------|
  12492. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12493. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12494. * | MSDU0 tx_tsf64_low |
  12495. * |-------------------------------------------------------------------|
  12496. * | MSDU0 tx_tsf64_high |
  12497. * |-------------------------------------------------------------------|
  12498. * | MSDU1 tx_tsf64_low |
  12499. * |-------------------------------------------------------------------|
  12500. * | MSDU1 tx_tsf64_high |
  12501. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12502. * | phy_timestamp |
  12503. * |-------------------------------------------------------------------|
  12504. * | rate specs (see below) |
  12505. * |-------------------------------------------------------------------|
  12506. * | seqctrl | framectrl |
  12507. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12508. * Where:
  12509. * A0 = append (a.k.a. append0)
  12510. * A1 = append1
  12511. * TP = MSDU tx power presence
  12512. * A2 = append2
  12513. * A3 = append3
  12514. * A4 = append4
  12515. *
  12516. * The following field definitions describe the format of the TX completion
  12517. * indication sent from the target to the host
  12518. * Header fields:
  12519. * - msg_type
  12520. * Bits 7:0
  12521. * Purpose: identifies this as HTT TX completion indication
  12522. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12523. * - status
  12524. * Bits 10:8
  12525. * Purpose: the TX completion status of payload fragmentations descriptors
  12526. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12527. * - tid
  12528. * Bits 14:11
  12529. * Purpose: the tid associated with those fragmentation descriptors. It is
  12530. * valid or not, depending on the tid_invalid bit.
  12531. * Value: 0 to 15
  12532. * - tid_invalid
  12533. * Bits 15:15
  12534. * Purpose: this bit indicates whether the tid field is valid or not
  12535. * Value: 0 indicates valid; 1 indicates invalid
  12536. * - num
  12537. * Bits 23:16
  12538. * Purpose: the number of payload in this indication
  12539. * Value: 1 to 255
  12540. * - append (a.k.a. append0)
  12541. * Bits 24:24
  12542. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12543. * the number of tx retries for one MSDU at the end of this message
  12544. * Value: 0 indicates no appending; 1 indicates appending
  12545. * - append1
  12546. * Bits 25:25
  12547. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12548. * contains the timestamp info for each TX msdu id in payload.
  12549. * The order of the timestamps matches the order of the MSDU IDs.
  12550. * Note that a big-endian host needs to account for the reordering
  12551. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12552. * conversion) when determining which tx timestamp corresponds to
  12553. * which MSDU ID.
  12554. * Value: 0 indicates no appending; 1 indicates appending
  12555. * - msdu_tx_power_presence
  12556. * Bits 26:26
  12557. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12558. * for each MSDU referenced by the TX_COMPL_IND message.
  12559. * The tx power is reported in 0.5 dBm units.
  12560. * The order of the per-MSDU tx power reports matches the order
  12561. * of the MSDU IDs.
  12562. * Note that a big-endian host needs to account for the reordering
  12563. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12564. * conversion) when determining which Tx Power corresponds to
  12565. * which MSDU ID.
  12566. * Value: 0 indicates MSDU tx power reports are not appended,
  12567. * 1 indicates MSDU tx power reports are appended
  12568. * - append2
  12569. * Bits 27:27
  12570. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12571. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12572. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12573. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  12574. * for each MSDU, for convenience.
  12575. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12576. * this append2 bit is set).
  12577. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12578. * dB above the noise floor.
  12579. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12580. * 1 indicates MSDU ACK RSSI values are appended.
  12581. * - append3
  12582. * Bits 28:28
  12583. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12584. * contains the tx tsf info based on wlan global TSF for
  12585. * each TX msdu id in payload.
  12586. * The order of the tx tsf matches the order of the MSDU IDs.
  12587. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12588. * values to indicate the the lower 32 bits and higher 32 bits of
  12589. * the tx tsf.
  12590. * The tx_tsf64 here represents the time MSDU was acked and the
  12591. * tx_tsf64 has microseconds units.
  12592. * Value: 0 indicates no appending; 1 indicates appending
  12593. * - append4
  12594. * Bits 29:29
  12595. * Purpose: Indicate whether data frame control fields and fields required
  12596. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12597. * message. The order of the this message matches the order of
  12598. * the MSDU IDs.
  12599. * Value: 0 indicates frame control fields and fields required for
  12600. * radio tap header values are not appended,
  12601. * 1 indicates frame control fields and fields required for
  12602. * radio tap header values are appended.
  12603. * Payload fields:
  12604. * - hmsdu_id
  12605. * Bits 15:0
  12606. * Purpose: this ID is used to track the Tx buffer in host
  12607. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12608. */
  12609. PREPACK struct htt_tx_data_hdr_information {
  12610. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12611. A_UINT32 /* word 1 */
  12612. /* preamble:
  12613. * 0-OFDM,
  12614. * 1-CCk,
  12615. * 2-HT,
  12616. * 3-VHT
  12617. */
  12618. preamble: 2, /* [1:0] */
  12619. /* mcs:
  12620. * In case of HT preamble interpret
  12621. * MCS along with NSS.
  12622. * Valid values for HT are 0 to 7.
  12623. * HT mcs 0 with NSS 2 is mcs 8.
  12624. * Valid values for VHT are 0 to 9.
  12625. */
  12626. mcs: 4, /* [5:2] */
  12627. /* rate:
  12628. * This is applicable only for
  12629. * CCK and OFDM preamble type
  12630. * rate 0: OFDM 48 Mbps,
  12631. * 1: OFDM 24 Mbps,
  12632. * 2: OFDM 12 Mbps
  12633. * 3: OFDM 6 Mbps
  12634. * 4: OFDM 54 Mbps
  12635. * 5: OFDM 36 Mbps
  12636. * 6: OFDM 18 Mbps
  12637. * 7: OFDM 9 Mbps
  12638. * rate 0: CCK 11 Mbps Long
  12639. * 1: CCK 5.5 Mbps Long
  12640. * 2: CCK 2 Mbps Long
  12641. * 3: CCK 1 Mbps Long
  12642. * 4: CCK 11 Mbps Short
  12643. * 5: CCK 5.5 Mbps Short
  12644. * 6: CCK 2 Mbps Short
  12645. */
  12646. rate : 3, /* [ 8: 6] */
  12647. rssi : 8, /* [16: 9] units=dBm */
  12648. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12649. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12650. stbc : 1, /* [22] */
  12651. sgi : 1, /* [23] */
  12652. ldpc : 1, /* [24] */
  12653. beamformed: 1, /* [25] */
  12654. /* tx_retry_cnt:
  12655. * Indicates retry count of data tx frames provided by the host.
  12656. */
  12657. tx_retry_cnt: 6; /* [31:26] */
  12658. A_UINT32 /* word 2 */
  12659. framectrl:16, /* [15: 0] */
  12660. seqno:16; /* [31:16] */
  12661. } POSTPACK;
  12662. #define HTT_TX_COMPL_IND_STATUS_S 8
  12663. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12664. #define HTT_TX_COMPL_IND_TID_S 11
  12665. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12666. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12667. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12668. #define HTT_TX_COMPL_IND_NUM_S 16
  12669. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12670. #define HTT_TX_COMPL_IND_APPEND_S 24
  12671. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12672. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12673. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12674. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12675. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12676. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12677. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12678. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12679. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12680. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12681. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12682. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12683. do { \
  12684. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12685. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12686. } while (0)
  12687. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12688. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12689. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12690. do { \
  12691. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12692. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12693. } while (0)
  12694. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12695. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12696. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12697. do { \
  12698. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12699. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12700. } while (0)
  12701. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12702. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12703. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12704. do { \
  12705. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12706. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12707. } while (0)
  12708. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12709. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12710. HTT_TX_COMPL_IND_TID_INV_S)
  12711. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12712. do { \
  12713. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12714. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12715. } while (0)
  12716. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12717. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12718. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12719. do { \
  12720. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12721. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12722. } while (0)
  12723. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12724. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12725. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12726. do { \
  12727. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12728. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12729. } while (0)
  12730. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12731. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12732. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12733. do { \
  12734. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12735. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12736. } while (0)
  12737. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12738. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12739. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12740. do { \
  12741. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12742. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12743. } while (0)
  12744. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12745. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12746. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12747. do { \
  12748. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12749. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12750. } while (0)
  12751. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12752. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12753. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12754. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12755. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12756. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12757. #define HTT_TX_COMPL_IND_STAT_OK 0
  12758. /* DISCARD:
  12759. * current meaning:
  12760. * MSDUs were queued for transmission but filtered by HW or SW
  12761. * without any over the air attempts
  12762. * legacy meaning (HL Rome):
  12763. * MSDUs were discarded by the target FW without any over the air
  12764. * attempts due to lack of space
  12765. */
  12766. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12767. /* NO_ACK:
  12768. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12769. */
  12770. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12771. /* POSTPONE:
  12772. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12773. * be downloaded again later (in the appropriate order), when they are
  12774. * deliverable.
  12775. */
  12776. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12777. /*
  12778. * The PEER_DEL tx completion status is used for HL cases
  12779. * where the peer the frame is for has been deleted.
  12780. * The host has already discarded its copy of the frame, but
  12781. * it still needs the tx completion to restore its credit.
  12782. */
  12783. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12784. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12785. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12786. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12787. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12788. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12789. PREPACK struct htt_tx_compl_ind_base {
  12790. A_UINT32 hdr;
  12791. A_UINT16 payload[1/*or more*/];
  12792. } POSTPACK;
  12793. PREPACK struct htt_tx_compl_ind_append_retries {
  12794. A_UINT16 msdu_id;
  12795. A_UINT8 tx_retries;
  12796. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12797. 0: this is the last append_retries struct */
  12798. } POSTPACK;
  12799. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12800. A_UINT32 timestamp[1/*or more*/];
  12801. } POSTPACK;
  12802. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12803. A_UINT32 tx_tsf64_low;
  12804. A_UINT32 tx_tsf64_high;
  12805. } POSTPACK;
  12806. /* htt_tx_data_hdr_information payload extension fields: */
  12807. /* DWORD zero */
  12808. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12809. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12810. /* DWORD one */
  12811. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12812. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12813. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12814. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12815. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12816. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12817. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12818. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12819. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12820. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12821. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12822. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12823. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12824. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12825. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12826. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12827. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12828. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12829. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12830. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12831. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12832. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12833. /* DWORD two */
  12834. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12835. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12836. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12837. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12838. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12839. do { \
  12840. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12841. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12842. } while (0)
  12843. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12844. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12845. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12846. do { \
  12847. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12848. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12849. } while (0)
  12850. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12851. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12852. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12853. do { \
  12854. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12855. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12856. } while (0)
  12857. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12858. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12859. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12860. do { \
  12861. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12862. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12863. } while (0)
  12864. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12865. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12866. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12867. do { \
  12868. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12869. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12870. } while (0)
  12871. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12872. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12873. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12874. do { \
  12875. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12876. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12877. } while (0)
  12878. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12879. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12880. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12881. do { \
  12882. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12883. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12884. } while (0)
  12885. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12886. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12887. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12888. do { \
  12889. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12890. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12891. } while (0)
  12892. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12893. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12894. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12895. do { \
  12896. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12897. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12898. } while (0)
  12899. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12900. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12901. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12902. do { \
  12903. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12904. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12905. } while (0)
  12906. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12907. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12908. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12909. do { \
  12910. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12911. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12912. } while (0)
  12913. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12914. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12915. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12916. do { \
  12917. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12918. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12919. } while (0)
  12920. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12921. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12922. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12923. do { \
  12924. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12925. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12926. } while (0)
  12927. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12928. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12929. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12930. do { \
  12931. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12932. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12933. } while (0)
  12934. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12935. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12936. /**
  12937. * @brief target -> host rate-control update indication message
  12938. *
  12939. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12940. *
  12941. * @details
  12942. * The following diagram shows the format of the RC Update message
  12943. * sent from the target to the host, while processing the tx-completion
  12944. * of a transmitted PPDU.
  12945. *
  12946. * |31 24|23 16|15 8|7 0|
  12947. * |-------------------------------------------------------------|
  12948. * | peer ID | vdev ID | msg_type |
  12949. * |-------------------------------------------------------------|
  12950. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12951. * |-------------------------------------------------------------|
  12952. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12953. * |-------------------------------------------------------------|
  12954. * | : |
  12955. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12956. * | : |
  12957. * |-------------------------------------------------------------|
  12958. * | : |
  12959. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12960. * | : |
  12961. * |-------------------------------------------------------------|
  12962. * : :
  12963. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12964. *
  12965. */
  12966. typedef struct {
  12967. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12968. A_UINT32 rate_code_flags;
  12969. A_UINT32 flags; /* Encodes information such as excessive
  12970. retransmission, aggregate, some info
  12971. from .11 frame control,
  12972. STBC, LDPC, (SGI and Tx Chain Mask
  12973. are encoded in ptx_rc->flags field),
  12974. AMPDU truncation (BT/time based etc.),
  12975. RTS/CTS attempt */
  12976. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12977. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12978. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12979. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12980. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12981. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12982. } HTT_RC_TX_DONE_PARAMS;
  12983. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12984. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12985. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12986. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12987. #define HTT_RC_UPDATE_VDEVID_S 8
  12988. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12989. #define HTT_RC_UPDATE_PEERID_S 16
  12990. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12991. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12992. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12993. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12994. do { \
  12995. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12996. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12997. } while (0)
  12998. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12999. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13000. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13001. do { \
  13002. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13003. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13004. } while (0)
  13005. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13006. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13007. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13008. do { \
  13009. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13010. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13011. } while (0)
  13012. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13013. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13014. /**
  13015. * @brief target -> host rx fragment indication message definition
  13016. *
  13017. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13018. *
  13019. * @details
  13020. * The following field definitions describe the format of the rx fragment
  13021. * indication message sent from the target to the host.
  13022. * The rx fragment indication message shares the format of the
  13023. * rx indication message, but not all fields from the rx indication message
  13024. * are relevant to the rx fragment indication message.
  13025. *
  13026. *
  13027. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13028. * |-----------+-------------------+---------------------+-------------|
  13029. * | peer ID | |FV| ext TID | msg type |
  13030. * |-------------------------------------------------------------------|
  13031. * | | flush | flush |
  13032. * | | end | start |
  13033. * | | seq num | seq num |
  13034. * |-------------------------------------------------------------------|
  13035. * | reserved | FW rx desc bytes |
  13036. * |-------------------------------------------------------------------|
  13037. * | | FW MSDU Rx |
  13038. * | | desc B0 |
  13039. * |-------------------------------------------------------------------|
  13040. * Header fields:
  13041. * - MSG_TYPE
  13042. * Bits 7:0
  13043. * Purpose: identifies this as an rx fragment indication message
  13044. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13045. * - EXT_TID
  13046. * Bits 12:8
  13047. * Purpose: identify the traffic ID of the rx data, including
  13048. * special "extended" TID values for multicast, broadcast, and
  13049. * non-QoS data frames
  13050. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13051. * - FLUSH_VALID (FV)
  13052. * Bit 13
  13053. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13054. * is valid
  13055. * Value:
  13056. * 1 -> flush IE is valid and needs to be processed
  13057. * 0 -> flush IE is not valid and should be ignored
  13058. * - PEER_ID
  13059. * Bits 31:16
  13060. * Purpose: Identify, by ID, which peer sent the rx data
  13061. * Value: ID of the peer who sent the rx data
  13062. * - FLUSH_SEQ_NUM_START
  13063. * Bits 5:0
  13064. * Purpose: Indicate the start of a series of MPDUs to flush
  13065. * Not all MPDUs within this series are necessarily valid - the host
  13066. * must check each sequence number within this range to see if the
  13067. * corresponding MPDU is actually present.
  13068. * This field is only valid if the FV bit is set.
  13069. * Value:
  13070. * The sequence number for the first MPDUs to check to flush.
  13071. * The sequence number is masked by 0x3f.
  13072. * - FLUSH_SEQ_NUM_END
  13073. * Bits 11:6
  13074. * Purpose: Indicate the end of a series of MPDUs to flush
  13075. * Value:
  13076. * The sequence number one larger than the sequence number of the
  13077. * last MPDU to check to flush.
  13078. * The sequence number is masked by 0x3f.
  13079. * Not all MPDUs within this series are necessarily valid - the host
  13080. * must check each sequence number within this range to see if the
  13081. * corresponding MPDU is actually present.
  13082. * This field is only valid if the FV bit is set.
  13083. * Rx descriptor fields:
  13084. * - FW_RX_DESC_BYTES
  13085. * Bits 15:0
  13086. * Purpose: Indicate how many bytes in the Rx indication are used for
  13087. * FW Rx descriptors
  13088. * Value: 1
  13089. */
  13090. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13091. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13092. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13093. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13094. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13095. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13096. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13097. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13098. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13099. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13100. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13101. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13102. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13103. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13104. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13105. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13106. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13107. #define HTT_RX_FRAG_IND_BYTES \
  13108. (4 /* msg hdr */ + \
  13109. 4 /* flush spec */ + \
  13110. 4 /* (unused) FW rx desc bytes spec */ + \
  13111. 4 /* FW rx desc */)
  13112. /**
  13113. * @brief target -> host test message definition
  13114. *
  13115. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13116. *
  13117. * @details
  13118. * The following field definitions describe the format of the test
  13119. * message sent from the target to the host.
  13120. * The message consists of a 4-octet header, followed by a variable
  13121. * number of 32-bit integer values, followed by a variable number
  13122. * of 8-bit character values.
  13123. *
  13124. * |31 16|15 8|7 0|
  13125. * |-----------------------------------------------------------|
  13126. * | num chars | num ints | msg type |
  13127. * |-----------------------------------------------------------|
  13128. * | int 0 |
  13129. * |-----------------------------------------------------------|
  13130. * | int 1 |
  13131. * |-----------------------------------------------------------|
  13132. * | ... |
  13133. * |-----------------------------------------------------------|
  13134. * | char 3 | char 2 | char 1 | char 0 |
  13135. * |-----------------------------------------------------------|
  13136. * | | | ... | char 4 |
  13137. * |-----------------------------------------------------------|
  13138. * - MSG_TYPE
  13139. * Bits 7:0
  13140. * Purpose: identifies this as a test message
  13141. * Value: HTT_MSG_TYPE_TEST
  13142. * - NUM_INTS
  13143. * Bits 15:8
  13144. * Purpose: indicate how many 32-bit integers follow the message header
  13145. * - NUM_CHARS
  13146. * Bits 31:16
  13147. * Purpose: indicate how many 8-bit characters follow the series of integers
  13148. */
  13149. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13150. #define HTT_RX_TEST_NUM_INTS_S 8
  13151. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13152. #define HTT_RX_TEST_NUM_CHARS_S 16
  13153. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13154. do { \
  13155. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13156. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13157. } while (0)
  13158. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13159. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13160. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13161. do { \
  13162. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13163. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13164. } while (0)
  13165. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13166. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13167. /**
  13168. * @brief target -> host packet log message
  13169. *
  13170. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13171. *
  13172. * @details
  13173. * The following field definitions describe the format of the packet log
  13174. * message sent from the target to the host.
  13175. * The message consists of a 4-octet header,followed by a variable number
  13176. * of 32-bit character values.
  13177. *
  13178. * |31 16|15 12|11 10|9 8|7 0|
  13179. * |------------------------------------------------------------------|
  13180. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13181. * |------------------------------------------------------------------|
  13182. * | payload |
  13183. * |------------------------------------------------------------------|
  13184. * - MSG_TYPE
  13185. * Bits 7:0
  13186. * Purpose: identifies this as a pktlog message
  13187. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13188. * - mac_id
  13189. * Bits 9:8
  13190. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13191. * Value: 0-3
  13192. * - pdev_id
  13193. * Bits 11:10
  13194. * Purpose: pdev_id
  13195. * Value: 0-3
  13196. * 0 (for rings at SOC level),
  13197. * 1/2/3 PDEV -> 0/1/2
  13198. * - payload_size
  13199. * Bits 31:16
  13200. * Purpose: explicitly specify the payload size
  13201. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13202. */
  13203. PREPACK struct htt_pktlog_msg {
  13204. A_UINT32 header;
  13205. A_UINT32 payload[1/* or more */];
  13206. } POSTPACK;
  13207. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13208. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13209. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13210. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13211. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13212. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13213. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13214. do { \
  13215. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13216. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13217. } while (0)
  13218. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13219. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13220. HTT_T2H_PKTLOG_MAC_ID_S)
  13221. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13222. do { \
  13223. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13224. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13225. } while (0)
  13226. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13227. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13228. HTT_T2H_PKTLOG_PDEV_ID_S)
  13229. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13230. do { \
  13231. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13232. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13233. } while (0)
  13234. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13235. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13236. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13237. /*
  13238. * Rx reorder statistics
  13239. * NB: all the fields must be defined in 4 octets size.
  13240. */
  13241. struct rx_reorder_stats {
  13242. /* Non QoS MPDUs received */
  13243. A_UINT32 deliver_non_qos;
  13244. /* MPDUs received in-order */
  13245. A_UINT32 deliver_in_order;
  13246. /* Flush due to reorder timer expired */
  13247. A_UINT32 deliver_flush_timeout;
  13248. /* Flush due to move out of window */
  13249. A_UINT32 deliver_flush_oow;
  13250. /* Flush due to DELBA */
  13251. A_UINT32 deliver_flush_delba;
  13252. /* MPDUs dropped due to FCS error */
  13253. A_UINT32 fcs_error;
  13254. /* MPDUs dropped due to monitor mode non-data packet */
  13255. A_UINT32 mgmt_ctrl;
  13256. /* Unicast-data MPDUs dropped due to invalid peer */
  13257. A_UINT32 invalid_peer;
  13258. /* MPDUs dropped due to duplication (non aggregation) */
  13259. A_UINT32 dup_non_aggr;
  13260. /* MPDUs dropped due to processed before */
  13261. A_UINT32 dup_past;
  13262. /* MPDUs dropped due to duplicate in reorder queue */
  13263. A_UINT32 dup_in_reorder;
  13264. /* Reorder timeout happened */
  13265. A_UINT32 reorder_timeout;
  13266. /* invalid bar ssn */
  13267. A_UINT32 invalid_bar_ssn;
  13268. /* reorder reset due to bar ssn */
  13269. A_UINT32 ssn_reset;
  13270. /* Flush due to delete peer */
  13271. A_UINT32 deliver_flush_delpeer;
  13272. /* Flush due to offload*/
  13273. A_UINT32 deliver_flush_offload;
  13274. /* Flush due to out of buffer*/
  13275. A_UINT32 deliver_flush_oob;
  13276. /* MPDUs dropped due to PN check fail */
  13277. A_UINT32 pn_fail;
  13278. /* MPDUs dropped due to unable to allocate memory */
  13279. A_UINT32 store_fail;
  13280. /* Number of times the tid pool alloc succeeded */
  13281. A_UINT32 tid_pool_alloc_succ;
  13282. /* Number of times the MPDU pool alloc succeeded */
  13283. A_UINT32 mpdu_pool_alloc_succ;
  13284. /* Number of times the MSDU pool alloc succeeded */
  13285. A_UINT32 msdu_pool_alloc_succ;
  13286. /* Number of times the tid pool alloc failed */
  13287. A_UINT32 tid_pool_alloc_fail;
  13288. /* Number of times the MPDU pool alloc failed */
  13289. A_UINT32 mpdu_pool_alloc_fail;
  13290. /* Number of times the MSDU pool alloc failed */
  13291. A_UINT32 msdu_pool_alloc_fail;
  13292. /* Number of times the tid pool freed */
  13293. A_UINT32 tid_pool_free;
  13294. /* Number of times the MPDU pool freed */
  13295. A_UINT32 mpdu_pool_free;
  13296. /* Number of times the MSDU pool freed */
  13297. A_UINT32 msdu_pool_free;
  13298. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13299. A_UINT32 msdu_queued;
  13300. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13301. A_UINT32 msdu_recycled;
  13302. /* Number of MPDUs with invalid peer but A2 found in AST */
  13303. A_UINT32 invalid_peer_a2_in_ast;
  13304. /* Number of MPDUs with invalid peer but A3 found in AST */
  13305. A_UINT32 invalid_peer_a3_in_ast;
  13306. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13307. A_UINT32 invalid_peer_bmc_mpdus;
  13308. /* Number of MSDUs with err attention word */
  13309. A_UINT32 rxdesc_err_att;
  13310. /* Number of MSDUs with flag of peer_idx_invalid */
  13311. A_UINT32 rxdesc_err_peer_idx_inv;
  13312. /* Number of MSDUs with flag of peer_idx_timeout */
  13313. A_UINT32 rxdesc_err_peer_idx_to;
  13314. /* Number of MSDUs with flag of overflow */
  13315. A_UINT32 rxdesc_err_ov;
  13316. /* Number of MSDUs with flag of msdu_length_err */
  13317. A_UINT32 rxdesc_err_msdu_len;
  13318. /* Number of MSDUs with flag of mpdu_length_err */
  13319. A_UINT32 rxdesc_err_mpdu_len;
  13320. /* Number of MSDUs with flag of tkip_mic_err */
  13321. A_UINT32 rxdesc_err_tkip_mic;
  13322. /* Number of MSDUs with flag of decrypt_err */
  13323. A_UINT32 rxdesc_err_decrypt;
  13324. /* Number of MSDUs with flag of fcs_err */
  13325. A_UINT32 rxdesc_err_fcs;
  13326. /* Number of Unicast (bc_mc bit is not set in attention word)
  13327. * frames with invalid peer handler
  13328. */
  13329. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13330. /* Number of unicast frame directly (direct bit is set in attention word)
  13331. * to DUT with invalid peer handler
  13332. */
  13333. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13334. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13335. * frames with invalid peer handler
  13336. */
  13337. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13338. /* Number of MSDUs dropped due to no first MSDU flag */
  13339. A_UINT32 rxdesc_no_1st_msdu;
  13340. /* Number of MSDUs dropped due to ring overflow */
  13341. A_UINT32 msdu_drop_ring_ov;
  13342. /* Number of MSDUs dropped due to FC mismatch */
  13343. A_UINT32 msdu_drop_fc_mismatch;
  13344. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13345. A_UINT32 msdu_drop_mgmt_remote_ring;
  13346. /* Number of MSDUs dropped due to errors not reported in attention word */
  13347. A_UINT32 msdu_drop_misc;
  13348. /* Number of MSDUs go to offload before reorder */
  13349. A_UINT32 offload_msdu_wal;
  13350. /* Number of data frame dropped by offload after reorder */
  13351. A_UINT32 offload_msdu_reorder;
  13352. /* Number of MPDUs with sequence number in the past and within the BA window */
  13353. A_UINT32 dup_past_within_window;
  13354. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13355. A_UINT32 dup_past_outside_window;
  13356. /* Number of MSDUs with decrypt/MIC error */
  13357. A_UINT32 rxdesc_err_decrypt_mic;
  13358. /* Number of data MSDUs received on both local and remote rings */
  13359. A_UINT32 data_msdus_on_both_rings;
  13360. /* MPDUs never filled */
  13361. A_UINT32 holes_not_filled;
  13362. };
  13363. /*
  13364. * Rx Remote buffer statistics
  13365. * NB: all the fields must be defined in 4 octets size.
  13366. */
  13367. struct rx_remote_buffer_mgmt_stats {
  13368. /* Total number of MSDUs reaped for Rx processing */
  13369. A_UINT32 remote_reaped;
  13370. /* MSDUs recycled within firmware */
  13371. A_UINT32 remote_recycled;
  13372. /* MSDUs stored by Data Rx */
  13373. A_UINT32 data_rx_msdus_stored;
  13374. /* Number of HTT indications from WAL Rx MSDU */
  13375. A_UINT32 wal_rx_ind;
  13376. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13377. A_UINT32 wal_rx_ind_unconsumed;
  13378. /* Number of HTT indications from Data Rx MSDU */
  13379. A_UINT32 data_rx_ind;
  13380. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13381. A_UINT32 data_rx_ind_unconsumed;
  13382. /* Number of HTT indications from ATHBUF */
  13383. A_UINT32 athbuf_rx_ind;
  13384. /* Number of remote buffers requested for refill */
  13385. A_UINT32 refill_buf_req;
  13386. /* Number of remote buffers filled by the host */
  13387. A_UINT32 refill_buf_rsp;
  13388. /* Number of times MAC hw_index = f/w write_index */
  13389. A_INT32 mac_no_bufs;
  13390. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13391. A_INT32 fw_indices_equal;
  13392. /* Number of times f/w finds no buffers to post */
  13393. A_INT32 host_no_bufs;
  13394. };
  13395. /*
  13396. * TXBF MU/SU packets and NDPA statistics
  13397. * NB: all the fields must be defined in 4 octets size.
  13398. */
  13399. struct rx_txbf_musu_ndpa_pkts_stats {
  13400. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13401. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13402. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13403. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13404. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13405. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13406. };
  13407. /*
  13408. * htt_dbg_stats_status -
  13409. * present - The requested stats have been delivered in full.
  13410. * This indicates that either the stats information was contained
  13411. * in its entirety within this message, or else this message
  13412. * completes the delivery of the requested stats info that was
  13413. * partially delivered through earlier STATS_CONF messages.
  13414. * partial - The requested stats have been delivered in part.
  13415. * One or more subsequent STATS_CONF messages with the same
  13416. * cookie value will be sent to deliver the remainder of the
  13417. * information.
  13418. * error - The requested stats could not be delivered, for example due
  13419. * to a shortage of memory to construct a message holding the
  13420. * requested stats.
  13421. * invalid - The requested stat type is either not recognized, or the
  13422. * target is configured to not gather the stats type in question.
  13423. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13424. * series_done - This special value indicates that no further stats info
  13425. * elements are present within a series of stats info elems
  13426. * (within a stats upload confirmation message).
  13427. */
  13428. enum htt_dbg_stats_status {
  13429. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13430. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13431. HTT_DBG_STATS_STATUS_ERROR = 2,
  13432. HTT_DBG_STATS_STATUS_INVALID = 3,
  13433. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13434. };
  13435. /**
  13436. * @brief target -> host statistics upload
  13437. *
  13438. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13439. *
  13440. * @details
  13441. * The following field definitions describe the format of the HTT target
  13442. * to host stats upload confirmation message.
  13443. * The message contains a cookie echoed from the HTT host->target stats
  13444. * upload request, which identifies which request the confirmation is
  13445. * for, and a series of tag-length-value stats information elements.
  13446. * The tag-length header for each stats info element also includes a
  13447. * status field, to indicate whether the request for the stat type in
  13448. * question was fully met, partially met, unable to be met, or invalid
  13449. * (if the stat type in question is disabled in the target).
  13450. * A special value of all 1's in this status field is used to indicate
  13451. * the end of the series of stats info elements.
  13452. *
  13453. *
  13454. * |31 16|15 8|7 5|4 0|
  13455. * |------------------------------------------------------------|
  13456. * | reserved | msg type |
  13457. * |------------------------------------------------------------|
  13458. * | cookie LSBs |
  13459. * |------------------------------------------------------------|
  13460. * | cookie MSBs |
  13461. * |------------------------------------------------------------|
  13462. * | stats entry length | reserved | S |stat type|
  13463. * |------------------------------------------------------------|
  13464. * | |
  13465. * | type-specific stats info |
  13466. * | |
  13467. * |------------------------------------------------------------|
  13468. * | stats entry length | reserved | S |stat type|
  13469. * |------------------------------------------------------------|
  13470. * | |
  13471. * | type-specific stats info |
  13472. * | |
  13473. * |------------------------------------------------------------|
  13474. * | n/a | reserved | 111 | n/a |
  13475. * |------------------------------------------------------------|
  13476. * Header fields:
  13477. * - MSG_TYPE
  13478. * Bits 7:0
  13479. * Purpose: identifies this is a statistics upload confirmation message
  13480. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13481. * - COOKIE_LSBS
  13482. * Bits 31:0
  13483. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13484. * message with its preceding host->target stats request message.
  13485. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13486. * - COOKIE_MSBS
  13487. * Bits 31:0
  13488. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13489. * message with its preceding host->target stats request message.
  13490. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13491. *
  13492. * Stats Information Element tag-length header fields:
  13493. * - STAT_TYPE
  13494. * Bits 4:0
  13495. * Purpose: identifies the type of statistics info held in the
  13496. * following information element
  13497. * Value: htt_dbg_stats_type
  13498. * - STATUS
  13499. * Bits 7:5
  13500. * Purpose: indicate whether the requested stats are present
  13501. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13502. * the completion of the stats entry series
  13503. * - LENGTH
  13504. * Bits 31:16
  13505. * Purpose: indicate the stats information size
  13506. * Value: This field specifies the number of bytes of stats information
  13507. * that follows the element tag-length header.
  13508. * It is expected but not required that this length is a multiple of
  13509. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13510. * subsequent stats entry header will begin on a 4-byte aligned
  13511. * boundary.
  13512. */
  13513. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13514. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13515. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13516. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13517. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13518. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13519. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13520. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13521. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13522. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13523. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13524. do { \
  13525. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13526. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13527. } while (0)
  13528. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13529. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13530. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13531. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13532. do { \
  13533. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13534. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13535. } while (0)
  13536. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13537. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13538. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13539. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13540. do { \
  13541. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13542. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13543. } while (0)
  13544. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13545. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13546. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13547. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13548. #define HTT_MAX_AGGR 64
  13549. #define HTT_HL_MAX_AGGR 18
  13550. /**
  13551. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13552. *
  13553. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13554. *
  13555. * @details
  13556. * The following field definitions describe the format of the HTT host
  13557. * to target frag_desc/msdu_ext bank configuration message.
  13558. * The message contains the based address and the min and max id of the
  13559. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13560. * MSDU_EXT/FRAG_DESC.
  13561. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13562. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13563. * the hardware does the mapping/translation.
  13564. *
  13565. * Total banks that can be configured is configured to 16.
  13566. *
  13567. * This should be called before any TX has be initiated by the HTT
  13568. *
  13569. * |31 16|15 8|7 5|4 0|
  13570. * |------------------------------------------------------------|
  13571. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13572. * |------------------------------------------------------------|
  13573. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13574. #if HTT_PADDR64
  13575. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13576. #endif
  13577. * |------------------------------------------------------------|
  13578. * | ... |
  13579. * |------------------------------------------------------------|
  13580. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13581. #if HTT_PADDR64
  13582. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13583. #endif
  13584. * |------------------------------------------------------------|
  13585. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13586. * |------------------------------------------------------------|
  13587. * | ... |
  13588. * |------------------------------------------------------------|
  13589. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13590. * |------------------------------------------------------------|
  13591. * Header fields:
  13592. * - MSG_TYPE
  13593. * Bits 7:0
  13594. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13595. * for systems with 64-bit format for bus addresses:
  13596. * - BANKx_BASE_ADDRESS_LO
  13597. * Bits 31:0
  13598. * Purpose: Provide a mechanism to specify the base address of the
  13599. * MSDU_EXT bank physical/bus address.
  13600. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13601. * - BANKx_BASE_ADDRESS_HI
  13602. * Bits 31:0
  13603. * Purpose: Provide a mechanism to specify the base address of the
  13604. * MSDU_EXT bank physical/bus address.
  13605. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13606. * for systems with 32-bit format for bus addresses:
  13607. * - BANKx_BASE_ADDRESS
  13608. * Bits 31:0
  13609. * Purpose: Provide a mechanism to specify the base address of the
  13610. * MSDU_EXT bank physical/bus address.
  13611. * Value: MSDU_EXT bank physical / bus address
  13612. * - BANKx_MIN_ID
  13613. * Bits 15:0
  13614. * Purpose: Provide a mechanism to specify the min index that needs to
  13615. * mapped.
  13616. * - BANKx_MAX_ID
  13617. * Bits 31:16
  13618. * Purpose: Provide a mechanism to specify the max index that needs to
  13619. * mapped.
  13620. *
  13621. */
  13622. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13623. * safe value.
  13624. * @note MAX supported banks is 16.
  13625. */
  13626. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13627. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13628. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13629. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13630. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13631. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13632. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13633. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13634. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13635. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13636. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13637. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13638. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13639. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13640. do { \
  13641. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13642. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13643. } while (0)
  13644. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13645. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13646. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13647. do { \
  13648. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13649. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13650. } while (0)
  13651. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13652. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13653. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13654. do { \
  13655. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13656. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13657. } while (0)
  13658. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13659. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13660. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13661. do { \
  13662. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13663. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13664. } while (0)
  13665. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13666. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13667. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13668. do { \
  13669. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13670. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13671. } while (0)
  13672. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13673. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13674. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13675. do { \
  13676. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13677. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13678. } while (0)
  13679. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13680. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13681. /*
  13682. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13683. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13684. * addresses are stored in a XXX-bit field.
  13685. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13686. * htt_tx_frag_desc64_bank_cfg_t structs.
  13687. */
  13688. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13689. _paddr_bits_, \
  13690. _paddr__bank_base_address_) \
  13691. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13692. /** word 0 \
  13693. * msg_type: 8, \
  13694. * pdev_id: 2, \
  13695. * swap: 1, \
  13696. * reserved0: 5, \
  13697. * num_banks: 8, \
  13698. * desc_size: 8; \
  13699. */ \
  13700. A_UINT32 word0; \
  13701. /* \
  13702. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13703. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13704. * the second A_UINT32). \
  13705. */ \
  13706. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13707. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13708. } POSTPACK
  13709. /* define htt_tx_frag_desc32_bank_cfg_t */
  13710. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13711. /* define htt_tx_frag_desc64_bank_cfg_t */
  13712. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13713. /*
  13714. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13715. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13716. */
  13717. #if HTT_PADDR64
  13718. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13719. #else
  13720. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13721. #endif
  13722. /**
  13723. * @brief target -> host HTT TX Credit total count update message definition
  13724. *
  13725. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13726. *
  13727. *|31 16|15|14 9| 8 |7 0 |
  13728. *|---------------------+--+----------+-------+----------|
  13729. *|cur htt credit delta | Q| reserved | sign | msg type |
  13730. *|------------------------------------------------------|
  13731. *
  13732. * Header fields:
  13733. * - MSG_TYPE
  13734. * Bits 7:0
  13735. * Purpose: identifies this as a htt tx credit delta update message
  13736. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13737. * - SIGN
  13738. * Bits 8
  13739. * identifies whether credit delta is positive or negative
  13740. * Value:
  13741. * - 0x0: credit delta is positive, rebalance in some buffers
  13742. * - 0x1: credit delta is negative, rebalance out some buffers
  13743. * - reserved
  13744. * Bits 14:9
  13745. * Value: 0x0
  13746. * - TXQ_GRP
  13747. * Bit 15
  13748. * Purpose: indicates whether any tx queue group information elements
  13749. * are appended to the tx credit update message
  13750. * Value: 0 -> no tx queue group information element is present
  13751. * 1 -> a tx queue group information element immediately follows
  13752. * - DELTA_COUNT
  13753. * Bits 31:16
  13754. * Purpose: Specify current htt credit delta absolute count
  13755. */
  13756. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13757. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13758. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13759. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13760. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13761. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13762. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13763. do { \
  13764. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13765. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13766. } while (0)
  13767. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13768. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13769. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13770. do { \
  13771. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13772. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13773. } while (0)
  13774. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13775. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13776. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13777. do { \
  13778. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13779. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13780. } while (0)
  13781. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13782. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13783. #define HTT_TX_CREDIT_MSG_BYTES 4
  13784. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13785. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13786. /**
  13787. * @brief HTT WDI_IPA Operation Response Message
  13788. *
  13789. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13790. *
  13791. * @details
  13792. * HTT WDI_IPA Operation Response message is sent by target
  13793. * to host confirming suspend or resume operation.
  13794. * |31 24|23 16|15 8|7 0|
  13795. * |----------------+----------------+----------------+----------------|
  13796. * | op_code | Rsvd | msg_type |
  13797. * |-------------------------------------------------------------------|
  13798. * | Rsvd | Response len |
  13799. * |-------------------------------------------------------------------|
  13800. * | |
  13801. * | Response-type specific info |
  13802. * | |
  13803. * | |
  13804. * |-------------------------------------------------------------------|
  13805. * Header fields:
  13806. * - MSG_TYPE
  13807. * Bits 7:0
  13808. * Purpose: Identifies this as WDI_IPA Operation Response message
  13809. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13810. * - OP_CODE
  13811. * Bits 31:16
  13812. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13813. * value: = enum htt_wdi_ipa_op_code
  13814. * - RSP_LEN
  13815. * Bits 16:0
  13816. * Purpose: length for the response-type specific info
  13817. * value: = length in bytes for response-type specific info
  13818. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13819. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13820. */
  13821. PREPACK struct htt_wdi_ipa_op_response_t
  13822. {
  13823. /* DWORD 0: flags and meta-data */
  13824. A_UINT32
  13825. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13826. reserved1: 8,
  13827. op_code: 16;
  13828. A_UINT32
  13829. rsp_len: 16,
  13830. reserved2: 16;
  13831. } POSTPACK;
  13832. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13833. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13834. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13835. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13836. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13837. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13838. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13839. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13840. do { \
  13841. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13842. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13843. } while (0)
  13844. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13845. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13846. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13847. do { \
  13848. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13849. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13850. } while (0)
  13851. enum htt_phy_mode {
  13852. htt_phy_mode_11a = 0,
  13853. htt_phy_mode_11g = 1,
  13854. htt_phy_mode_11b = 2,
  13855. htt_phy_mode_11g_only = 3,
  13856. htt_phy_mode_11na_ht20 = 4,
  13857. htt_phy_mode_11ng_ht20 = 5,
  13858. htt_phy_mode_11na_ht40 = 6,
  13859. htt_phy_mode_11ng_ht40 = 7,
  13860. htt_phy_mode_11ac_vht20 = 8,
  13861. htt_phy_mode_11ac_vht40 = 9,
  13862. htt_phy_mode_11ac_vht80 = 10,
  13863. htt_phy_mode_11ac_vht20_2g = 11,
  13864. htt_phy_mode_11ac_vht40_2g = 12,
  13865. htt_phy_mode_11ac_vht80_2g = 13,
  13866. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13867. htt_phy_mode_11ac_vht160 = 15,
  13868. htt_phy_mode_max,
  13869. };
  13870. /**
  13871. * @brief target -> host HTT channel change indication
  13872. *
  13873. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13874. *
  13875. * @details
  13876. * Specify when a channel change occurs.
  13877. * This allows the host to precisely determine which rx frames arrived
  13878. * on the old channel and which rx frames arrived on the new channel.
  13879. *
  13880. *|31 |7 0 |
  13881. *|-------------------------------------------+----------|
  13882. *| reserved | msg type |
  13883. *|------------------------------------------------------|
  13884. *| primary_chan_center_freq_mhz |
  13885. *|------------------------------------------------------|
  13886. *| contiguous_chan1_center_freq_mhz |
  13887. *|------------------------------------------------------|
  13888. *| contiguous_chan2_center_freq_mhz |
  13889. *|------------------------------------------------------|
  13890. *| phy_mode |
  13891. *|------------------------------------------------------|
  13892. *
  13893. * Header fields:
  13894. * - MSG_TYPE
  13895. * Bits 7:0
  13896. * Purpose: identifies this as a htt channel change indication message
  13897. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13898. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13899. * Bits 31:0
  13900. * Purpose: identify the (center of the) new 20 MHz primary channel
  13901. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13902. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13903. * Bits 31:0
  13904. * Purpose: identify the (center of the) contiguous frequency range
  13905. * comprising the new channel.
  13906. * For example, if the new channel is a 80 MHz channel extending
  13907. * 60 MHz beyond the primary channel, this field would be 30 larger
  13908. * than the primary channel center frequency field.
  13909. * Value: center frequency of the contiguous frequency range comprising
  13910. * the full channel in MHz units
  13911. * (80+80 channels also use the CONTIG_CHAN2 field)
  13912. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13913. * Bits 31:0
  13914. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13915. * within a VHT 80+80 channel.
  13916. * This field is only relevant for VHT 80+80 channels.
  13917. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13918. * channel (arbitrary value for cases besides VHT 80+80)
  13919. * - PHY_MODE
  13920. * Bits 31:0
  13921. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13922. * and band
  13923. * Value: htt_phy_mode enum value
  13924. */
  13925. PREPACK struct htt_chan_change_t
  13926. {
  13927. /* DWORD 0: flags and meta-data */
  13928. A_UINT32
  13929. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13930. reserved1: 24;
  13931. A_UINT32 primary_chan_center_freq_mhz;
  13932. A_UINT32 contig_chan1_center_freq_mhz;
  13933. A_UINT32 contig_chan2_center_freq_mhz;
  13934. A_UINT32 phy_mode;
  13935. } POSTPACK;
  13936. /*
  13937. * Due to historical / backwards-compatibility reasons, maintain the
  13938. * below htt_chan_change_msg struct definition, which needs to be
  13939. * consistent with the above htt_chan_change_t struct definition
  13940. * (aside from the htt_chan_change_t definition including the msg_type
  13941. * dword within the message, and the htt_chan_change_msg only containing
  13942. * the payload of the message that follows the msg_type dword).
  13943. */
  13944. PREPACK struct htt_chan_change_msg {
  13945. A_UINT32 chan_mhz; /* frequency in mhz */
  13946. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13947. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13948. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13949. } POSTPACK;
  13950. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13951. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13952. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13953. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13954. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13955. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13956. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13957. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13958. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13959. do { \
  13960. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13961. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13962. } while (0)
  13963. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13964. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13965. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13966. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13967. do { \
  13968. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13969. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13970. } while (0)
  13971. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13972. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13973. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13974. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13975. do { \
  13976. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13977. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13978. } while (0)
  13979. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13980. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13981. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13982. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13983. do { \
  13984. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13985. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13986. } while (0)
  13987. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13988. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13989. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13990. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13991. /**
  13992. * @brief rx offload packet error message
  13993. *
  13994. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13995. *
  13996. * @details
  13997. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13998. * of target payload like mic err.
  13999. *
  14000. * |31 24|23 16|15 8|7 0|
  14001. * |----------------+----------------+----------------+----------------|
  14002. * | tid | vdev_id | msg_sub_type | msg_type |
  14003. * |-------------------------------------------------------------------|
  14004. * : (sub-type dependent content) :
  14005. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14006. * Header fields:
  14007. * - msg_type
  14008. * Bits 7:0
  14009. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14010. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14011. * - msg_sub_type
  14012. * Bits 15:8
  14013. * Purpose: Identifies which type of rx error is reported by this message
  14014. * value: htt_rx_ofld_pkt_err_type
  14015. * - vdev_id
  14016. * Bits 23:16
  14017. * Purpose: Identifies which vdev received the erroneous rx frame
  14018. * value:
  14019. * - tid
  14020. * Bits 31:24
  14021. * Purpose: Identifies the traffic type of the rx frame
  14022. * value:
  14023. *
  14024. * - The payload fields used if the sub-type == MIC error are shown below.
  14025. * Note - MIC err is per MSDU, while PN is per MPDU.
  14026. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14027. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14028. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14029. * instead of sending separate HTT messages for each wrong MSDU within
  14030. * the MPDU.
  14031. *
  14032. * |31 24|23 16|15 8|7 0|
  14033. * |----------------+----------------+----------------+----------------|
  14034. * | Rsvd | key_id | peer_id |
  14035. * |-------------------------------------------------------------------|
  14036. * | receiver MAC addr 31:0 |
  14037. * |-------------------------------------------------------------------|
  14038. * | Rsvd | receiver MAC addr 47:32 |
  14039. * |-------------------------------------------------------------------|
  14040. * | transmitter MAC addr 31:0 |
  14041. * |-------------------------------------------------------------------|
  14042. * | Rsvd | transmitter MAC addr 47:32 |
  14043. * |-------------------------------------------------------------------|
  14044. * | PN 31:0 |
  14045. * |-------------------------------------------------------------------|
  14046. * | Rsvd | PN 47:32 |
  14047. * |-------------------------------------------------------------------|
  14048. * - peer_id
  14049. * Bits 15:0
  14050. * Purpose: identifies which peer is frame is from
  14051. * value:
  14052. * - key_id
  14053. * Bits 23:16
  14054. * Purpose: identifies key_id of rx frame
  14055. * value:
  14056. * - RA_31_0 (receiver MAC addr 31:0)
  14057. * Bits 31:0
  14058. * Purpose: identifies by MAC address which vdev received the frame
  14059. * value: MAC address lower 4 bytes
  14060. * - RA_47_32 (receiver MAC addr 47:32)
  14061. * Bits 15:0
  14062. * Purpose: identifies by MAC address which vdev received the frame
  14063. * value: MAC address upper 2 bytes
  14064. * - TA_31_0 (transmitter MAC addr 31:0)
  14065. * Bits 31:0
  14066. * Purpose: identifies by MAC address which peer transmitted the frame
  14067. * value: MAC address lower 4 bytes
  14068. * - TA_47_32 (transmitter MAC addr 47:32)
  14069. * Bits 15:0
  14070. * Purpose: identifies by MAC address which peer transmitted the frame
  14071. * value: MAC address upper 2 bytes
  14072. * - PN_31_0
  14073. * Bits 31:0
  14074. * Purpose: Identifies pn of rx frame
  14075. * value: PN lower 4 bytes
  14076. * - PN_47_32
  14077. * Bits 15:0
  14078. * Purpose: Identifies pn of rx frame
  14079. * value:
  14080. * TKIP or CCMP: PN upper 2 bytes
  14081. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14082. */
  14083. enum htt_rx_ofld_pkt_err_type {
  14084. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14085. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14086. };
  14087. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14088. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14089. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14090. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14091. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14092. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14093. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14094. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14095. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14096. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14097. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14098. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14099. do { \
  14100. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14101. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14102. } while (0)
  14103. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14104. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14105. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14106. do { \
  14107. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14108. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14109. } while (0)
  14110. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14111. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14112. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14113. do { \
  14114. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14115. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14116. } while (0)
  14117. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14118. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14119. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14120. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14121. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14122. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14123. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14124. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14125. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14126. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14127. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14128. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14129. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14130. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14131. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14132. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14133. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14134. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14135. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14136. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14137. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14138. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14139. do { \
  14140. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14141. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14142. } while (0)
  14143. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14144. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14145. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14146. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14147. do { \
  14148. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14149. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14150. } while (0)
  14151. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14152. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14153. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14154. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14155. do { \
  14156. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14157. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14158. } while (0)
  14159. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14160. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14161. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14162. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14163. do { \
  14164. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14165. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14166. } while (0)
  14167. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14168. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14169. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14170. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14171. do { \
  14172. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14173. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14174. } while (0)
  14175. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14176. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14177. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14178. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14179. do { \
  14180. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14181. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14182. } while (0)
  14183. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14184. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14185. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14186. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14187. do { \
  14188. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14189. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14190. } while (0)
  14191. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14192. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14193. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14194. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14195. do { \
  14196. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14197. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14198. } while (0)
  14199. /**
  14200. * @brief target -> host peer rate report message
  14201. *
  14202. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14203. *
  14204. * @details
  14205. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14206. * justified rate of all the peers.
  14207. *
  14208. * |31 24|23 16|15 8|7 0|
  14209. * |----------------+----------------+----------------+----------------|
  14210. * | peer_count | | msg_type |
  14211. * |-------------------------------------------------------------------|
  14212. * : Payload (variant number of peer rate report) :
  14213. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14214. * Header fields:
  14215. * - msg_type
  14216. * Bits 7:0
  14217. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14218. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14219. * - reserved
  14220. * Bits 15:8
  14221. * Purpose:
  14222. * value:
  14223. * - peer_count
  14224. * Bits 31:16
  14225. * Purpose: Specify how many peer rate report elements are present in the payload.
  14226. * value:
  14227. *
  14228. * Payload:
  14229. * There are variant number of peer rate report follow the first 32 bits.
  14230. * The peer rate report is defined as follows.
  14231. *
  14232. * |31 20|19 16|15 0|
  14233. * |-----------------------+---------+---------------------------------|-
  14234. * | reserved | phy | peer_id | \
  14235. * |-------------------------------------------------------------------| -> report #0
  14236. * | rate | /
  14237. * |-----------------------+---------+---------------------------------|-
  14238. * | reserved | phy | peer_id | \
  14239. * |-------------------------------------------------------------------| -> report #1
  14240. * | rate | /
  14241. * |-----------------------+---------+---------------------------------|-
  14242. * | reserved | phy | peer_id | \
  14243. * |-------------------------------------------------------------------| -> report #2
  14244. * | rate | /
  14245. * |-------------------------------------------------------------------|-
  14246. * : :
  14247. * : :
  14248. * : :
  14249. * :-------------------------------------------------------------------:
  14250. *
  14251. * - peer_id
  14252. * Bits 15:0
  14253. * Purpose: identify the peer
  14254. * value:
  14255. * - phy
  14256. * Bits 19:16
  14257. * Purpose: identify which phy is in use
  14258. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14259. * Please see enum htt_peer_report_phy_type for detail.
  14260. * - reserved
  14261. * Bits 31:20
  14262. * Purpose:
  14263. * value:
  14264. * - rate
  14265. * Bits 31:0
  14266. * Purpose: represent the justified rate of the peer specified by peer_id
  14267. * value:
  14268. */
  14269. enum htt_peer_rate_report_phy_type {
  14270. HTT_PEER_RATE_REPORT_11B = 0,
  14271. HTT_PEER_RATE_REPORT_11A_G,
  14272. HTT_PEER_RATE_REPORT_11N,
  14273. HTT_PEER_RATE_REPORT_11AC,
  14274. };
  14275. #define HTT_PEER_RATE_REPORT_SIZE 8
  14276. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14277. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14278. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14279. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14280. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14281. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14282. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14283. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14284. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14285. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14286. do { \
  14287. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14288. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14289. } while (0)
  14290. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14291. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14292. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14293. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14294. do { \
  14295. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14296. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14297. } while (0)
  14298. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14299. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14300. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14301. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14302. do { \
  14303. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14304. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14305. } while (0)
  14306. /**
  14307. * @brief target -> host flow pool map message
  14308. *
  14309. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14310. *
  14311. * @details
  14312. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14313. * a flow of descriptors.
  14314. *
  14315. * This message is in TLV format and indicates the parameters to be setup a
  14316. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14317. * receive descriptors from a specified pool.
  14318. *
  14319. * The message would appear as follows:
  14320. *
  14321. * |31 24|23 16|15 8|7 0|
  14322. * |----------------+----------------+----------------+----------------|
  14323. * header | reserved | num_flows | msg_type |
  14324. * |-------------------------------------------------------------------|
  14325. * | |
  14326. * : payload :
  14327. * | |
  14328. * |-------------------------------------------------------------------|
  14329. *
  14330. * The header field is one DWORD long and is interpreted as follows:
  14331. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14332. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14333. * this message
  14334. * b'16-31 - reserved: These bits are reserved for future use
  14335. *
  14336. * Payload:
  14337. * The payload would contain multiple objects of the following structure. Each
  14338. * object represents a flow.
  14339. *
  14340. * |31 24|23 16|15 8|7 0|
  14341. * |----------------+----------------+----------------+----------------|
  14342. * header | reserved | num_flows | msg_type |
  14343. * |-------------------------------------------------------------------|
  14344. * payload0| flow_type |
  14345. * |-------------------------------------------------------------------|
  14346. * | flow_id |
  14347. * |-------------------------------------------------------------------|
  14348. * | reserved0 | flow_pool_id |
  14349. * |-------------------------------------------------------------------|
  14350. * | reserved1 | flow_pool_size |
  14351. * |-------------------------------------------------------------------|
  14352. * | reserved2 |
  14353. * |-------------------------------------------------------------------|
  14354. * payload1| flow_type |
  14355. * |-------------------------------------------------------------------|
  14356. * | flow_id |
  14357. * |-------------------------------------------------------------------|
  14358. * | reserved0 | flow_pool_id |
  14359. * |-------------------------------------------------------------------|
  14360. * | reserved1 | flow_pool_size |
  14361. * |-------------------------------------------------------------------|
  14362. * | reserved2 |
  14363. * |-------------------------------------------------------------------|
  14364. * | . |
  14365. * | . |
  14366. * | . |
  14367. * |-------------------------------------------------------------------|
  14368. *
  14369. * Each payload is 5 DWORDS long and is interpreted as follows:
  14370. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14371. * this flow is associated. It can be VDEV, peer,
  14372. * or tid (AC). Based on enum htt_flow_type.
  14373. *
  14374. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14375. * object. For flow_type vdev it is set to the
  14376. * vdevid, for peer it is peerid and for tid, it is
  14377. * tid_num.
  14378. *
  14379. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14380. * in the host for this flow
  14381. * b'16:31 - reserved0: This field in reserved for the future. In case
  14382. * we have a hierarchical implementation (HCM) of
  14383. * pools, it can be used to indicate the ID of the
  14384. * parent-pool.
  14385. *
  14386. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14387. * Descriptors for this flow will be
  14388. * allocated from this pool in the host.
  14389. * b'16:31 - reserved1: This field in reserved for the future. In case
  14390. * we have a hierarchical implementation of pools,
  14391. * it can be used to indicate the max number of
  14392. * descriptors in the pool. The b'0:15 can be used
  14393. * to indicate min number of descriptors in the
  14394. * HCM scheme.
  14395. *
  14396. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14397. * we have a hierarchical implementation of pools,
  14398. * b'0:15 can be used to indicate the
  14399. * priority-based borrowing (PBB) threshold of
  14400. * the flow's pool. The b'16:31 are still left
  14401. * reserved.
  14402. */
  14403. enum htt_flow_type {
  14404. FLOW_TYPE_VDEV = 0,
  14405. /* Insert new flow types above this line */
  14406. };
  14407. PREPACK struct htt_flow_pool_map_payload_t {
  14408. A_UINT32 flow_type;
  14409. A_UINT32 flow_id;
  14410. A_UINT32 flow_pool_id:16,
  14411. reserved0:16;
  14412. A_UINT32 flow_pool_size:16,
  14413. reserved1:16;
  14414. A_UINT32 reserved2;
  14415. } POSTPACK;
  14416. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14417. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14418. (sizeof(struct htt_flow_pool_map_payload_t))
  14419. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14420. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14421. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14422. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14423. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14424. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14425. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14426. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14427. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14428. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14429. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14430. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14431. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14432. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14433. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14434. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14435. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14436. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14437. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14438. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14439. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14440. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14441. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14442. do { \
  14443. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14444. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14445. } while (0)
  14446. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14447. do { \
  14448. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14449. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14450. } while (0)
  14451. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14452. do { \
  14453. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14454. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14455. } while (0)
  14456. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14457. do { \
  14458. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14459. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14460. } while (0)
  14461. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14462. do { \
  14463. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14464. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14465. } while (0)
  14466. /**
  14467. * @brief target -> host flow pool unmap message
  14468. *
  14469. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14470. *
  14471. * @details
  14472. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14473. * down a flow of descriptors.
  14474. * This message indicates that for the flow (whose ID is provided) is wanting
  14475. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14476. * pool of descriptors from where descriptors are being allocated for this
  14477. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14478. * be unmapped by the host.
  14479. *
  14480. * The message would appear as follows:
  14481. *
  14482. * |31 24|23 16|15 8|7 0|
  14483. * |----------------+----------------+----------------+----------------|
  14484. * | reserved0 | msg_type |
  14485. * |-------------------------------------------------------------------|
  14486. * | flow_type |
  14487. * |-------------------------------------------------------------------|
  14488. * | flow_id |
  14489. * |-------------------------------------------------------------------|
  14490. * | reserved1 | flow_pool_id |
  14491. * |-------------------------------------------------------------------|
  14492. *
  14493. * The message is interpreted as follows:
  14494. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14495. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14496. * b'8:31 - reserved0: Reserved for future use
  14497. *
  14498. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14499. * this flow is associated. It can be VDEV, peer,
  14500. * or tid (AC). Based on enum htt_flow_type.
  14501. *
  14502. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14503. * object. For flow_type vdev it is set to the
  14504. * vdevid, for peer it is peerid and for tid, it is
  14505. * tid_num.
  14506. *
  14507. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14508. * used in the host for this flow
  14509. * b'16:31 - reserved0: This field in reserved for the future.
  14510. *
  14511. */
  14512. PREPACK struct htt_flow_pool_unmap_t {
  14513. A_UINT32 msg_type:8,
  14514. reserved0:24;
  14515. A_UINT32 flow_type;
  14516. A_UINT32 flow_id;
  14517. A_UINT32 flow_pool_id:16,
  14518. reserved1:16;
  14519. } POSTPACK;
  14520. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14521. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14522. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14523. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14524. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14525. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14526. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14527. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14528. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14529. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14530. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14531. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14532. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14533. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14534. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14535. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14536. do { \
  14537. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14538. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14539. } while (0)
  14540. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14541. do { \
  14542. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14543. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14544. } while (0)
  14545. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14546. do { \
  14547. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14548. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14549. } while (0)
  14550. /**
  14551. * @brief target -> host SRING setup done message
  14552. *
  14553. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14554. *
  14555. * @details
  14556. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14557. * SRNG ring setup is done
  14558. *
  14559. * This message indicates whether the last setup operation is successful.
  14560. * It will be sent to host when host set respose_required bit in
  14561. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14562. * The message would appear as follows:
  14563. *
  14564. * |31 24|23 16|15 8|7 0|
  14565. * |--------------- +----------------+----------------+----------------|
  14566. * | setup_status | ring_id | pdev_id | msg_type |
  14567. * |-------------------------------------------------------------------|
  14568. *
  14569. * The message is interpreted as follows:
  14570. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14571. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14572. * b'8:15 - pdev_id:
  14573. * 0 (for rings at SOC/UMAC level),
  14574. * 1/2/3 mac id (for rings at LMAC level)
  14575. * b'16:23 - ring_id: Identify the ring which is set up
  14576. * More details can be got from enum htt_srng_ring_id
  14577. * b'24:31 - setup_status: Indicate status of setup operation
  14578. * Refer to htt_ring_setup_status
  14579. */
  14580. PREPACK struct htt_sring_setup_done_t {
  14581. A_UINT32 msg_type: 8,
  14582. pdev_id: 8,
  14583. ring_id: 8,
  14584. setup_status: 8;
  14585. } POSTPACK;
  14586. enum htt_ring_setup_status {
  14587. htt_ring_setup_status_ok = 0,
  14588. htt_ring_setup_status_error,
  14589. };
  14590. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14591. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14592. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14593. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14594. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14595. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14596. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14597. do { \
  14598. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14599. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14600. } while (0)
  14601. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14602. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14603. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14604. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14605. HTT_SRING_SETUP_DONE_RING_ID_S)
  14606. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14607. do { \
  14608. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14609. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14610. } while (0)
  14611. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14612. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14613. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14614. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14615. HTT_SRING_SETUP_DONE_STATUS_S)
  14616. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14617. do { \
  14618. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14619. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14620. } while (0)
  14621. /**
  14622. * @brief target -> flow map flow info
  14623. *
  14624. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14625. *
  14626. * @details
  14627. * HTT TX map flow entry with tqm flow pointer
  14628. * Sent from firmware to host to add tqm flow pointer in corresponding
  14629. * flow search entry. Flow metadata is replayed back to host as part of this
  14630. * struct to enable host to find the specific flow search entry
  14631. *
  14632. * The message would appear as follows:
  14633. *
  14634. * |31 28|27 18|17 14|13 8|7 0|
  14635. * |-------+------------------------------------------+----------------|
  14636. * | rsvd0 | fse_hsh_idx | msg_type |
  14637. * |-------------------------------------------------------------------|
  14638. * | rsvd1 | tid | peer_id |
  14639. * |-------------------------------------------------------------------|
  14640. * | tqm_flow_pntr_lo |
  14641. * |-------------------------------------------------------------------|
  14642. * | tqm_flow_pntr_hi |
  14643. * |-------------------------------------------------------------------|
  14644. * | fse_meta_data |
  14645. * |-------------------------------------------------------------------|
  14646. *
  14647. * The message is interpreted as follows:
  14648. *
  14649. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14650. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14651. *
  14652. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14653. * for this flow entry
  14654. *
  14655. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14656. *
  14657. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14658. *
  14659. * dword1 - b'14:17 - tid
  14660. *
  14661. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14662. *
  14663. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14664. *
  14665. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14666. *
  14667. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14668. * given by host
  14669. */
  14670. PREPACK struct htt_tx_map_flow_info {
  14671. A_UINT32
  14672. msg_type: 8,
  14673. fse_hsh_idx: 20,
  14674. rsvd0: 4;
  14675. A_UINT32
  14676. peer_id: 14,
  14677. tid: 4,
  14678. rsvd1: 14;
  14679. A_UINT32 tqm_flow_pntr_lo;
  14680. A_UINT32 tqm_flow_pntr_hi;
  14681. struct htt_tx_flow_metadata fse_meta_data;
  14682. } POSTPACK;
  14683. /* DWORD 0 */
  14684. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14685. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14686. /* DWORD 1 */
  14687. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14688. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14689. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14690. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14691. /* DWORD 0 */
  14692. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14693. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14694. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14695. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14696. do { \
  14697. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14698. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14699. } while (0)
  14700. /* DWORD 1 */
  14701. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14702. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14703. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14704. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14705. do { \
  14706. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14707. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14708. } while (0)
  14709. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14710. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14711. HTT_TX_MAP_FLOW_INFO_TID_S)
  14712. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14713. do { \
  14714. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14715. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14716. } while (0)
  14717. /*
  14718. * htt_dbg_ext_stats_status -
  14719. * present - The requested stats have been delivered in full.
  14720. * This indicates that either the stats information was contained
  14721. * in its entirety within this message, or else this message
  14722. * completes the delivery of the requested stats info that was
  14723. * partially delivered through earlier STATS_CONF messages.
  14724. * partial - The requested stats have been delivered in part.
  14725. * One or more subsequent STATS_CONF messages with the same
  14726. * cookie value will be sent to deliver the remainder of the
  14727. * information.
  14728. * error - The requested stats could not be delivered, for example due
  14729. * to a shortage of memory to construct a message holding the
  14730. * requested stats.
  14731. * invalid - The requested stat type is either not recognized, or the
  14732. * target is configured to not gather the stats type in question.
  14733. */
  14734. enum htt_dbg_ext_stats_status {
  14735. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14736. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14737. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14738. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14739. };
  14740. /**
  14741. * @brief target -> host ppdu stats upload
  14742. *
  14743. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14744. *
  14745. * @details
  14746. * The following field definitions describe the format of the HTT target
  14747. * to host ppdu stats indication message.
  14748. *
  14749. *
  14750. * |31 16|15 12|11 10|9 8|7 0 |
  14751. * |----------------------------------------------------------------------|
  14752. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14753. * |----------------------------------------------------------------------|
  14754. * | ppdu_id |
  14755. * |----------------------------------------------------------------------|
  14756. * | Timestamp in us |
  14757. * |----------------------------------------------------------------------|
  14758. * | reserved |
  14759. * |----------------------------------------------------------------------|
  14760. * | type-specific stats info |
  14761. * | (see htt_ppdu_stats.h) |
  14762. * |----------------------------------------------------------------------|
  14763. * Header fields:
  14764. * - MSG_TYPE
  14765. * Bits 7:0
  14766. * Purpose: Identifies this is a PPDU STATS indication
  14767. * message.
  14768. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14769. * - mac_id
  14770. * Bits 9:8
  14771. * Purpose: mac_id of this ppdu_id
  14772. * Value: 0-3
  14773. * - pdev_id
  14774. * Bits 11:10
  14775. * Purpose: pdev_id of this ppdu_id
  14776. * Value: 0-3
  14777. * 0 (for rings at SOC level),
  14778. * 1/2/3 PDEV -> 0/1/2
  14779. * - payload_size
  14780. * Bits 31:16
  14781. * Purpose: total tlv size
  14782. * Value: payload_size in bytes
  14783. */
  14784. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14785. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14786. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14787. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14788. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14789. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14790. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14791. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14792. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14793. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14794. do { \
  14795. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14796. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14797. } while (0)
  14798. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14799. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14800. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14801. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14802. do { \
  14803. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14804. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14805. } while (0)
  14806. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14807. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14808. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14809. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14810. do { \
  14811. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14812. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14813. } while (0)
  14814. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14815. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14816. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14817. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14818. do { \
  14819. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14820. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14821. } while (0)
  14822. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14823. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14824. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14825. /* htt_t2h_ppdu_stats_ind_hdr_t
  14826. * This struct contains the fields within the header of the
  14827. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14828. * stats info.
  14829. * This struct assumes little-endian layout, and thus is only
  14830. * suitable for use within processors known to be little-endian
  14831. * (such as the target).
  14832. * In contrast, the above macros provide endian-portable methods
  14833. * to get and set the bitfields within this PPDU_STATS_IND header.
  14834. */
  14835. typedef struct {
  14836. A_UINT32 msg_type: 8, /* bits 7:0 */
  14837. mac_id: 2, /* bits 9:8 */
  14838. pdev_id: 2, /* bits 11:10 */
  14839. reserved1: 4, /* bits 15:12 */
  14840. payload_size: 16; /* bits 31:16 */
  14841. A_UINT32 ppdu_id;
  14842. A_UINT32 timestamp_us;
  14843. A_UINT32 reserved2;
  14844. } htt_t2h_ppdu_stats_ind_hdr_t;
  14845. /**
  14846. * @brief target -> host extended statistics upload
  14847. *
  14848. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14849. *
  14850. * @details
  14851. * The following field definitions describe the format of the HTT target
  14852. * to host stats upload confirmation message.
  14853. * The message contains a cookie echoed from the HTT host->target stats
  14854. * upload request, which identifies which request the confirmation is
  14855. * for, and a single stats can span over multiple HTT stats indication
  14856. * due to the HTT message size limitation so every HTT ext stats indication
  14857. * will have tag-length-value stats information elements.
  14858. * The tag-length header for each HTT stats IND message also includes a
  14859. * status field, to indicate whether the request for the stat type in
  14860. * question was fully met, partially met, unable to be met, or invalid
  14861. * (if the stat type in question is disabled in the target).
  14862. * A Done bit 1's indicate the end of the of stats info elements.
  14863. *
  14864. *
  14865. * |31 16|15 12|11|10 8|7 5|4 0|
  14866. * |--------------------------------------------------------------|
  14867. * | reserved | msg type |
  14868. * |--------------------------------------------------------------|
  14869. * | cookie LSBs |
  14870. * |--------------------------------------------------------------|
  14871. * | cookie MSBs |
  14872. * |--------------------------------------------------------------|
  14873. * | stats entry length | rsvd | D| S | stat type |
  14874. * |--------------------------------------------------------------|
  14875. * | type-specific stats info |
  14876. * | (see htt_stats.h) |
  14877. * |--------------------------------------------------------------|
  14878. * Header fields:
  14879. * - MSG_TYPE
  14880. * Bits 7:0
  14881. * Purpose: Identifies this is a extended statistics upload confirmation
  14882. * message.
  14883. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14884. * - COOKIE_LSBS
  14885. * Bits 31:0
  14886. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14887. * message with its preceding host->target stats request message.
  14888. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14889. * - COOKIE_MSBS
  14890. * Bits 31:0
  14891. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14892. * message with its preceding host->target stats request message.
  14893. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14894. *
  14895. * Stats Information Element tag-length header fields:
  14896. * - STAT_TYPE
  14897. * Bits 7:0
  14898. * Purpose: identifies the type of statistics info held in the
  14899. * following information element
  14900. * Value: htt_dbg_ext_stats_type
  14901. * - STATUS
  14902. * Bits 10:8
  14903. * Purpose: indicate whether the requested stats are present
  14904. * Value: htt_dbg_ext_stats_status
  14905. * - DONE
  14906. * Bits 11
  14907. * Purpose:
  14908. * Indicates the completion of the stats entry, this will be the last
  14909. * stats conf HTT segment for the requested stats type.
  14910. * Value:
  14911. * 0 -> the stats retrieval is ongoing
  14912. * 1 -> the stats retrieval is complete
  14913. * - LENGTH
  14914. * Bits 31:16
  14915. * Purpose: indicate the stats information size
  14916. * Value: This field specifies the number of bytes of stats information
  14917. * that follows the element tag-length header.
  14918. * It is expected but not required that this length is a multiple of
  14919. * 4 bytes.
  14920. */
  14921. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14922. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14923. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14924. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14925. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14926. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14927. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14928. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14929. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14930. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14931. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14932. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14933. do { \
  14934. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14935. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14936. } while (0)
  14937. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14938. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14939. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14940. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14941. do { \
  14942. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14943. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14944. } while (0)
  14945. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14946. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14947. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14948. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14949. do { \
  14950. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14951. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14952. } while (0)
  14953. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14954. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14955. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14956. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14957. do { \
  14958. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14959. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14960. } while (0)
  14961. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14962. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14963. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14964. /**
  14965. * @brief target -> host streaming statistics upload
  14966. *
  14967. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14968. *
  14969. * @details
  14970. * The following field definitions describe the format of the HTT target
  14971. * to host streaming stats upload indication message.
  14972. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14973. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14974. * use the STREAMING_STATS_REQ message to halt the target's production of
  14975. * STREAMING_STATS_IND messages.
  14976. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14977. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14978. *
  14979. * |31 8|7 0|
  14980. * |--------------------------------------------------------------|
  14981. * | reserved | msg type |
  14982. * |--------------------------------------------------------------|
  14983. * | type-specific stats info |
  14984. * | (see htt_stats.h) |
  14985. * |--------------------------------------------------------------|
  14986. * Header fields:
  14987. * - MSG_TYPE
  14988. * Bits 7:0
  14989. * Purpose: Identifies this as a streaming statistics upload indication
  14990. * message.
  14991. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14992. */
  14993. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14994. typedef enum {
  14995. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14996. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14997. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14998. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14999. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15000. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15001. /* Reserved from 128 - 255 for target internal use.*/
  15002. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15003. } HTT_PEER_TYPE;
  15004. /** macro to convert MAC address from char array to HTT word format */
  15005. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15006. (phtt_mac_addr)->mac_addr31to0 = \
  15007. (((c_macaddr)[0] << 0) | \
  15008. ((c_macaddr)[1] << 8) | \
  15009. ((c_macaddr)[2] << 16) | \
  15010. ((c_macaddr)[3] << 24)); \
  15011. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15012. } while (0)
  15013. /**
  15014. * @brief target -> host monitor mac header indication message
  15015. *
  15016. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15017. *
  15018. * @details
  15019. * The following diagram shows the format of the monitor mac header message
  15020. * sent from the target to the host.
  15021. * This message is primarily sent when promiscuous rx mode is enabled.
  15022. * One message is sent per rx PPDU.
  15023. *
  15024. * |31 24|23 16|15 8|7 0|
  15025. * |-------------------------------------------------------------|
  15026. * | peer_id | reserved0 | msg_type |
  15027. * |-------------------------------------------------------------|
  15028. * | reserved1 | num_mpdu |
  15029. * |-------------------------------------------------------------|
  15030. * | struct hw_rx_desc |
  15031. * | (see wal_rx_desc.h) |
  15032. * |-------------------------------------------------------------|
  15033. * | struct ieee80211_frame_addr4 |
  15034. * | (see ieee80211_defs.h) |
  15035. * |-------------------------------------------------------------|
  15036. * | struct ieee80211_frame_addr4 |
  15037. * | (see ieee80211_defs.h) |
  15038. * |-------------------------------------------------------------|
  15039. * | ...... |
  15040. * |-------------------------------------------------------------|
  15041. *
  15042. * Header fields:
  15043. * - msg_type
  15044. * Bits 7:0
  15045. * Purpose: Identifies this is a monitor mac header indication message.
  15046. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15047. * - peer_id
  15048. * Bits 31:16
  15049. * Purpose: Software peer id given by host during association,
  15050. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15051. * for rx PPDUs received from unassociated peers.
  15052. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15053. * - num_mpdu
  15054. * Bits 15:0
  15055. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15056. * delivered within the message.
  15057. * Value: 1 to 32
  15058. * num_mpdu is limited to a maximum value of 32, due to buffer
  15059. * size limits. For PPDUs with more than 32 MPDUs, only the
  15060. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15061. * the PPDU will be provided.
  15062. */
  15063. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15064. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15065. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15066. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15067. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15068. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15069. do { \
  15070. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15071. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15072. } while (0)
  15073. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15074. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15075. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15076. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15077. do { \
  15078. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15079. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15080. } while (0)
  15081. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15082. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15083. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15084. /**
  15085. * @brief target -> host flow pool resize Message
  15086. *
  15087. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15088. *
  15089. * @details
  15090. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15091. * the flow pool associated with the specified ID is resized
  15092. *
  15093. * The message would appear as follows:
  15094. *
  15095. * |31 16|15 8|7 0|
  15096. * |---------------------------------+----------------+----------------|
  15097. * | reserved0 | Msg type |
  15098. * |-------------------------------------------------------------------|
  15099. * | flow pool new size | flow pool ID |
  15100. * |-------------------------------------------------------------------|
  15101. *
  15102. * The message is interpreted as follows:
  15103. * b'0:7 - msg_type: This will be set to 0x21
  15104. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15105. *
  15106. * b'0:15 - flow pool ID: Existing flow pool ID
  15107. *
  15108. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15109. *
  15110. */
  15111. PREPACK struct htt_flow_pool_resize_t {
  15112. A_UINT32 msg_type:8,
  15113. reserved0:24;
  15114. A_UINT32 flow_pool_id:16,
  15115. flow_pool_new_size:16;
  15116. } POSTPACK;
  15117. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15118. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15119. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15120. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15121. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15122. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15123. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15124. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15125. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15126. do { \
  15127. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15128. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15129. } while (0)
  15130. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15131. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15132. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15133. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15134. do { \
  15135. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15136. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15137. } while (0)
  15138. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15139. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15140. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15141. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15142. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15143. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15144. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15145. /*
  15146. * The read and write indices point to the data within the host buffer.
  15147. * Because the first 4 bytes of the host buffer is used for the read index and
  15148. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15149. * The read index and write index are the byte offsets from the base of the
  15150. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15151. * Refer the ASCII text picture below.
  15152. */
  15153. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15154. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15155. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15156. /*
  15157. ***************************************************************************
  15158. *
  15159. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15160. *
  15161. ***************************************************************************
  15162. *
  15163. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15164. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15165. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15166. * written into the Host memory region mentioned below.
  15167. *
  15168. * Read index is updated by the Host. At any point of time, the read index will
  15169. * indicate the index that will next be read by the Host. The read index is
  15170. * in units of bytes offset from the base of the meta-data buffer.
  15171. *
  15172. * Write index is updated by the FW. At any point of time, the write index will
  15173. * indicate from where the FW can start writing any new data. The write index is
  15174. * in units of bytes offset from the base of the meta-data buffer.
  15175. *
  15176. * If the Host is not fast enough in reading the CFR data, any new capture data
  15177. * would be dropped if there is no space left to write the new captures.
  15178. *
  15179. * The last 4 bytes of the memory region will have the magic pattern
  15180. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15181. * not overrun the host buffer.
  15182. *
  15183. * ,--------------------. read and write indices store the
  15184. * | | byte offset from the base of the
  15185. * | ,--------+--------. meta-data buffer to the next
  15186. * | | | | location within the data buffer
  15187. * | | v v that will be read / written
  15188. * ************************************************************************
  15189. * * Read * Write * * Magic *
  15190. * * index * index * CFR data1 ...... CFR data N * pattern *
  15191. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15192. * ************************************************************************
  15193. * |<---------- data buffer ---------->|
  15194. *
  15195. * |<----------------- meta-data buffer allocated in Host ----------------|
  15196. *
  15197. * Note:
  15198. * - Considering the 4 bytes needed to store the Read index (R) and the
  15199. * Write index (W), the initial value is as follows:
  15200. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15201. * - Buffer empty condition:
  15202. * R = W
  15203. *
  15204. * Regarding CFR data format:
  15205. * --------------------------
  15206. *
  15207. * Each CFR tone is stored in HW as 16-bits with the following format:
  15208. * {bits[15:12], bits[11:6], bits[5:0]} =
  15209. * {unsigned exponent (4 bits),
  15210. * signed mantissa_real (6 bits),
  15211. * signed mantissa_imag (6 bits)}
  15212. *
  15213. * CFR_real = mantissa_real * 2^(exponent-5)
  15214. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15215. *
  15216. *
  15217. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15218. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15219. *
  15220. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15221. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15222. * .
  15223. * .
  15224. * .
  15225. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15226. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15227. */
  15228. /* Bandwidth of peer CFR captures */
  15229. typedef enum {
  15230. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15231. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15232. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15233. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15234. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15235. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15236. } HTT_PEER_CFR_CAPTURE_BW;
  15237. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15238. * was captured
  15239. */
  15240. typedef enum {
  15241. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15242. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15243. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15244. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15245. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15246. } HTT_PEER_CFR_CAPTURE_MODE;
  15247. typedef enum {
  15248. /* This message type is currently used for the below purpose:
  15249. *
  15250. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15251. * wmi_peer_cfr_capture_cmd.
  15252. * If payload_present bit is set to 0 then the associated memory region
  15253. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15254. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15255. * message; the CFR dump will be present at the end of the message,
  15256. * after the chan_phy_mode.
  15257. */
  15258. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15259. /* Always keep this last */
  15260. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15261. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15262. /**
  15263. * @brief target -> host CFR dump completion indication message definition
  15264. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15265. *
  15266. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15267. *
  15268. * @details
  15269. * The following diagram shows the format of the Channel Frequency Response
  15270. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15271. * the channel capture of a peer is copied by Firmware into the Host memory
  15272. *
  15273. * **************************************************************************
  15274. *
  15275. * Message format when the CFR capture message type is
  15276. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15277. *
  15278. * **************************************************************************
  15279. *
  15280. * |31 16|15 |8|7 0|
  15281. * |----------------------------------------------------------------|
  15282. * header: | reserved |P| msg_type |
  15283. * word 0 | | | |
  15284. * |----------------------------------------------------------------|
  15285. * payload: | cfr_capture_msg_type |
  15286. * word 1 | |
  15287. * |----------------------------------------------------------------|
  15288. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15289. * word 2 | | | | | | | | |
  15290. * |----------------------------------------------------------------|
  15291. * | mac_addr31to0 |
  15292. * word 3 | |
  15293. * |----------------------------------------------------------------|
  15294. * | unused / reserved | mac_addr47to32 |
  15295. * word 4 | | |
  15296. * |----------------------------------------------------------------|
  15297. * | index |
  15298. * word 5 | |
  15299. * |----------------------------------------------------------------|
  15300. * | length |
  15301. * word 6 | |
  15302. * |----------------------------------------------------------------|
  15303. * | timestamp |
  15304. * word 7 | |
  15305. * |----------------------------------------------------------------|
  15306. * | counter |
  15307. * word 8 | |
  15308. * |----------------------------------------------------------------|
  15309. * | chan_mhz |
  15310. * word 9 | |
  15311. * |----------------------------------------------------------------|
  15312. * | band_center_freq1 |
  15313. * word 10 | |
  15314. * |----------------------------------------------------------------|
  15315. * | band_center_freq2 |
  15316. * word 11 | |
  15317. * |----------------------------------------------------------------|
  15318. * | chan_phy_mode |
  15319. * word 12 | |
  15320. * |----------------------------------------------------------------|
  15321. * where,
  15322. * P - payload present bit (payload_present explained below)
  15323. * req_id - memory request id (mem_req_id explained below)
  15324. * S - status field (status explained below)
  15325. * capbw - capture bandwidth (capture_bw explained below)
  15326. * mode - mode of capture (mode explained below)
  15327. * sts - space time streams (sts_count explained below)
  15328. * chbw - channel bandwidth (channel_bw explained below)
  15329. * captype - capture type (cap_type explained below)
  15330. *
  15331. * The following field definitions describe the format of the CFR dump
  15332. * completion indication sent from the target to the host
  15333. *
  15334. * Header fields:
  15335. *
  15336. * Word 0
  15337. * - msg_type
  15338. * Bits 7:0
  15339. * Purpose: Identifies this as CFR TX completion indication
  15340. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15341. * - payload_present
  15342. * Bit 8
  15343. * Purpose: Identifies how CFR data is sent to host
  15344. * Value: 0 - If CFR Payload is written to host memory
  15345. * 1 - If CFR Payload is sent as part of HTT message
  15346. * (This is the requirement for SDIO/USB where it is
  15347. * not possible to write CFR data to host memory)
  15348. * - reserved
  15349. * Bits 31:9
  15350. * Purpose: Reserved
  15351. * Value: 0
  15352. *
  15353. * Payload fields:
  15354. *
  15355. * Word 1
  15356. * - cfr_capture_msg_type
  15357. * Bits 31:0
  15358. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15359. * to specify the format used for the remainder of the message
  15360. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15361. * (currently only MSG_TYPE_1 is defined)
  15362. *
  15363. * Word 2
  15364. * - mem_req_id
  15365. * Bits 6:0
  15366. * Purpose: Contain the mem request id of the region where the CFR capture
  15367. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15368. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15369. this value is invalid)
  15370. * - status
  15371. * Bit 7
  15372. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15373. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15374. * - capture_bw
  15375. * Bits 10:8
  15376. * Purpose: Carry the bandwidth of the CFR capture
  15377. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15378. * - mode
  15379. * Bits 13:11
  15380. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15381. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15382. * - sts_count
  15383. * Bits 16:14
  15384. * Purpose: Carry the number of space time streams
  15385. * Value: Number of space time streams
  15386. * - channel_bw
  15387. * Bits 19:17
  15388. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15389. * measurement
  15390. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15391. * - cap_type
  15392. * Bits 23:20
  15393. * Purpose: Carry the type of the capture
  15394. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15395. * - vdev_id
  15396. * Bits 31:24
  15397. * Purpose: Carry the virtual device id
  15398. * Value: vdev ID
  15399. *
  15400. * Word 3
  15401. * - mac_addr31to0
  15402. * Bits 31:0
  15403. * Purpose: Contain the bits 31:0 of the peer MAC address
  15404. * Value: Bits 31:0 of the peer MAC address
  15405. *
  15406. * Word 4
  15407. * - mac_addr47to32
  15408. * Bits 15:0
  15409. * Purpose: Contain the bits 47:32 of the peer MAC address
  15410. * Value: Bits 47:32 of the peer MAC address
  15411. *
  15412. * Word 5
  15413. * - index
  15414. * Bits 31:0
  15415. * Purpose: Contain the index at which this CFR dump was written in the Host
  15416. * allocated memory. This index is the number of bytes from the base address.
  15417. * Value: Index position
  15418. *
  15419. * Word 6
  15420. * - length
  15421. * Bits 31:0
  15422. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15423. * Value: Length of the CFR capture of the peer
  15424. *
  15425. * Word 7
  15426. * - timestamp
  15427. * Bits 31:0
  15428. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15429. * clock used for this timestamp is private to the target and not visible to
  15430. * the host i.e., Host can interpret only the relative timestamp deltas from
  15431. * one message to the next, but can't interpret the absolute timestamp from a
  15432. * single message.
  15433. * Value: Timestamp in microseconds
  15434. *
  15435. * Word 8
  15436. * - counter
  15437. * Bits 31:0
  15438. * Purpose: Carry the count of the current CFR capture from FW. This is
  15439. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15440. * in host memory)
  15441. * Value: Count of the current CFR capture
  15442. *
  15443. * Word 9
  15444. * - chan_mhz
  15445. * Bits 31:0
  15446. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15447. * Value: Primary 20 channel frequency
  15448. *
  15449. * Word 10
  15450. * - band_center_freq1
  15451. * Bits 31:0
  15452. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15453. * Value: Center frequency 1 in MHz
  15454. *
  15455. * Word 11
  15456. * - band_center_freq2
  15457. * Bits 31:0
  15458. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15459. * the VDEV
  15460. * 80plus80 mode
  15461. * Value: Center frequency 2 in MHz
  15462. *
  15463. * Word 12
  15464. * - chan_phy_mode
  15465. * Bits 31:0
  15466. * Purpose: Carry the phy mode of the channel, of the VDEV
  15467. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15468. */
  15469. PREPACK struct htt_cfr_dump_ind_type_1 {
  15470. A_UINT32 mem_req_id:7,
  15471. status:1,
  15472. capture_bw:3,
  15473. mode:3,
  15474. sts_count:3,
  15475. channel_bw:3,
  15476. cap_type:4,
  15477. vdev_id:8;
  15478. htt_mac_addr addr;
  15479. A_UINT32 index;
  15480. A_UINT32 length;
  15481. A_UINT32 timestamp;
  15482. A_UINT32 counter;
  15483. struct htt_chan_change_msg chan;
  15484. } POSTPACK;
  15485. PREPACK struct htt_cfr_dump_compl_ind {
  15486. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15487. union {
  15488. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15489. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15490. /* If there is a need to change the memory layout and its associated
  15491. * HTT indication format, a new CFR capture message type can be
  15492. * introduced and added into this union.
  15493. */
  15494. };
  15495. } POSTPACK;
  15496. /*
  15497. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15498. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15499. */
  15500. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15501. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15502. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15503. do { \
  15504. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15505. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15506. } while(0)
  15507. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15508. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15509. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15510. /*
  15511. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15512. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15513. */
  15514. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15515. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15516. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15517. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15518. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15519. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15520. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15521. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15522. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15523. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15524. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15525. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15526. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15527. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15528. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15529. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15530. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15531. do { \
  15532. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15533. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15534. } while (0)
  15535. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15536. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15537. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15538. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15539. do { \
  15540. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15541. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15542. } while (0)
  15543. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15544. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15545. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15546. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15547. do { \
  15548. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15549. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15550. } while (0)
  15551. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15552. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15553. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15554. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15555. do { \
  15556. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15557. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15558. } while (0)
  15559. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15560. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15561. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15562. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15563. do { \
  15564. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15565. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15566. } while (0)
  15567. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15568. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15569. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15570. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15571. do { \
  15572. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15573. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15574. } while (0)
  15575. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15576. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15577. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15578. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15579. do { \
  15580. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15581. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15582. } while (0)
  15583. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15584. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15585. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15586. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15587. do { \
  15588. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15589. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15590. } while (0)
  15591. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15592. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15593. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15594. /**
  15595. * @brief target -> host peer (PPDU) stats message
  15596. *
  15597. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15598. *
  15599. * @details
  15600. * This message is generated by FW when FW is sending stats to host
  15601. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15602. * This message is sent autonomously by the target rather than upon request
  15603. * by the host.
  15604. * The following field definitions describe the format of the HTT target
  15605. * to host peer stats indication message.
  15606. *
  15607. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15608. * or more PPDU stats records.
  15609. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15610. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15611. * then the message would start with the
  15612. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15613. * below.
  15614. *
  15615. * |31 16|15|14|13 11|10 9|8|7 0|
  15616. * |-------------------------------------------------------------|
  15617. * | reserved |MSG_TYPE |
  15618. * |-------------------------------------------------------------|
  15619. * rec 0 | TLV header |
  15620. * rec 0 |-------------------------------------------------------------|
  15621. * rec 0 | ppdu successful bytes |
  15622. * rec 0 |-------------------------------------------------------------|
  15623. * rec 0 | ppdu retry bytes |
  15624. * rec 0 |-------------------------------------------------------------|
  15625. * rec 0 | ppdu failed bytes |
  15626. * rec 0 |-------------------------------------------------------------|
  15627. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15628. * rec 0 |-------------------------------------------------------------|
  15629. * rec 0 | retried MSDUs | successful MSDUs |
  15630. * rec 0 |-------------------------------------------------------------|
  15631. * rec 0 | TX duration | failed MSDUs |
  15632. * rec 0 |-------------------------------------------------------------|
  15633. * ...
  15634. * |-------------------------------------------------------------|
  15635. * rec N | TLV header |
  15636. * rec N |-------------------------------------------------------------|
  15637. * rec N | ppdu successful bytes |
  15638. * rec N |-------------------------------------------------------------|
  15639. * rec N | ppdu retry bytes |
  15640. * rec N |-------------------------------------------------------------|
  15641. * rec N | ppdu failed bytes |
  15642. * rec N |-------------------------------------------------------------|
  15643. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15644. * rec N |-------------------------------------------------------------|
  15645. * rec N | retried MSDUs | successful MSDUs |
  15646. * rec N |-------------------------------------------------------------|
  15647. * rec N | TX duration | failed MSDUs |
  15648. * rec N |-------------------------------------------------------------|
  15649. *
  15650. * where:
  15651. * A = is A-MPDU flag
  15652. * BA = block-ack failure flags
  15653. * BW = bandwidth spec
  15654. * SG = SGI enabled spec
  15655. * S = skipped rate ctrl
  15656. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15657. *
  15658. * Header
  15659. * ------
  15660. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15661. * dword0 - b'8:31 - reserved : Reserved for future use
  15662. *
  15663. * payload include below peer_stats information
  15664. * --------------------------------------------
  15665. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15666. * @tx_success_bytes : total successful bytes in the PPDU.
  15667. * @tx_retry_bytes : total retried bytes in the PPDU.
  15668. * @tx_failed_bytes : total failed bytes in the PPDU.
  15669. * @tx_ratecode : rate code used for the PPDU.
  15670. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15671. * @ba_ack_failed : BA/ACK failed for this PPDU
  15672. * b00 -> BA received
  15673. * b01 -> BA failed once
  15674. * b10 -> BA failed twice, when HW retry is enabled.
  15675. * @bw : BW
  15676. * b00 -> 20 MHz
  15677. * b01 -> 40 MHz
  15678. * b10 -> 80 MHz
  15679. * b11 -> 160 MHz (or 80+80)
  15680. * @sg : SGI enabled
  15681. * @s : skipped ratectrl
  15682. * @peer_id : peer id
  15683. * @tx_success_msdus : successful MSDUs
  15684. * @tx_retry_msdus : retried MSDUs
  15685. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15686. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15687. */
  15688. /**
  15689. * @brief target -> host backpressure event
  15690. *
  15691. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15692. *
  15693. * @details
  15694. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15695. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15696. * This message will only be sent if the backpressure condition has existed
  15697. * continuously for an initial period (100 ms).
  15698. * Repeat messages with updated information will be sent after each
  15699. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15700. * This message indicates the ring id along with current head and tail index
  15701. * locations (i.e. write and read indices).
  15702. * The backpressure time indicates the time in ms for which continuous
  15703. * backpressure has been observed in the ring.
  15704. *
  15705. * The message format is as follows:
  15706. *
  15707. * |31 24|23 16|15 8|7 0|
  15708. * |----------------+----------------+----------------+----------------|
  15709. * | ring_id | ring_type | pdev_id | msg_type |
  15710. * |-------------------------------------------------------------------|
  15711. * | tail_idx | head_idx |
  15712. * |-------------------------------------------------------------------|
  15713. * | backpressure_time_ms |
  15714. * |-------------------------------------------------------------------|
  15715. *
  15716. * The message is interpreted as follows:
  15717. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15718. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15719. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15720. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15721. * the msg is for LMAC ring.
  15722. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15723. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15724. * htt_backpressure_lmac_ring_id. This represents
  15725. * the ring id for which continuous backpressure
  15726. * is seen
  15727. *
  15728. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15729. * the ring indicated by the ring_id
  15730. *
  15731. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15732. * the ring indicated by the ring id
  15733. *
  15734. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  15735. * backpressure has been seen in the ring
  15736. * indicated by the ring_id.
  15737. * Units = milliseconds
  15738. */
  15739. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15740. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15741. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15742. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15743. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15744. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15745. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15746. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15747. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15748. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15749. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15750. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15751. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15752. do { \
  15753. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15754. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15755. } while (0)
  15756. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15757. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15758. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15759. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15760. do { \
  15761. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15762. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15763. } while (0)
  15764. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15765. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15766. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15767. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15768. do { \
  15769. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15770. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15771. } while (0)
  15772. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15773. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15774. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15775. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15776. do { \
  15777. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15778. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15779. } while (0)
  15780. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15781. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15782. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15783. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15784. do { \
  15785. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15786. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15787. } while (0)
  15788. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15789. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15790. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15791. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15792. do { \
  15793. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15794. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15795. } while (0)
  15796. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15797. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15798. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15799. enum htt_backpressure_ring_type {
  15800. HTT_SW_RING_TYPE_UMAC,
  15801. HTT_SW_RING_TYPE_LMAC,
  15802. HTT_SW_RING_TYPE_MAX,
  15803. };
  15804. /* Ring id for which the message is sent to host */
  15805. enum htt_backpressure_umac_ringid {
  15806. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15807. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15808. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15809. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15810. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15811. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15812. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15813. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15814. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15815. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15816. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15817. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15818. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15819. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15820. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15821. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15822. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15823. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15824. HTT_SW_UMAC_RING_IDX_MAX,
  15825. };
  15826. enum htt_backpressure_lmac_ringid {
  15827. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15828. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15829. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15830. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15831. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15832. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15833. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15834. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15835. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15836. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15837. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15838. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15839. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15840. HTT_SW_LMAC_RING_IDX_MAX,
  15841. };
  15842. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15843. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15844. pdev_id: 8,
  15845. ring_type: 8, /* htt_backpressure_ring_type */
  15846. /*
  15847. * ring_id holds an enum value from either
  15848. * htt_backpressure_umac_ringid or
  15849. * htt_backpressure_lmac_ringid, based on
  15850. * the ring_type setting.
  15851. */
  15852. ring_id: 8;
  15853. A_UINT16 head_idx;
  15854. A_UINT16 tail_idx;
  15855. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15856. } POSTPACK;
  15857. /*
  15858. * Defines two 32 bit words that can be used by the target to indicate a per
  15859. * user RU allocation and rate information.
  15860. *
  15861. * This information is currently provided in the "sw_response_reference_ptr"
  15862. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15863. * "rx_ppdu_end_user_stats" TLV.
  15864. *
  15865. * VALID:
  15866. * The consumer of these words must explicitly check the valid bit,
  15867. * and only attempt interpretation of any of the remaining fields if
  15868. * the valid bit is set to 1.
  15869. *
  15870. * VERSION:
  15871. * The consumer of these words must also explicitly check the version bit,
  15872. * and only use the V0 definition if the VERSION field is set to 0.
  15873. *
  15874. * Version 1 is currently undefined, with the exception of the VALID and
  15875. * VERSION fields.
  15876. *
  15877. * Version 0:
  15878. *
  15879. * The fields below are duplicated per BW.
  15880. *
  15881. * The consumer must determine which BW field to use, based on the UL OFDMA
  15882. * PPDU BW indicated by HW.
  15883. *
  15884. * RU_START: RU26 start index for the user.
  15885. * Note that this is always using the RU26 index, regardless
  15886. * of the actual RU assigned to the user
  15887. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15888. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15889. *
  15890. * For example, 20MHz (the value in the top row is RU_START)
  15891. *
  15892. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15893. * RU Size 1 (52): | | | | | |
  15894. * RU Size 2 (106): | | | |
  15895. * RU Size 3 (242): | |
  15896. *
  15897. * RU_SIZE: Indicates the RU size, as defined by enum
  15898. * htt_ul_ofdma_user_info_ru_size.
  15899. *
  15900. * LDPC: LDPC enabled (if 0, BCC is used)
  15901. *
  15902. * DCM: DCM enabled
  15903. *
  15904. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15905. * |---------------------------------+--------------------------------|
  15906. * |Ver|Valid| FW internal |
  15907. * |---------------------------------+--------------------------------|
  15908. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15909. * |---------------------------------+--------------------------------|
  15910. */
  15911. enum htt_ul_ofdma_user_info_ru_size {
  15912. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15913. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15914. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15915. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15916. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15917. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15918. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15919. };
  15920. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15921. struct htt_ul_ofdma_user_info_v0 {
  15922. A_UINT32 word0;
  15923. A_UINT32 word1;
  15924. };
  15925. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15926. A_UINT32 w0_fw_rsvd:30; \
  15927. A_UINT32 w0_valid:1; \
  15928. A_UINT32 w0_version:1;
  15929. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15930. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15931. };
  15932. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15933. A_UINT32 w1_nss:3; \
  15934. A_UINT32 w1_mcs:4; \
  15935. A_UINT32 w1_ldpc:1; \
  15936. A_UINT32 w1_dcm:1; \
  15937. A_UINT32 w1_ru_start:7; \
  15938. A_UINT32 w1_ru_size:3; \
  15939. A_UINT32 w1_trig_type:4; \
  15940. A_UINT32 w1_unused:9;
  15941. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15942. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15943. };
  15944. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15945. A_UINT32 w0_fw_rsvd:27; \
  15946. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15947. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15948. 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) */
  15949. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15950. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15951. };
  15952. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15953. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15954. A_UINT32 w1_trig_type:4; \
  15955. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15956. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15957. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15958. };
  15959. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15960. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15961. union {
  15962. A_UINT32 word0;
  15963. struct {
  15964. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15965. };
  15966. };
  15967. union {
  15968. A_UINT32 word1;
  15969. struct {
  15970. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15971. };
  15972. };
  15973. } POSTPACK;
  15974. /*
  15975. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15976. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15977. * this should be picked.
  15978. */
  15979. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15980. union {
  15981. A_UINT32 word0;
  15982. struct {
  15983. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15984. };
  15985. };
  15986. union {
  15987. A_UINT32 word1;
  15988. struct {
  15989. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15990. };
  15991. };
  15992. } POSTPACK;
  15993. enum HTT_UL_OFDMA_TRIG_TYPE {
  15994. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15995. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15996. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15997. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15998. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15999. };
  16000. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16001. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16002. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16003. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16004. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16005. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16006. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16007. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16008. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16009. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16010. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16011. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16012. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16013. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16014. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16015. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16016. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16017. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16018. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16019. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16020. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16021. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16022. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16023. /*--- word 0 ---*/
  16024. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16025. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16026. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16027. do { \
  16028. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16029. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16030. } while (0)
  16031. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16032. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16033. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16034. do { \
  16035. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16036. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16037. } while (0)
  16038. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16039. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16040. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16041. do { \
  16042. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16043. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16044. } while (0)
  16045. /*--- word 1 ---*/
  16046. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16047. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16048. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16049. do { \
  16050. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16051. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16052. } while (0)
  16053. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16054. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16055. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16056. do { \
  16057. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16058. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16059. } while (0)
  16060. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16061. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16062. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16063. do { \
  16064. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16065. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16066. } while (0)
  16067. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16068. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16069. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16070. do { \
  16071. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16072. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16073. } while (0)
  16074. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16075. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16076. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16077. do { \
  16078. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16079. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16080. } while (0)
  16081. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16082. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16083. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16084. do { \
  16085. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16086. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16087. } while (0)
  16088. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16089. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16090. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16091. do { \
  16092. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16093. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16094. } while (0)
  16095. /**
  16096. * @brief target -> host channel calibration data message
  16097. *
  16098. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16099. *
  16100. * @brief host -> target channel calibration data message
  16101. *
  16102. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16103. *
  16104. * @details
  16105. * The following field definitions describe the format of the channel
  16106. * calibration data message sent from the target to the host when
  16107. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16108. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16109. * The message is defined as htt_chan_caldata_msg followed by a variable
  16110. * number of 32-bit character values.
  16111. *
  16112. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16113. * |------------------------------------------------------------------|
  16114. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16115. * |------------------------------------------------------------------|
  16116. * | payload size | mhz |
  16117. * |------------------------------------------------------------------|
  16118. * | center frequency 2 | center frequency 1 |
  16119. * |------------------------------------------------------------------|
  16120. * | check sum |
  16121. * |------------------------------------------------------------------|
  16122. * | payload |
  16123. * |------------------------------------------------------------------|
  16124. * message info field:
  16125. * - MSG_TYPE
  16126. * Bits 7:0
  16127. * Purpose: identifies this as a channel calibration data message
  16128. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16129. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16130. * - SUB_TYPE
  16131. * Bits 11:8
  16132. * Purpose: T2H: indicates whether target is providing chan cal data
  16133. * to the host to store, or requesting that the host
  16134. * download previously-stored data.
  16135. * H2T: indicates whether the host is providing the requested
  16136. * channel cal data, or if it is rejecting the data
  16137. * request because it does not have the requested data.
  16138. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16139. * - CHKSUM_VALID
  16140. * Bit 12
  16141. * Purpose: indicates if the checksum field is valid
  16142. * value:
  16143. * - FRAG
  16144. * Bit 19:16
  16145. * Purpose: indicates the fragment index for message
  16146. * value: 0 for first fragment, 1 for second fragment, ...
  16147. * - APPEND
  16148. * Bit 20
  16149. * Purpose: indicates if this is the last fragment
  16150. * value: 0 = final fragment, 1 = more fragments will be appended
  16151. *
  16152. * channel and payload size field
  16153. * - MHZ
  16154. * Bits 15:0
  16155. * Purpose: indicates the channel primary frequency
  16156. * Value:
  16157. * - PAYLOAD_SIZE
  16158. * Bits 31:16
  16159. * Purpose: indicates the bytes of calibration data in payload
  16160. * Value:
  16161. *
  16162. * center frequency field
  16163. * - CENTER FREQUENCY 1
  16164. * Bits 15:0
  16165. * Purpose: indicates the channel center frequency
  16166. * Value: channel center frequency, in MHz units
  16167. * - CENTER FREQUENCY 2
  16168. * Bits 31:16
  16169. * Purpose: indicates the secondary channel center frequency,
  16170. * only for 11acvht 80plus80 mode
  16171. * Value: secondary channel center frequency, in MHz units, if applicable
  16172. *
  16173. * checksum field
  16174. * - CHECK_SUM
  16175. * Bits 31:0
  16176. * Purpose: check the payload data, it is just for this fragment.
  16177. * This is intended for the target to check that the channel
  16178. * calibration data returned by the host is the unmodified data
  16179. * that was previously provided to the host by the target.
  16180. * value: checksum of fragment payload
  16181. */
  16182. PREPACK struct htt_chan_caldata_msg {
  16183. /* DWORD 0: message info */
  16184. A_UINT32
  16185. msg_type: 8,
  16186. sub_type: 4 ,
  16187. chksum_valid: 1, /** 1:valid, 0:invalid */
  16188. reserved1: 3,
  16189. frag_idx: 4, /** fragment index for calibration data */
  16190. appending: 1, /** 0: no fragment appending,
  16191. * 1: extra fragment appending */
  16192. reserved2: 11;
  16193. /* DWORD 1: channel and payload size */
  16194. A_UINT32
  16195. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16196. payload_size: 16; /** unit: bytes */
  16197. /* DWORD 2: center frequency */
  16198. A_UINT32
  16199. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16200. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16201. * valid only for 11acvht 80plus80 mode */
  16202. /* DWORD 3: check sum */
  16203. A_UINT32 chksum;
  16204. /* variable length for calibration data */
  16205. A_UINT32 payload[1/* or more */];
  16206. } POSTPACK;
  16207. /* T2H SUBTYPE */
  16208. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16209. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16210. /* H2T SUBTYPE */
  16211. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16212. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16213. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16214. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16215. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16216. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16217. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16218. do { \
  16219. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16220. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16221. } while (0)
  16222. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16223. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16224. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16225. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16226. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16227. do { \
  16228. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16229. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16230. } while (0)
  16231. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16232. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16233. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16234. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16235. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16236. do { \
  16237. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16238. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16239. } while (0)
  16240. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16241. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16242. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16243. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16244. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16245. do { \
  16246. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16247. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16248. } while (0)
  16249. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16250. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16251. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16252. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16253. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16254. do { \
  16255. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16256. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16257. } while (0)
  16258. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16259. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16260. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16261. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16262. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16263. do { \
  16264. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16265. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16266. } while (0)
  16267. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16268. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16269. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16270. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16271. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16272. do { \
  16273. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16274. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16275. } while (0)
  16276. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16277. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16278. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16279. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16280. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16281. do { \
  16282. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16283. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16284. } while (0)
  16285. /**
  16286. * @brief target -> host FSE CMEM based send
  16287. *
  16288. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16289. *
  16290. * @details
  16291. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16292. * FSE placement in CMEM is enabled.
  16293. *
  16294. * This message sends the non-secure CMEM base address.
  16295. * It will be sent to host in response to message
  16296. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16297. * The message would appear as follows:
  16298. *
  16299. * |31 24|23 16|15 8|7 0|
  16300. * |----------------+----------------+----------------+----------------|
  16301. * | reserved | num_entries | msg_type |
  16302. * |----------------+----------------+----------------+----------------|
  16303. * | base_address_lo |
  16304. * |----------------+----------------+----------------+----------------|
  16305. * | base_address_hi |
  16306. * |-------------------------------------------------------------------|
  16307. *
  16308. * The message is interpreted as follows:
  16309. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16310. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16311. * b'8:15 - number_entries: Indicated the number of entries
  16312. * programmed.
  16313. * b'16:31 - reserved.
  16314. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16315. * CMEM base address
  16316. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16317. * CMEM base address
  16318. */
  16319. PREPACK struct htt_cmem_base_send_t {
  16320. A_UINT32 msg_type: 8,
  16321. num_entries: 8,
  16322. reserved: 16;
  16323. A_UINT32 base_address_lo;
  16324. A_UINT32 base_address_hi;
  16325. } POSTPACK;
  16326. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16327. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16328. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16329. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16330. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16331. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16332. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16333. do { \
  16334. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16335. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16336. } while (0)
  16337. /**
  16338. * @brief - HTT PPDU ID format
  16339. *
  16340. * @details
  16341. * The following field definitions describe the format of the PPDU ID.
  16342. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16343. *
  16344. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16345. * +--------------------------------------------------------------------------
  16346. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16347. * +--------------------------------------------------------------------------
  16348. *
  16349. * sch id :Schedule command id
  16350. * Bits [11 : 0] : monotonically increasing counter to track the
  16351. * PPDU posted to a specific transmit queue.
  16352. *
  16353. * hwq_id: Hardware Queue ID.
  16354. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16355. *
  16356. * mac_id: MAC ID
  16357. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16358. *
  16359. * seq_idx: Sequence index.
  16360. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16361. * a particular TXOP.
  16362. *
  16363. * tqm_cmd: HWSCH/TQM flag.
  16364. * Bit [23] : Always set to 0.
  16365. *
  16366. * seq_cmd_type: Sequence command type.
  16367. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16368. * Refer to enum HTT_STATS_FTYPE for values.
  16369. */
  16370. PREPACK struct htt_ppdu_id {
  16371. A_UINT32
  16372. sch_id: 12,
  16373. hwq_id: 5,
  16374. mac_id: 2,
  16375. seq_idx: 2,
  16376. reserved1: 2,
  16377. tqm_cmd: 1,
  16378. seq_cmd_type: 6,
  16379. reserved2: 2;
  16380. } POSTPACK;
  16381. #define HTT_PPDU_ID_SCH_ID_S 0
  16382. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16383. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16384. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16385. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16386. do { \
  16387. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16388. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16389. } while (0)
  16390. #define HTT_PPDU_ID_HWQ_ID_S 12
  16391. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16392. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16393. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16394. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16395. do { \
  16396. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16397. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16398. } while (0)
  16399. #define HTT_PPDU_ID_MAC_ID_S 17
  16400. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16401. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16402. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16403. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16404. do { \
  16405. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16406. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16407. } while (0)
  16408. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16409. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16410. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16411. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16412. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16413. do { \
  16414. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16415. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16416. } while (0)
  16417. #define HTT_PPDU_ID_TQM_CMD_S 23
  16418. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16419. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16420. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16421. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16422. do { \
  16423. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16424. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16425. } while (0)
  16426. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16427. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16428. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16429. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16430. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16431. do { \
  16432. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16433. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16434. } while (0)
  16435. /**
  16436. * @brief target -> RX PEER METADATA V0 format
  16437. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16438. * message from target, and will confirm to the target which peer metadata
  16439. * version to use in the wmi_init message.
  16440. *
  16441. * The following diagram shows the format of the RX PEER METADATA.
  16442. *
  16443. * |31 24|23 16|15 8|7 0|
  16444. * |-----------------------------------------------------------------------|
  16445. * | Reserved | VDEV ID | PEER ID |
  16446. * |-----------------------------------------------------------------------|
  16447. */
  16448. PREPACK struct htt_rx_peer_metadata_v0 {
  16449. A_UINT32
  16450. peer_id: 16,
  16451. vdev_id: 8,
  16452. reserved1: 8;
  16453. } POSTPACK;
  16454. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16455. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16456. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16457. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16458. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16459. do { \
  16460. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16461. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16462. } while (0)
  16463. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16464. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16465. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16466. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16467. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16468. do { \
  16469. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16470. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16471. } while (0)
  16472. /**
  16473. * @brief target -> RX PEER METADATA V1 format
  16474. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16475. * message from target, and will confirm to the target which peer metadata
  16476. * version to use in the wmi_init message.
  16477. *
  16478. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16479. *
  16480. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16481. * |-----------------------------------------------------------------------|
  16482. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16483. * |-----------------------------------------------------------------------|
  16484. */
  16485. PREPACK struct htt_rx_peer_metadata_v1 {
  16486. A_UINT32
  16487. peer_id: 13,
  16488. ml_peer_valid: 1,
  16489. reserved1: 2,
  16490. vdev_id: 8,
  16491. lmac_id: 2,
  16492. chip_id: 3,
  16493. reserved2: 3;
  16494. } POSTPACK;
  16495. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16496. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16497. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16498. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16499. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16500. do { \
  16501. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16502. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16503. } while (0)
  16504. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16505. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16506. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16507. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16508. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16509. do { \
  16510. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16511. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16512. } while (0)
  16513. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16514. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16515. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16516. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16517. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16518. do { \
  16519. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16520. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16521. } while (0)
  16522. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16523. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16524. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16525. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16526. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16527. do { \
  16528. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16529. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16530. } while (0)
  16531. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16532. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16533. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16534. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16535. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16536. do { \
  16537. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16538. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16539. } while (0)
  16540. /*
  16541. * In some systems, the host SW wants to specify priorities between
  16542. * different MSDU / flow queues within the same peer-TID.
  16543. * The below enums are used for the host to identify to the target
  16544. * which MSDU queue's priority it wants to adjust.
  16545. */
  16546. /*
  16547. * The MSDUQ index describe index of TCL HW, where each index is
  16548. * used for queuing particular types of MSDUs.
  16549. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16550. */
  16551. enum HTT_MSDUQ_INDEX {
  16552. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16553. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16554. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16555. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16556. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16557. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16558. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16559. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16560. HTT_MSDUQ_MAX_INDEX,
  16561. };
  16562. /* MSDU qtype definition */
  16563. enum HTT_MSDU_QTYPE {
  16564. /*
  16565. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16566. * relative priority. Instead, the relative priority of CRIT_0 versus
  16567. * CRIT_1 is controlled by the FW, through the configuration parameters
  16568. * it applies to the queues.
  16569. */
  16570. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16571. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16572. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16573. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16574. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16575. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16576. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16577. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16578. /* New MSDU_QTYPE should be added above this line */
  16579. /*
  16580. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16581. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16582. * any host/target message definitions. The QTYPE_MAX value can
  16583. * only be used internally within the host or within the target.
  16584. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16585. * it must regard the unexpected value as a default qtype value,
  16586. * or ignore it.
  16587. */
  16588. HTT_MSDU_QTYPE_MAX,
  16589. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16590. };
  16591. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16592. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16593. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16594. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16595. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16596. };
  16597. /**
  16598. * @brief target -> host mlo timestamp offset indication
  16599. *
  16600. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16601. *
  16602. * @details
  16603. * The following field definitions describe the format of the HTT target
  16604. * to host mlo timestamp offset indication message.
  16605. *
  16606. *
  16607. * |31 16|15 12|11 10|9 8|7 0 |
  16608. * |----------------------------------------------------------------------|
  16609. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16610. * |----------------------------------------------------------------------|
  16611. * | Sync time stamp lo in us |
  16612. * |----------------------------------------------------------------------|
  16613. * | Sync time stamp hi in us |
  16614. * |----------------------------------------------------------------------|
  16615. * | mlo time stamp offset lo in us |
  16616. * |----------------------------------------------------------------------|
  16617. * | mlo time stamp offset hi in us |
  16618. * |----------------------------------------------------------------------|
  16619. * | mlo time stamp offset clocks in clock ticks |
  16620. * |----------------------------------------------------------------------|
  16621. * |31 26|25 16|15 0 |
  16622. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16623. * | | compensation in clks | |
  16624. * |----------------------------------------------------------------------|
  16625. * |31 22|21 0 |
  16626. * | rsvd 3 | mlo time stamp comp timer period |
  16627. * |----------------------------------------------------------------------|
  16628. * The message is interpreted as follows:
  16629. *
  16630. * dword0 - b'0:7 - msg_type: This will be set to
  16631. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16632. * value: 0x28
  16633. *
  16634. * dword0 - b'9:8 - pdev_id
  16635. *
  16636. * dword0 - b'11:10 - chip_id
  16637. *
  16638. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16639. *
  16640. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16641. *
  16642. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16643. * which last sync interrupt was received
  16644. *
  16645. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16646. * which last sync interrupt was received
  16647. *
  16648. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16649. *
  16650. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16651. *
  16652. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16653. *
  16654. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16655. *
  16656. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16657. * for sub us resolution
  16658. *
  16659. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16660. *
  16661. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16662. * is applied, in us
  16663. *
  16664. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16665. */
  16666. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16667. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16668. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16669. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16670. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16671. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16672. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16673. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16674. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16675. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16676. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16677. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16678. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16679. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16680. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16681. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16682. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16683. do { \
  16684. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16685. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16686. } while (0)
  16687. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16688. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16689. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16690. do { \
  16691. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16692. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16693. } while (0)
  16694. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16695. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16696. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16697. do { \
  16698. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16699. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16700. } while (0)
  16701. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16702. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16703. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16704. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16705. do { \
  16706. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16707. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16708. } while (0)
  16709. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16710. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16711. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16712. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16713. do { \
  16714. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16715. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16716. } while (0)
  16717. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16718. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16719. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16720. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16721. do { \
  16722. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16723. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16724. } while (0)
  16725. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16726. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16727. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16728. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16729. do { \
  16730. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16731. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16732. } while (0)
  16733. typedef struct {
  16734. A_UINT32 msg_type: 8, /* bits 7:0 */
  16735. pdev_id: 2, /* bits 9:8 */
  16736. chip_id: 2, /* bits 11:10 */
  16737. reserved1: 4, /* bits 15:12 */
  16738. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16739. A_UINT32 sync_timestamp_lo_us;
  16740. A_UINT32 sync_timestamp_hi_us;
  16741. A_UINT32 mlo_timestamp_offset_lo_us;
  16742. A_UINT32 mlo_timestamp_offset_hi_us;
  16743. A_UINT32 mlo_timestamp_offset_clks;
  16744. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16745. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16746. reserved2: 6; /* bits 31:26 */
  16747. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16748. reserved3: 10; /* bits 31:22 */
  16749. } htt_t2h_mlo_offset_ind_t;
  16750. /*
  16751. * @brief target -> host VDEV TX RX STATS
  16752. *
  16753. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16754. *
  16755. * @details
  16756. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16757. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16758. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16759. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16760. * periodically by target even in the absence of any further HTT request
  16761. * messages from host.
  16762. *
  16763. * The message is formatted as follows:
  16764. *
  16765. * |31 16|15 8|7 0|
  16766. * |---------------------------------+----------------+----------------|
  16767. * | payload_size | pdev_id | msg_type |
  16768. * |---------------------------------+----------------+----------------|
  16769. * | reserved0 |
  16770. * |-------------------------------------------------------------------|
  16771. * | reserved1 |
  16772. * |-------------------------------------------------------------------|
  16773. * | reserved2 |
  16774. * |-------------------------------------------------------------------|
  16775. * | |
  16776. * | VDEV specific Tx Rx stats info |
  16777. * | |
  16778. * |-------------------------------------------------------------------|
  16779. *
  16780. * The message is interpreted as follows:
  16781. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16782. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16783. * b'8:15 - pdev_id
  16784. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16785. * message header fields (msg_type through reserved2)
  16786. * dword1 - b'0:31 - reserved0.
  16787. * dword2 - b'0:31 - reserved1.
  16788. * dword3 - b'0:31 - reserved2.
  16789. */
  16790. typedef struct {
  16791. A_UINT32 msg_type: 8,
  16792. pdev_id: 8,
  16793. payload_size: 16;
  16794. A_UINT32 reserved0;
  16795. A_UINT32 reserved1;
  16796. A_UINT32 reserved2;
  16797. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16798. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16799. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16800. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16801. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16802. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16803. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16804. do { \
  16805. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16806. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16807. } while (0)
  16808. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16809. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16810. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16811. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16812. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16813. do { \
  16814. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16815. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16816. } while (0)
  16817. /* SOC related stats */
  16818. typedef struct {
  16819. htt_tlv_hdr_t tlv_hdr;
  16820. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16821. * This can be due to either the peer is deleted or deletion is ongoing
  16822. * */
  16823. A_UINT32 inv_peers_msdu_drop_count_lo;
  16824. A_UINT32 inv_peers_msdu_drop_count_hi;
  16825. } htt_t2h_soc_txrx_stats_common_tlv;
  16826. /* VDEV HW Tx/Rx stats */
  16827. typedef struct {
  16828. htt_tlv_hdr_t tlv_hdr;
  16829. A_UINT32 vdev_id;
  16830. /* Rx msdu byte cnt */
  16831. A_UINT32 rx_msdu_byte_cnt_lo;
  16832. A_UINT32 rx_msdu_byte_cnt_hi;
  16833. /* Rx msdu cnt */
  16834. A_UINT32 rx_msdu_cnt_lo;
  16835. A_UINT32 rx_msdu_cnt_hi;
  16836. /* tx msdu byte cnt */
  16837. A_UINT32 tx_msdu_byte_cnt_lo;
  16838. A_UINT32 tx_msdu_byte_cnt_hi;
  16839. /* tx msdu cnt */
  16840. A_UINT32 tx_msdu_cnt_lo;
  16841. A_UINT32 tx_msdu_cnt_hi;
  16842. /* tx excessive retry discarded msdu cnt */
  16843. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16844. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16845. /* TX congestion ctrl msdu drop cnt */
  16846. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16847. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16848. /* discarded tx msdus cnt coz of time to live expiry */
  16849. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16850. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16851. /* tx excessive retry discarded msdu byte cnt */
  16852. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16853. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16854. /* TX congestion ctrl msdu drop byte cnt */
  16855. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16856. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16857. /* discarded tx msdus byte cnt coz of time to live expiry */
  16858. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16859. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16860. /* TQM bypass frame cnt */
  16861. A_UINT32 tqm_bypass_frame_cnt_lo;
  16862. A_UINT32 tqm_bypass_frame_cnt_hi;
  16863. /* TQM bypass byte cnt */
  16864. A_UINT32 tqm_bypass_byte_cnt_lo;
  16865. A_UINT32 tqm_bypass_byte_cnt_hi;
  16866. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16867. /*
  16868. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16869. *
  16870. * @details
  16871. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16872. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16873. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16874. * the default MSDU queues of each of the specified TIDs for the peer
  16875. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16876. * If the default MSDU queues of a given TID within the peer are not linked
  16877. * to a service class, the svc_class_id field for that TID will have a
  16878. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16879. * queues for that TID are not mapped to any service class.
  16880. *
  16881. * |31 16|15 8|7 0|
  16882. * |------------------------------+--------------+--------------|
  16883. * | peer ID | reserved | msg type |
  16884. * |------------------------------+--------------+------+-------|
  16885. * | reserved | svc class ID | TID |
  16886. * |------------------------------------------------------------|
  16887. * ...
  16888. * |------------------------------------------------------------|
  16889. * | reserved | svc class ID | TID |
  16890. * |------------------------------------------------------------|
  16891. * Header fields:
  16892. * dword0 - b'7:0 - msg_type: This will be set to
  16893. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16894. * b'31:16 - peer ID
  16895. * dword1 - b'7:0 - TID
  16896. * b'15:8 - svc class ID
  16897. * (dword2, etc. same format as dword1)
  16898. */
  16899. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16900. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16901. A_UINT32 msg_type :8,
  16902. reserved0 :8,
  16903. peer_id :16;
  16904. struct {
  16905. A_UINT32 tid :8,
  16906. svc_class_id :8,
  16907. reserved1 :16;
  16908. } tid_reports[1/*or more*/];
  16909. } POSTPACK;
  16910. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16911. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16912. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16913. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16914. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16915. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16916. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16917. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16918. do { \
  16919. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16920. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16921. } while (0)
  16922. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16923. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16924. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16925. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16926. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16927. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16928. do { \
  16929. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16930. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16931. } while (0)
  16932. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16933. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16934. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16935. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16936. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16937. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16938. do { \
  16939. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16940. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16941. } while (0)
  16942. /*
  16943. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16944. *
  16945. * @details
  16946. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16947. * flow if the flow is seen the associated service class is conveyed to the
  16948. * target via TCL Data Command. Target on the other hand internally creates the
  16949. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16950. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16951. * the newly created MSDUQ
  16952. *
  16953. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16954. * |------------------------------+------------------------+--------------|
  16955. * | peer ID | HTT qtype | msg type |
  16956. * |---------------------------------+--------------+--+---+-------+------|
  16957. * | reserved |AST list index|FO|WC | HLOS | remap|
  16958. * | | | | | TID | TID |
  16959. * |---------------------+------------------------------------------------|
  16960. * | reserved1 | tgt_opaque_id |
  16961. * |---------------------+------------------------------------------------|
  16962. *
  16963. * Header fields:
  16964. *
  16965. * dword0 - b'7:0 - msg_type: This will be set to
  16966. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16967. * b'15:8 - HTT qtype
  16968. * b'31:16 - peer ID
  16969. *
  16970. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16971. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16972. * hlos_tid : Common to Lithium and Beryllium
  16973. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16974. * TCL Data Command : Beryllium
  16975. * b10 - flow_override (FO), as sent by host in
  16976. * TCL Data Command: Beryllium
  16977. * b11:14 - ast_list_idx
  16978. * Array index into the list of extension AST entries
  16979. * (not the actual AST 16-bit index).
  16980. * The ast_list_idx is one-based, with the following
  16981. * range of values:
  16982. * - legacy targets supporting 16 user-defined
  16983. * MSDU queues: 1-2
  16984. * - legacy targets supporting 48 user-defined
  16985. * MSDU queues: 1-6
  16986. * - new targets: 0 (peer_id is used instead)
  16987. * Note that since ast_list_idx is one-based,
  16988. * the host will need to subtract 1 to use it as an
  16989. * index into a list of extension AST entries.
  16990. * b15:31 - reserved
  16991. *
  16992. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16993. * unique MSDUQ id in firmware
  16994. * b'24:31 - reserved1
  16995. */
  16996. PREPACK struct htt_t2h_sawf_msduq_event {
  16997. A_UINT32 msg_type : 8,
  16998. htt_qtype : 8,
  16999. peer_id :16;
  17000. A_UINT32 remap_tid : 4,
  17001. hlos_tid : 4,
  17002. who_classify_info_sel : 2,
  17003. flow_override : 1,
  17004. ast_list_idx : 4,
  17005. reserved :17;
  17006. A_UINT32 tgt_opaque_id :24,
  17007. reserved1 : 8;
  17008. } POSTPACK;
  17009. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17010. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17011. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17012. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17013. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17014. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17015. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17016. do { \
  17017. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17018. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17019. } while (0)
  17020. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17021. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17022. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17023. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17024. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17025. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17026. do { \
  17027. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17028. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17029. } while (0)
  17030. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17031. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17032. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17033. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17034. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17035. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17036. do { \
  17037. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17038. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17039. } while (0)
  17040. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17041. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17042. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17043. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17044. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17045. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17046. do { \
  17047. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17048. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17049. } while (0)
  17050. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17051. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17052. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17053. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17054. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17055. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17056. do { \
  17057. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17058. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17059. } while (0)
  17060. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17061. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17062. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17063. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17064. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17065. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17066. do { \
  17067. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17068. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17069. } while (0)
  17070. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17071. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17072. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17073. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17074. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17075. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17076. do { \
  17077. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17078. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17079. } while (0)
  17080. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17081. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17082. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17083. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17084. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17085. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17086. do { \
  17087. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17088. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17089. } while (0)
  17090. /**
  17091. * @brief target -> PPDU id format indication
  17092. *
  17093. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17094. *
  17095. * @details
  17096. * The following field definitions describe the format of the HTT target
  17097. * to host PPDU ID format indication message.
  17098. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17099. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17100. * seq_idx :- Sequence control index of this PPDU.
  17101. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17102. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17103. * tqm_cmd:-
  17104. *
  17105. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17106. * |--------------------------------------------------+------------------------|
  17107. * | rsvd0 | msg type |
  17108. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17109. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17110. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17111. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17112. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17113. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17114. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17115. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17116. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17117. * Where: OF = bit offset, NB = number of bits, V = valid
  17118. * The message is interpreted as follows:
  17119. *
  17120. * dword0 - b'7:0 - msg_type: This will be set to
  17121. * HTT_T2H_PPDU_ID_FMT_IND
  17122. * value: 0x30
  17123. *
  17124. * dword0 - b'31:8 - reserved
  17125. *
  17126. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17127. *
  17128. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17129. *
  17130. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17131. *
  17132. * dword1 - b'15:11 - reserved for future use
  17133. *
  17134. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17135. *
  17136. * dword1 - b'21:17 - number of bits in ring_id
  17137. *
  17138. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17139. *
  17140. * dword1 - b'31:27 - reserved for future use
  17141. *
  17142. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17143. *
  17144. * dword2 - b'5:1 - number of bits in sequence index
  17145. *
  17146. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17147. *
  17148. * dword2 - b'15:11 - reserved for future use
  17149. *
  17150. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17151. *
  17152. * dword2 - b'21:17 - number of bits in link_id
  17153. *
  17154. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17155. *
  17156. * dword2 - b'31:27 - reserved for future use
  17157. *
  17158. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17159. *
  17160. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17161. *
  17162. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17163. *
  17164. * dword3 - b'15:11 - reserved for future use
  17165. *
  17166. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17167. *
  17168. * dword3 - b'21:17 - number of bits in tqm_cmd
  17169. *
  17170. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17171. *
  17172. * dword3 - b'31:27 - reserved for future use
  17173. *
  17174. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17175. *
  17176. * dword4 - b'5:1 - number of bits in mac_id
  17177. *
  17178. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17179. *
  17180. * dword4 - b'15:11 - reserved for future use
  17181. *
  17182. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17183. *
  17184. * dword4 - b'21:17 - number of bits in crc
  17185. *
  17186. * dword4 - b'26:22 - offset of crc (in number of bits)
  17187. *
  17188. * dword4 - b'31:27 - reserved for future use
  17189. *
  17190. */
  17191. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17192. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17193. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17194. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17195. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17196. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17197. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17198. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17199. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17200. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17201. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17202. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17203. /* macros for accessing lower 16 bits in dword */
  17204. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17205. do { \
  17206. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17207. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17208. } while (0)
  17209. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17210. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17211. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17212. do { \
  17213. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17214. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17215. } while (0)
  17216. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17217. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17218. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17219. do { \
  17220. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17221. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17222. } while (0)
  17223. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17224. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17225. /* macros for accessing upper 16 bits in dword */
  17226. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17227. do { \
  17228. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17229. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17230. } while (0)
  17231. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17232. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17233. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17234. do { \
  17235. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17236. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17237. } while (0)
  17238. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17239. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17240. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17241. do { \
  17242. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17243. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17244. } while (0)
  17245. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17246. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17247. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17248. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17249. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17250. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17251. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17252. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17253. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17254. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17255. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17256. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17257. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17258. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17259. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17260. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17261. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17262. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17263. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17264. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17265. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17266. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17267. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17268. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17269. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17270. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17271. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17272. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17273. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17274. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17275. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17276. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17277. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17278. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17279. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17280. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17281. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17282. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17283. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17284. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17285. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17286. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17287. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17288. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17289. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17290. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17291. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17292. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17293. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17294. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17295. /* offsets in number dwords */
  17296. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17297. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17298. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17299. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17300. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17301. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17302. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17303. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17304. typedef struct {
  17305. A_UINT32 msg_type: 8, /* bits 7:0 */
  17306. rsvd0: 24;/* bits 31:8 */
  17307. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17308. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17309. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17310. rsvd1: 5, /* bits 15:11 */
  17311. ring_id_valid: 1, /* bits 16:16 */
  17312. ring_id_bits: 5, /* bits 21:17 */
  17313. ring_id_offset: 5, /* bits 26:22 */
  17314. rsvd2: 5; /* bits 31:27 */
  17315. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17316. seq_idx_bits: 5, /* bits 5:1 */
  17317. seq_idx_offset: 5, /* bits 10:6 */
  17318. rsvd3: 5, /* bits 15:11 */
  17319. link_id_valid: 1, /* bits 16:16 */
  17320. link_id_bits: 5, /* bits 21:17 */
  17321. link_id_offset: 5, /* bits 26:22 */
  17322. rsvd4: 5; /* bits 31:27 */
  17323. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17324. seq_cmd_type_bits: 5, /* bits 5:1 */
  17325. seq_cmd_type_offset: 5, /* bits 10:6 */
  17326. rsvd5: 5, /* bits 15:11 */
  17327. tqm_cmd_valid: 1, /* bits 16:16 */
  17328. tqm_cmd_bits: 5, /* bits 21:17 */
  17329. tqm_cmd_offset: 5, /* bits 26:12 */
  17330. rsvd6: 5; /* bits 31:27 */
  17331. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17332. mac_id_bits: 5, /* bits 5:1 */
  17333. mac_id_offset: 5, /* bits 10:6 */
  17334. rsvd8: 5, /* bits 15:11 */
  17335. crc_valid: 1, /* bits 16:16 */
  17336. crc_bits: 5, /* bits 21:17 */
  17337. crc_offset: 5, /* bits 26:12 */
  17338. rsvd9: 5; /* bits 31:27 */
  17339. } htt_t2h_ppdu_id_fmt_ind_t;
  17340. #endif