htt.h 833 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  216. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  217. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  218. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  219. * 3.100 Add htt_tx_wbm_completion_v3 def.
  220. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  221. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  222. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  223. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  224. */
  225. #define HTT_CURRENT_VERSION_MAJOR 3
  226. #define HTT_CURRENT_VERSION_MINOR 104
  227. #define HTT_NUM_TX_FRAG_DESC 1024
  228. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  229. #define HTT_CHECK_SET_VAL(field, val) \
  230. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  231. /* macros to assist in sign-extending fields from HTT messages */
  232. #define HTT_SIGN_BIT_MASK(field) \
  233. ((field ## _M + (1 << field ## _S)) >> 1)
  234. #define HTT_SIGN_BIT(_val, field) \
  235. (_val & HTT_SIGN_BIT_MASK(field))
  236. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  237. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  238. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  239. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  240. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  241. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  242. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  243. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  244. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  245. /*
  246. * TEMPORARY:
  247. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  248. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  249. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  250. * updated.
  251. */
  252. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  253. /*
  254. * TEMPORARY:
  255. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  256. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  257. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  258. * updated.
  259. */
  260. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  261. /*
  262. * htt_dbg_stats_type -
  263. * bit positions for each stats type within a stats type bitmask
  264. * The bitmask contains 24 bits.
  265. */
  266. enum htt_dbg_stats_type {
  267. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  268. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  269. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  270. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  271. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  272. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  273. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  274. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  275. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  276. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  277. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  278. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  279. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  280. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  281. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  282. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  283. /* bits 16-23 currently reserved */
  284. /* keep this last */
  285. HTT_DBG_NUM_STATS
  286. };
  287. /*=== HTT option selection TLVs ===
  288. * Certain HTT messages have alternatives or options.
  289. * For such cases, the host and target need to agree on which option to use.
  290. * Option specification TLVs can be appended to the VERSION_REQ and
  291. * VERSION_CONF messages to select options other than the default.
  292. * These TLVs are entirely optional - if they are not provided, there is a
  293. * well-defined default for each option. If they are provided, they can be
  294. * provided in any order. Each TLV can be present or absent independent of
  295. * the presence / absence of other TLVs.
  296. *
  297. * The HTT option selection TLVs use the following format:
  298. * |31 16|15 8|7 0|
  299. * |---------------------------------+----------------+----------------|
  300. * | value (payload) | length | tag |
  301. * |-------------------------------------------------------------------|
  302. * The value portion need not be only 2 bytes; it can be extended by any
  303. * integer number of 4-byte units. The total length of the TLV, including
  304. * the tag and length fields, must be a multiple of 4 bytes. The length
  305. * field specifies the total TLV size in 4-byte units. Thus, the typical
  306. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  307. * field, would store 0x1 in its length field, to show that the TLV occupies
  308. * a single 4-byte unit.
  309. */
  310. /*--- TLV header format - applies to all HTT option TLVs ---*/
  311. enum HTT_OPTION_TLV_TAGS {
  312. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  313. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  314. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  315. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  316. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  317. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  318. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  319. };
  320. PREPACK struct htt_option_tlv_header_t {
  321. A_UINT8 tag;
  322. A_UINT8 length;
  323. } POSTPACK;
  324. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  325. #define HTT_OPTION_TLV_TAG_S 0
  326. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  327. #define HTT_OPTION_TLV_LENGTH_S 8
  328. /*
  329. * value0 - 16 bit value field stored in word0
  330. * The TLV's value field may be longer than 2 bytes, in which case
  331. * the remainder of the value is stored in word1, word2, etc.
  332. */
  333. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  334. #define HTT_OPTION_TLV_VALUE0_S 16
  335. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  336. do { \
  337. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  338. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  339. } while (0)
  340. #define HTT_OPTION_TLV_TAG_GET(word) \
  341. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  342. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  348. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  349. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  350. do { \
  351. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  352. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  353. } while (0)
  354. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  355. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  356. /*--- format of specific HTT option TLVs ---*/
  357. /*
  358. * HTT option TLV for specifying LL bus address size
  359. * Some chips require bus addresses used by the target to access buffers
  360. * within the host's memory to be 32 bits; others require bus addresses
  361. * used by the target to access buffers within the host's memory to be
  362. * 64 bits.
  363. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  364. * a suffix to the VERSION_CONF message to specify which bus address format
  365. * the target requires.
  366. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  367. * default to providing bus addresses to the target in 32-bit format.
  368. */
  369. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  370. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  371. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  372. };
  373. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  374. struct htt_option_tlv_header_t hdr;
  375. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  376. } POSTPACK;
  377. /*
  378. * HTT option TLV for specifying whether HL systems should indicate
  379. * over-the-air tx completion for individual frames, or should instead
  380. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  381. * requests an OTA tx completion for a particular tx frame.
  382. * This option does not apply to LL systems, where the TX_COMPL_IND
  383. * is mandatory.
  384. * This option is primarily intended for HL systems in which the tx frame
  385. * downloads over the host --> target bus are as slow as or slower than
  386. * the transmissions over the WLAN PHY. For cases where the bus is faster
  387. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  388. * and consquently will send one TX_COMPL_IND message that covers several
  389. * tx frames. For cases where the WLAN PHY is faster than the bus,
  390. * the target will end up transmitting very short A-MPDUs, and consequently
  391. * sending many TX_COMPL_IND messages, which each cover a very small number
  392. * of tx frames.
  393. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  394. * a suffix to the VERSION_REQ message to request whether the host desires to
  395. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  396. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  397. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  398. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  399. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  400. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  401. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  402. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  403. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  404. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  405. * TLV.
  406. */
  407. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  408. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  409. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  410. };
  411. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  412. struct htt_option_tlv_header_t hdr;
  413. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  414. } POSTPACK;
  415. /*
  416. * HTT option TLV for specifying how many tx queue groups the target
  417. * may establish.
  418. * This TLV specifies the maximum value the target may send in the
  419. * txq_group_id field of any TXQ_GROUP information elements sent by
  420. * the target to the host. This allows the host to pre-allocate an
  421. * appropriate number of tx queue group structs.
  422. *
  423. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  424. * a suffix to the VERSION_REQ message to specify whether the host supports
  425. * tx queue groups at all, and if so if there is any limit on the number of
  426. * tx queue groups that the host supports.
  427. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  428. * a suffix to the VERSION_CONF message. If the host has specified in the
  429. * VER_REQ message a limit on the number of tx queue groups the host can
  430. * supprt, the target shall limit its specification of the maximum tx groups
  431. * to be no larger than this host-specified limit.
  432. *
  433. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  434. * shall preallocate 4 tx queue group structs, and the target shall not
  435. * specify a txq_group_id larger than 3.
  436. */
  437. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  438. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  439. /*
  440. * values 1 through N specify the max number of tx queue groups
  441. * the sender supports
  442. */
  443. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  444. };
  445. /* TEMPORARY backwards-compatibility alias for a typo fix -
  446. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  447. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  448. * to support the old name (with the typo) until all references to the
  449. * old name are replaced with the new name.
  450. */
  451. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  452. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  453. struct htt_option_tlv_header_t hdr;
  454. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  455. } POSTPACK;
  456. /*
  457. * HTT option TLV for specifying whether the target supports an extended
  458. * version of the HTT tx descriptor. If the target provides this TLV
  459. * and specifies in the TLV that the target supports an extended version
  460. * of the HTT tx descriptor, the target must check the "extension" bit in
  461. * the HTT tx descriptor, and if the extension bit is set, to expect a
  462. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  463. * descriptor. Furthermore, the target must provide room for the HTT
  464. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  465. * This option is intended for systems where the host needs to explicitly
  466. * control the transmission parameters such as tx power for individual
  467. * tx frames.
  468. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  469. * as a suffix to the VERSION_CONF message to explicitly specify whether
  470. * the target supports the HTT tx MSDU extension descriptor.
  471. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  472. * by the host as lack of target support for the HTT tx MSDU extension
  473. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  474. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  475. * the HTT tx MSDU extension descriptor.
  476. * The host is not required to provide the HTT tx MSDU extension descriptor
  477. * just because the target supports it; the target must check the
  478. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  479. * extension descriptor is present.
  480. */
  481. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  482. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  483. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  484. };
  485. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  486. struct htt_option_tlv_header_t hdr;
  487. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  488. } POSTPACK;
  489. /*
  490. * For the tcl data command V2 and higher support added a new
  491. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  492. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  493. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  494. * HTT option TLV for specifying which version of the TCL metadata struct
  495. * should be used:
  496. * V1 -> use htt_tx_tcl_metadata struct
  497. * V2 -> use htt_tx_tcl_metadata_v2 struct
  498. * Old FW will only support V1.
  499. * New FW will support V2. New FW will still support V1, at least during
  500. * a transition period.
  501. * Similarly, old host will only support V1, and new host will support V1 + V2.
  502. *
  503. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  504. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  505. * of TCL metadata the host supports. If the host doesn't provide a
  506. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  507. * is implicitly understood that the host only supports V1.
  508. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  509. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  510. * the host shall use. The target shall only select one of the versions
  511. * supported by the host. If the target doesn't provide a
  512. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  513. * is implicitly understood that the V1 TCL metadata shall be used.
  514. */
  515. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  516. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  517. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  518. };
  519. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  520. struct htt_option_tlv_header_t hdr;
  521. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  522. } POSTPACK;
  523. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  524. HTT_OPTION_TLV_VALUE0_SET(word, value)
  525. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  526. HTT_OPTION_TLV_VALUE0_GET(word)
  527. typedef struct {
  528. union {
  529. /* BIT [11 : 0] :- tag
  530. * BIT [23 : 12] :- length
  531. * BIT [31 : 24] :- reserved
  532. */
  533. A_UINT32 tag__length;
  534. /*
  535. * The following struct is not endian-portable.
  536. * It is suitable for use within the target, which is known to be
  537. * little-endian.
  538. * The host should use the above endian-portable macros to access
  539. * the tag and length bitfields in an endian-neutral manner.
  540. */
  541. struct {
  542. A_UINT32 tag : 12, /* BIT [11 : 0] */
  543. length : 12, /* BIT [23 : 12] */
  544. reserved : 8; /* BIT [31 : 24] */
  545. };
  546. };
  547. } htt_tlv_hdr_t;
  548. typedef enum {
  549. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  550. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  551. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  552. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  553. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  554. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  555. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  556. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  557. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  558. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  559. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  560. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  561. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  562. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  563. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  564. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  565. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  566. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  567. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  568. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  569. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  570. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  571. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  572. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  573. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  574. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  575. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  576. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  577. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  578. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  579. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  580. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  581. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  582. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  583. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  584. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  585. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  586. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  587. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  588. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  589. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  590. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  591. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  592. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  593. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  594. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  595. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  596. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  597. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  598. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  599. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  600. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  601. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  602. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  603. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  604. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  605. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  606. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  607. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  608. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  609. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  610. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  611. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  612. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  613. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  614. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  615. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  616. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  617. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  618. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  619. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  620. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  621. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  622. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  623. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  624. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  625. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  626. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  627. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  628. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  629. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  630. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  631. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  632. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  633. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  634. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  635. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  636. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  637. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  638. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  639. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  640. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  641. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  642. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  643. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  644. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  645. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  646. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  647. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  648. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  649. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  650. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  651. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  652. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  653. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  654. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  655. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  656. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  657. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  658. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  659. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  660. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  661. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  662. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  663. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  664. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  665. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  666. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  667. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  668. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  669. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  670. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  671. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  672. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  673. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  674. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  675. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  676. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  677. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  678. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  679. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  680. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  681. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  682. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  683. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  684. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  685. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  686. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  687. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  688. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  689. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  690. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  691. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  692. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  693. HTT_STATS_MAX_TAG,
  694. } htt_tlv_tag_t;
  695. #define HTT_STATS_TLV_TAG_M 0x00000fff
  696. #define HTT_STATS_TLV_TAG_S 0
  697. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  698. #define HTT_STATS_TLV_LENGTH_S 12
  699. #define HTT_STATS_TLV_TAG_GET(_var) \
  700. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  701. HTT_STATS_TLV_TAG_S)
  702. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  703. do { \
  704. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  705. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  706. } while (0)
  707. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  708. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  709. HTT_STATS_TLV_LENGTH_S)
  710. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  711. do { \
  712. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  713. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  714. } while (0)
  715. /*=== host -> target messages ===============================================*/
  716. enum htt_h2t_msg_type {
  717. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  718. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  719. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  720. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  721. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  722. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  723. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  724. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  725. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  726. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  727. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  728. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  729. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  730. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  731. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  732. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  733. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  734. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  735. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  736. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  737. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  738. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  739. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  740. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  741. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  742. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  743. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  744. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  745. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  746. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  747. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  748. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  749. /* keep this last */
  750. HTT_H2T_NUM_MSGS
  751. };
  752. /*
  753. * HTT host to target message type -
  754. * stored in bits 7:0 of the first word of the message
  755. */
  756. #define HTT_H2T_MSG_TYPE_M 0xff
  757. #define HTT_H2T_MSG_TYPE_S 0
  758. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  759. do { \
  760. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  761. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  762. } while (0)
  763. #define HTT_H2T_MSG_TYPE_GET(word) \
  764. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  765. /**
  766. * @brief host -> target version number request message definition
  767. *
  768. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  769. *
  770. *
  771. * |31 24|23 16|15 8|7 0|
  772. * |----------------+----------------+----------------+----------------|
  773. * | reserved | msg type |
  774. * |-------------------------------------------------------------------|
  775. * : option request TLV (optional) |
  776. * :...................................................................:
  777. *
  778. * The VER_REQ message may consist of a single 4-byte word, or may be
  779. * extended with TLVs that specify which HTT options the host is requesting
  780. * from the target.
  781. * The following option TLVs may be appended to the VER_REQ message:
  782. * - HL_SUPPRESS_TX_COMPL_IND
  783. * - HL_MAX_TX_QUEUE_GROUPS
  784. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  785. * may be appended to the VER_REQ message (but only one TLV of each type).
  786. *
  787. * Header fields:
  788. * - MSG_TYPE
  789. * Bits 7:0
  790. * Purpose: identifies this as a version number request message
  791. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  792. */
  793. #define HTT_VER_REQ_BYTES 4
  794. /* TBDXXX: figure out a reasonable number */
  795. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  796. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  797. /**
  798. * @brief HTT tx MSDU descriptor
  799. *
  800. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  801. *
  802. * @details
  803. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  804. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  805. * the target firmware needs for the FW's tx processing, particularly
  806. * for creating the HW msdu descriptor.
  807. * The same HTT tx descriptor is used for HL and LL systems, though
  808. * a few fields within the tx descriptor are used only by LL or
  809. * only by HL.
  810. * The HTT tx descriptor is defined in two manners: by a struct with
  811. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  812. * definitions.
  813. * The target should use the struct def, for simplicitly and clarity,
  814. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  815. * neutral. Specifically, the host shall use the get/set macros built
  816. * around the mask + shift defs.
  817. */
  818. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  819. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  820. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  821. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  822. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  823. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  824. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  825. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  826. #define HTT_TX_VDEV_ID_WORD 0
  827. #define HTT_TX_VDEV_ID_MASK 0x3f
  828. #define HTT_TX_VDEV_ID_SHIFT 16
  829. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  830. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  831. #define HTT_TX_MSDU_LEN_DWORD 1
  832. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  833. /*
  834. * HTT_VAR_PADDR macros
  835. * Allow physical / bus addresses to be either a single 32-bit value,
  836. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  837. */
  838. #define HTT_VAR_PADDR32(var_name) \
  839. A_UINT32 var_name
  840. #define HTT_VAR_PADDR64_LE(var_name) \
  841. struct { \
  842. /* little-endian: lo precedes hi */ \
  843. A_UINT32 lo; \
  844. A_UINT32 hi; \
  845. } var_name
  846. /*
  847. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  848. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  849. * addresses are stored in a XXX-bit field.
  850. * This macro is used to define both htt_tx_msdu_desc32_t and
  851. * htt_tx_msdu_desc64_t structs.
  852. */
  853. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  854. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  855. { \
  856. /* DWORD 0: flags and meta-data */ \
  857. A_UINT32 \
  858. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  859. \
  860. /* pkt_subtype - \
  861. * Detailed specification of the tx frame contents, extending the \
  862. * general specification provided by pkt_type. \
  863. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  864. * pkt_type | pkt_subtype \
  865. * ============================================================== \
  866. * 802.3 | bit 0:3 - Reserved \
  867. * | bit 4: 0x0 - Copy-Engine Classification Results \
  868. * | not appended to the HTT message \
  869. * | 0x1 - Copy-Engine Classification Results \
  870. * | appended to the HTT message in the \
  871. * | format: \
  872. * | [HTT tx desc, frame header, \
  873. * | CE classification results] \
  874. * | The CE classification results begin \
  875. * | at the next 4-byte boundary after \
  876. * | the frame header. \
  877. * ------------+------------------------------------------------- \
  878. * Eth2 | bit 0:3 - Reserved \
  879. * | bit 4: 0x0 - Copy-Engine Classification Results \
  880. * | not appended to the HTT message \
  881. * | 0x1 - Copy-Engine Classification Results \
  882. * | appended to the HTT message. \
  883. * | See the above specification of the \
  884. * | CE classification results location. \
  885. * ------------+------------------------------------------------- \
  886. * native WiFi | bit 0:3 - Reserved \
  887. * | bit 4: 0x0 - Copy-Engine Classification Results \
  888. * | not appended to the HTT message \
  889. * | 0x1 - Copy-Engine Classification Results \
  890. * | appended to the HTT message. \
  891. * | See the above specification of the \
  892. * | CE classification results location. \
  893. * ------------+------------------------------------------------- \
  894. * mgmt | 0x0 - 802.11 MAC header absent \
  895. * | 0x1 - 802.11 MAC header present \
  896. * ------------+------------------------------------------------- \
  897. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  898. * | 0x1 - 802.11 MAC header present \
  899. * | bit 1: 0x0 - allow aggregation \
  900. * | 0x1 - don't allow aggregation \
  901. * | bit 2: 0x0 - perform encryption \
  902. * | 0x1 - don't perform encryption \
  903. * | bit 3: 0x0 - perform tx classification / queuing \
  904. * | 0x1 - don't perform tx classification; \
  905. * | insert the frame into the "misc" \
  906. * | tx queue \
  907. * | bit 4: 0x0 - Copy-Engine Classification Results \
  908. * | not appended to the HTT message \
  909. * | 0x1 - Copy-Engine Classification Results \
  910. * | appended to the HTT message. \
  911. * | See the above specification of the \
  912. * | CE classification results location. \
  913. */ \
  914. pkt_subtype: 5, \
  915. \
  916. /* pkt_type - \
  917. * General specification of the tx frame contents. \
  918. * The htt_pkt_type enum should be used to specify and check the \
  919. * value of this field. \
  920. */ \
  921. pkt_type: 3, \
  922. \
  923. /* vdev_id - \
  924. * ID for the vdev that is sending this tx frame. \
  925. * For certain non-standard packet types, e.g. pkt_type == raw \
  926. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  927. * This field is used primarily for determining where to queue \
  928. * broadcast and multicast frames. \
  929. */ \
  930. vdev_id: 6, \
  931. /* ext_tid - \
  932. * The extended traffic ID. \
  933. * If the TID is unknown, the extended TID is set to \
  934. * HTT_TX_EXT_TID_INVALID. \
  935. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  936. * value of the QoS TID. \
  937. * If the tx frame is non-QoS data, then the extended TID is set to \
  938. * HTT_TX_EXT_TID_NON_QOS. \
  939. * If the tx frame is multicast or broadcast, then the extended TID \
  940. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  941. */ \
  942. ext_tid: 5, \
  943. \
  944. /* postponed - \
  945. * This flag indicates whether the tx frame has been downloaded to \
  946. * the target before but discarded by the target, and now is being \
  947. * downloaded again; or if this is a new frame that is being \
  948. * downloaded for the first time. \
  949. * This flag allows the target to determine the correct order for \
  950. * transmitting new vs. old frames. \
  951. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  952. * This flag only applies to HL systems, since in LL systems, \
  953. * the tx flow control is handled entirely within the target. \
  954. */ \
  955. postponed: 1, \
  956. \
  957. /* extension - \
  958. * This flag indicates whether a HTT tx MSDU extension descriptor \
  959. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  960. * \
  961. * 0x0 - no extension MSDU descriptor is present \
  962. * 0x1 - an extension MSDU descriptor immediately follows the \
  963. * regular MSDU descriptor \
  964. */ \
  965. extension: 1, \
  966. \
  967. /* cksum_offload - \
  968. * This flag indicates whether checksum offload is enabled or not \
  969. * for this frame. Target FW use this flag to turn on HW checksumming \
  970. * 0x0 - No checksum offload \
  971. * 0x1 - L3 header checksum only \
  972. * 0x2 - L4 checksum only \
  973. * 0x3 - L3 header checksum + L4 checksum \
  974. */ \
  975. cksum_offload: 2, \
  976. \
  977. /* tx_comp_req - \
  978. * This flag indicates whether Tx Completion \
  979. * from fw is required or not. \
  980. * This flag is only relevant if tx completion is not \
  981. * universally enabled. \
  982. * For all LL systems, tx completion is mandatory, \
  983. * so this flag will be irrelevant. \
  984. * For HL systems tx completion is optional, but HL systems in which \
  985. * the bus throughput exceeds the WLAN throughput will \
  986. * probably want to always use tx completion, and thus \
  987. * would not check this flag. \
  988. * This flag is required when tx completions are not used universally, \
  989. * but are still required for certain tx frames for which \
  990. * an OTA delivery acknowledgment is needed by the host. \
  991. * In practice, this would be for HL systems in which the \
  992. * bus throughput is less than the WLAN throughput. \
  993. * \
  994. * 0x0 - Tx Completion Indication from Fw not required \
  995. * 0x1 - Tx Completion Indication from Fw is required \
  996. */ \
  997. tx_compl_req: 1; \
  998. \
  999. \
  1000. /* DWORD 1: MSDU length and ID */ \
  1001. A_UINT32 \
  1002. len: 16, /* MSDU length, in bytes */ \
  1003. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1004. * and this id is used to calculate fragmentation \
  1005. * descriptor pointer inside the target based on \
  1006. * the base address, configured inside the target. \
  1007. */ \
  1008. \
  1009. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1010. /* frags_desc_ptr - \
  1011. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1012. * where the tx frame's fragments reside in memory. \
  1013. * This field only applies to LL systems, since in HL systems the \
  1014. * (degenerate single-fragment) fragmentation descriptor is created \
  1015. * within the target. \
  1016. */ \
  1017. _paddr__frags_desc_ptr_; \
  1018. \
  1019. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1020. /* \
  1021. * Peer ID : Target can use this value to know which peer-id packet \
  1022. * destined to. \
  1023. * It's intended to be specified by host in case of NAWDS. \
  1024. */ \
  1025. A_UINT16 peerid; \
  1026. \
  1027. /* \
  1028. * Channel frequency: This identifies the desired channel \
  1029. * frequency (in mhz) for tx frames. This is used by FW to help \
  1030. * determine when it is safe to transmit or drop frames for \
  1031. * off-channel operation. \
  1032. * The default value of zero indicates to FW that the corresponding \
  1033. * VDEV's home channel (if there is one) is the desired channel \
  1034. * frequency. \
  1035. */ \
  1036. A_UINT16 chanfreq; \
  1037. \
  1038. /* Reason reserved is commented is increasing the htt structure size \
  1039. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1040. * A_UINT32 reserved_dword3_bits0_31; \
  1041. */ \
  1042. } POSTPACK
  1043. /* define a htt_tx_msdu_desc32_t type */
  1044. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1045. /* define a htt_tx_msdu_desc64_t type */
  1046. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1047. /*
  1048. * Make htt_tx_msdu_desc_t be an alias for either
  1049. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1050. */
  1051. #if HTT_PADDR64
  1052. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1053. #else
  1054. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1055. #endif
  1056. /* decriptor information for Management frame*/
  1057. /*
  1058. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1059. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1060. */
  1061. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1062. extern A_UINT32 mgmt_hdr_len;
  1063. PREPACK struct htt_mgmt_tx_desc_t {
  1064. A_UINT32 msg_type;
  1065. #if HTT_PADDR64
  1066. A_UINT64 frag_paddr; /* DMAble address of the data */
  1067. #else
  1068. A_UINT32 frag_paddr; /* DMAble address of the data */
  1069. #endif
  1070. A_UINT32 desc_id; /* returned to host during completion
  1071. * to free the meory*/
  1072. A_UINT32 len; /* Fragment length */
  1073. A_UINT32 vdev_id; /* virtual device ID*/
  1074. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1075. } POSTPACK;
  1076. PREPACK struct htt_mgmt_tx_compl_ind {
  1077. A_UINT32 desc_id;
  1078. A_UINT32 status;
  1079. } POSTPACK;
  1080. /*
  1081. * This SDU header size comes from the summation of the following:
  1082. * 1. Max of:
  1083. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1084. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1085. * b. 802.11 header, for raw frames: 36 bytes
  1086. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1087. * QoS header, HT header)
  1088. * c. 802.3 header, for ethernet frames: 14 bytes
  1089. * (destination address, source address, ethertype / length)
  1090. * 2. Max of:
  1091. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1092. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1093. * 3. 802.1Q VLAN header: 4 bytes
  1094. * 4. LLC/SNAP header: 8 bytes
  1095. */
  1096. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1097. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1098. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1099. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1100. A_COMPILE_TIME_ASSERT(
  1101. htt_encap_hdr_size_max_check_nwifi,
  1102. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1103. A_COMPILE_TIME_ASSERT(
  1104. htt_encap_hdr_size_max_check_enet,
  1105. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1106. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1107. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1108. #define HTT_TX_HDR_SIZE_802_1Q 4
  1109. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1110. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1111. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1112. HTT_TX_HDR_SIZE_802_1Q + \
  1113. HTT_TX_HDR_SIZE_LLC_SNAP)
  1114. #define HTT_HL_TX_FRM_HDR_LEN \
  1115. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1116. #define HTT_LL_TX_FRM_HDR_LEN \
  1117. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1118. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1119. /* dword 0 */
  1120. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1121. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1122. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1123. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1124. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1125. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1126. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1127. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1128. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1129. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1130. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1131. #define HTT_TX_DESC_PKT_TYPE_S 13
  1132. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1133. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1134. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1135. #define HTT_TX_DESC_VDEV_ID_S 16
  1136. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1137. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1138. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1139. #define HTT_TX_DESC_EXT_TID_S 22
  1140. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1141. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1142. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1143. #define HTT_TX_DESC_POSTPONED_S 27
  1144. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1145. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1146. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1147. #define HTT_TX_DESC_EXTENSION_S 28
  1148. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1149. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1150. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1151. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1152. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1153. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1154. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1155. #define HTT_TX_DESC_TX_COMP_S 31
  1156. /* dword 1 */
  1157. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1158. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1159. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1160. #define HTT_TX_DESC_FRM_LEN_S 0
  1161. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1162. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1163. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1164. #define HTT_TX_DESC_FRM_ID_S 16
  1165. /* dword 2 */
  1166. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1167. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1168. /* for systems using 64-bit format for bus addresses */
  1169. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1170. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1171. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1172. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1173. /* for systems using 32-bit format for bus addresses */
  1174. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1175. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1176. /* dword 3 */
  1177. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1178. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1179. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1180. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1181. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1182. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1183. #if HTT_PADDR64
  1184. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1185. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1186. #else
  1187. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1188. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1189. #endif
  1190. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1191. #define HTT_TX_DESC_PEER_ID_S 0
  1192. /*
  1193. * TEMPORARY:
  1194. * The original definitions for the PEER_ID fields contained typos
  1195. * (with _DESC_PADDR appended to this PEER_ID field name).
  1196. * Retain deprecated original names for PEER_ID fields until all code that
  1197. * refers to them has been updated.
  1198. */
  1199. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1200. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1201. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1202. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1203. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1204. HTT_TX_DESC_PEER_ID_M
  1205. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1206. HTT_TX_DESC_PEER_ID_S
  1207. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1208. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1209. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1210. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1211. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1212. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1213. #if HTT_PADDR64
  1214. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1215. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1216. #else
  1217. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1218. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1219. #endif
  1220. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1221. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1222. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1223. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1224. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1225. do { \
  1226. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1227. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1228. } while (0)
  1229. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1230. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1231. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1232. do { \
  1233. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1234. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1235. } while (0)
  1236. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1237. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1238. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1239. do { \
  1240. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1241. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1242. } while (0)
  1243. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1244. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1245. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1246. do { \
  1247. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1248. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1249. } while (0)
  1250. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1251. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1252. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1253. do { \
  1254. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1255. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1256. } while (0)
  1257. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1258. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1259. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1260. do { \
  1261. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1262. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1263. } while (0)
  1264. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1265. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1266. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1267. do { \
  1268. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1269. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1270. } while (0)
  1271. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1272. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1273. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1274. do { \
  1275. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1276. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1277. } while (0)
  1278. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1279. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1280. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1283. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1284. } while (0)
  1285. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1286. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1287. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1288. do { \
  1289. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1290. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1291. } while (0)
  1292. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1293. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1294. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1295. do { \
  1296. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1297. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1298. } while (0)
  1299. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1300. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1301. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1302. do { \
  1303. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1304. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1305. } while (0)
  1306. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1307. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1308. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1312. } while (0)
  1313. /* enums used in the HTT tx MSDU extension descriptor */
  1314. enum {
  1315. htt_tx_guard_interval_regular = 0,
  1316. htt_tx_guard_interval_short = 1,
  1317. };
  1318. enum {
  1319. htt_tx_preamble_type_ofdm = 0,
  1320. htt_tx_preamble_type_cck = 1,
  1321. htt_tx_preamble_type_ht = 2,
  1322. htt_tx_preamble_type_vht = 3,
  1323. };
  1324. enum {
  1325. htt_tx_bandwidth_5MHz = 0,
  1326. htt_tx_bandwidth_10MHz = 1,
  1327. htt_tx_bandwidth_20MHz = 2,
  1328. htt_tx_bandwidth_40MHz = 3,
  1329. htt_tx_bandwidth_80MHz = 4,
  1330. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1331. };
  1332. /**
  1333. * @brief HTT tx MSDU extension descriptor
  1334. * @details
  1335. * If the target supports HTT tx MSDU extension descriptors, the host has
  1336. * the option of appending the following struct following the regular
  1337. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1338. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1339. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1340. * tx specs for each frame.
  1341. */
  1342. PREPACK struct htt_tx_msdu_desc_ext_t {
  1343. /* DWORD 0: flags */
  1344. A_UINT32
  1345. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1346. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1347. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1348. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1349. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1350. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1351. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1352. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1353. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1354. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1355. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1356. /* DWORD 1: tx power, tx rate, tx BW */
  1357. A_UINT32
  1358. /* pwr -
  1359. * Specify what power the tx frame needs to be transmitted at.
  1360. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1361. * The value needs to be appropriately sign-extended when extracting
  1362. * the value from the message and storing it in a variable that is
  1363. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1364. * automatically handles this sign-extension.)
  1365. * If the transmission uses multiple tx chains, this power spec is
  1366. * the total transmit power, assuming incoherent combination of
  1367. * per-chain power to produce the total power.
  1368. */
  1369. pwr: 8,
  1370. /* mcs_mask -
  1371. * Specify the allowable values for MCS index (modulation and coding)
  1372. * to use for transmitting the frame.
  1373. *
  1374. * For HT / VHT preamble types, this mask directly corresponds to
  1375. * the HT or VHT MCS indices that are allowed. For each bit N set
  1376. * within the mask, MCS index N is allowed for transmitting the frame.
  1377. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1378. * rates versus OFDM rates, so the host has the option of specifying
  1379. * that the target must transmit the frame with CCK or OFDM rates
  1380. * (not HT or VHT), but leaving the decision to the target whether
  1381. * to use CCK or OFDM.
  1382. *
  1383. * For CCK and OFDM, the bits within this mask are interpreted as
  1384. * follows:
  1385. * bit 0 -> CCK 1 Mbps rate is allowed
  1386. * bit 1 -> CCK 2 Mbps rate is allowed
  1387. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1388. * bit 3 -> CCK 11 Mbps rate is allowed
  1389. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1390. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1391. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1392. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1393. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1394. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1395. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1396. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1397. *
  1398. * The MCS index specification needs to be compatible with the
  1399. * bandwidth mask specification. For example, a MCS index == 9
  1400. * specification is inconsistent with a preamble type == VHT,
  1401. * Nss == 1, and channel bandwidth == 20 MHz.
  1402. *
  1403. * Furthermore, the host has only a limited ability to specify to
  1404. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1405. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1406. */
  1407. mcs_mask: 12,
  1408. /* nss_mask -
  1409. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1410. * Each bit in this mask corresponds to a Nss value:
  1411. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1412. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1413. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1414. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1415. * The values in the Nss mask must be suitable for the recipient, e.g.
  1416. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1417. * recipient which only supports 2x2 MIMO.
  1418. */
  1419. nss_mask: 4,
  1420. /* guard_interval -
  1421. * Specify a htt_tx_guard_interval enum value to indicate whether
  1422. * the transmission should use a regular guard interval or a
  1423. * short guard interval.
  1424. */
  1425. guard_interval: 1,
  1426. /* preamble_type_mask -
  1427. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1428. * may choose from for transmitting this frame.
  1429. * The bits in this mask correspond to the values in the
  1430. * htt_tx_preamble_type enum. For example, to allow the target
  1431. * to transmit the frame as either CCK or OFDM, this field would
  1432. * be set to
  1433. * (1 << htt_tx_preamble_type_ofdm) |
  1434. * (1 << htt_tx_preamble_type_cck)
  1435. */
  1436. preamble_type_mask: 4,
  1437. reserved1_31_29: 3; /* unused, set to 0x0 */
  1438. /* DWORD 2: tx chain mask, tx retries */
  1439. A_UINT32
  1440. /* chain_mask - specify which chains to transmit from */
  1441. chain_mask: 4,
  1442. /* retry_limit -
  1443. * Specify the maximum number of transmissions, including the
  1444. * initial transmission, to attempt before giving up if no ack
  1445. * is received.
  1446. * If the tx rate is specified, then all retries shall use the
  1447. * same rate as the initial transmission.
  1448. * If no tx rate is specified, the target can choose whether to
  1449. * retain the original rate during the retransmissions, or to
  1450. * fall back to a more robust rate.
  1451. */
  1452. retry_limit: 4,
  1453. /* bandwidth_mask -
  1454. * Specify what channel widths may be used for the transmission.
  1455. * A value of zero indicates "don't care" - the target may choose
  1456. * the transmission bandwidth.
  1457. * The bits within this mask correspond to the htt_tx_bandwidth
  1458. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1459. * The bandwidth_mask must be consistent with the preamble_type_mask
  1460. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1461. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1462. */
  1463. bandwidth_mask: 6,
  1464. reserved2_31_14: 18; /* unused, set to 0x0 */
  1465. /* DWORD 3: tx expiry time (TSF) LSBs */
  1466. A_UINT32 expire_tsf_lo;
  1467. /* DWORD 4: tx expiry time (TSF) MSBs */
  1468. A_UINT32 expire_tsf_hi;
  1469. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1470. } POSTPACK;
  1471. /* DWORD 0 */
  1472. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1473. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1475. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1476. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1487. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1490. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1491. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1492. /* DWORD 1 */
  1493. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1494. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1495. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1496. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1497. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1498. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1499. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1500. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1501. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1502. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1503. /* DWORD 2 */
  1504. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1505. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1506. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1507. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1508. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1509. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1510. /* DWORD 0 */
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1512. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1513. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1515. do { \
  1516. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1517. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1518. } while (0)
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1520. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1521. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1523. do { \
  1524. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1525. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1526. } while (0)
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1528. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1529. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1531. do { \
  1532. HTT_CHECK_SET_VAL( \
  1533. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1534. ((_var) |= ((_val) \
  1535. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1536. } while (0)
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1538. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1539. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1541. do { \
  1542. HTT_CHECK_SET_VAL( \
  1543. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1544. ((_var) |= ((_val) \
  1545. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1546. } while (0)
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1548. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1549. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1551. do { \
  1552. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1553. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1554. } while (0)
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1556. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1557. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1559. do { \
  1560. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1561. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1562. } while (0)
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1564. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1565. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1567. do { \
  1568. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1569. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1570. } while (0)
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1572. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1573. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1574. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1575. do { \
  1576. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1577. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1578. } while (0)
  1579. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1580. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1581. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1582. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1583. do { \
  1584. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1585. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1586. } while (0)
  1587. /* DWORD 1 */
  1588. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1590. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1591. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1592. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1593. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1594. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1595. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1596. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1597. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1598. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1599. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1600. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1601. do { \
  1602. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1603. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1604. } while (0)
  1605. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1606. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1607. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1608. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1609. do { \
  1610. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1611. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1612. } while (0)
  1613. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1614. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1615. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1616. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1617. do { \
  1618. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1619. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1620. } while (0)
  1621. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1622. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1623. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1624. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1625. do { \
  1626. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1627. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1628. } while (0)
  1629. /* DWORD 2 */
  1630. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1631. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1632. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1633. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1634. do { \
  1635. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1636. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1637. } while (0)
  1638. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1640. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1641. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1642. do { \
  1643. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1644. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1645. } while (0)
  1646. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1647. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1648. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1649. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1650. do { \
  1651. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1652. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1653. } while (0)
  1654. typedef enum {
  1655. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1656. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1657. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1658. } htt_11ax_ltf_subtype_t;
  1659. typedef enum {
  1660. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1661. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1662. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1663. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1664. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1665. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1666. } htt_tx_ext2_preamble_type_t;
  1667. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1668. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1669. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1670. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1671. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1672. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1673. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1674. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1675. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1676. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1677. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1678. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1679. /**
  1680. * @brief HTT tx MSDU extension descriptor v2
  1681. * @details
  1682. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1683. * is received as tcl_exit_base->host_meta_info in firmware.
  1684. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1685. * are already part of tcl_exit_base.
  1686. */
  1687. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1688. /* DWORD 0: flags */
  1689. A_UINT32
  1690. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1691. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1692. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1693. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1694. valid_retries : 1, /* if set, tx retries spec is valid */
  1695. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1696. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1697. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1698. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1699. valid_key_flags : 1, /* if set, key flags is valid */
  1700. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1701. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1702. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1703. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1704. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1705. 1 = ENCRYPT,
  1706. 2 ~ 3 - Reserved */
  1707. /* retry_limit -
  1708. * Specify the maximum number of transmissions, including the
  1709. * initial transmission, to attempt before giving up if no ack
  1710. * is received.
  1711. * If the tx rate is specified, then all retries shall use the
  1712. * same rate as the initial transmission.
  1713. * If no tx rate is specified, the target can choose whether to
  1714. * retain the original rate during the retransmissions, or to
  1715. * fall back to a more robust rate.
  1716. */
  1717. retry_limit : 4,
  1718. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1719. * Valid only for 11ax preamble types HE_SU
  1720. * and HE_EXT_SU
  1721. */
  1722. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1723. * Valid only for 11ax preamble types HE_SU
  1724. * and HE_EXT_SU
  1725. */
  1726. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1727. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1728. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1729. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1730. */
  1731. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1732. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1733. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1734. * Use cases:
  1735. * Any time firmware uses TQM-BYPASS for Data
  1736. * TID, firmware expect host to set this bit.
  1737. */
  1738. /* DWORD 1: tx power, tx rate */
  1739. A_UINT32
  1740. power : 8, /* unit of the power field is 0.5 dbm
  1741. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1742. * signed value ranging from -64dbm to 63.5 dbm
  1743. */
  1744. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1745. * Setting more than one MCS isn't currently
  1746. * supported by the target (but is supported
  1747. * in the interface in case in the future
  1748. * the target supports specifications of
  1749. * a limited set of MCS values.
  1750. */
  1751. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1752. * Setting more than one Nss isn't currently
  1753. * supported by the target (but is supported
  1754. * in the interface in case in the future
  1755. * the target supports specifications of
  1756. * a limited set of Nss values.
  1757. */
  1758. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1759. update_peer_cache : 1; /* When set these custom values will be
  1760. * used for all packets, until the next
  1761. * update via this ext header.
  1762. * This is to make sure not all packets
  1763. * need to include this header.
  1764. */
  1765. /* DWORD 2: tx chain mask, tx retries */
  1766. A_UINT32
  1767. /* chain_mask - specify which chains to transmit from */
  1768. chain_mask : 8,
  1769. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1770. * TODO: Update Enum values for key_flags
  1771. */
  1772. /*
  1773. * Channel frequency: This identifies the desired channel
  1774. * frequency (in MHz) for tx frames. This is used by FW to help
  1775. * determine when it is safe to transmit or drop frames for
  1776. * off-channel operation.
  1777. * The default value of zero indicates to FW that the corresponding
  1778. * VDEV's home channel (if there is one) is the desired channel
  1779. * frequency.
  1780. */
  1781. chanfreq : 16;
  1782. /* DWORD 3: tx expiry time (TSF) LSBs */
  1783. A_UINT32 expire_tsf_lo;
  1784. /* DWORD 4: tx expiry time (TSF) MSBs */
  1785. A_UINT32 expire_tsf_hi;
  1786. /* DWORD 5: flags to control routing / processing of the MSDU */
  1787. A_UINT32
  1788. /* learning_frame
  1789. * When this flag is set, this frame will be dropped by FW
  1790. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1791. */
  1792. learning_frame : 1,
  1793. /* send_as_standalone
  1794. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1795. * i.e. with no A-MSDU or A-MPDU aggregation.
  1796. * The scope is extended to other use-cases.
  1797. */
  1798. send_as_standalone : 1,
  1799. /* is_host_opaque_valid
  1800. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1801. * with valid information.
  1802. */
  1803. is_host_opaque_valid : 1,
  1804. rsvd0 : 29;
  1805. /* DWORD 6 : Host opaque cookie for special frames */
  1806. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1807. rsvd1 : 16;
  1808. /*
  1809. * This structure can be expanded further up to 40 bytes
  1810. * by adding further DWORDs as needed.
  1811. */
  1812. } POSTPACK;
  1813. /* DWORD 0 */
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1839. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1840. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1841. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1842. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1843. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1844. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1845. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1846. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1847. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1848. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1849. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1850. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1851. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1852. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1853. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1854. /* DWORD 1 */
  1855. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1856. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1857. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1858. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1859. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1860. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1861. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1862. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1863. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1864. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1865. /* DWORD 2 */
  1866. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1867. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1868. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1869. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1870. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1871. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1872. /* DWORD 5 */
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1879. /* DWORD 6 */
  1880. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1881. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1882. /* DWORD 0 */
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1884. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1885. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1889. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1890. } while (0)
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1892. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1893. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1895. do { \
  1896. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1897. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1898. } while (0)
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1900. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1901. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1903. do { \
  1904. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1905. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1906. } while (0)
  1907. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1908. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1909. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1910. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1911. do { \
  1912. HTT_CHECK_SET_VAL( \
  1913. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1914. ((_var) |= ((_val) \
  1915. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1916. } while (0)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1918. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1919. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1923. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1924. } while (0)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1926. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1927. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1931. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1932. } while (0)
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1934. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1935. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1937. do { \
  1938. HTT_CHECK_SET_VAL( \
  1939. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1940. ((_var) |= ((_val) \
  1941. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1942. } while (0)
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1944. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1945. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1946. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1949. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1950. } while (0)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1952. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1953. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1957. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1958. } while (0)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1960. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1961. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1965. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1966. } while (0)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1968. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1969. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1973. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1974. } while (0)
  1975. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1976. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1977. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1981. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1982. } while (0)
  1983. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1984. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1985. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1986. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1990. } while (0)
  1991. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1992. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1993. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1994. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1998. } while (0)
  1999. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2000. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2001. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2002. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2006. } while (0)
  2007. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2008. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2009. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2010. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2014. } while (0)
  2015. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2016. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2017. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2018. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2022. } while (0)
  2023. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2024. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2025. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2026. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2030. } while (0)
  2031. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2032. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2033. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2034. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2035. do { \
  2036. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2037. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2038. } while (0)
  2039. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2040. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2041. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2042. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2043. do { \
  2044. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2045. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2046. } while (0)
  2047. /* DWORD 1 */
  2048. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2049. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2050. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2051. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2052. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2053. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2054. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2055. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2056. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2057. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2058. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2059. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2060. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2064. } while (0)
  2065. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2066. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2067. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2068. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2072. } while (0)
  2073. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2074. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2075. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2076. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2080. } while (0)
  2081. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2082. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2083. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2084. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2085. do { \
  2086. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2087. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2088. } while (0)
  2089. /* DWORD 2 */
  2090. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2091. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2092. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2093. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2097. } while (0)
  2098. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2099. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2100. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2101. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2102. do { \
  2103. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2104. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2105. } while (0)
  2106. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2107. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2108. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2109. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2110. do { \
  2111. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2112. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2113. } while (0)
  2114. /* DWORD 5 */
  2115. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2116. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2117. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2118. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2119. do { \
  2120. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2121. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2122. } while (0)
  2123. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2124. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2125. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2126. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2127. do { \
  2128. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2129. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2130. } while (0)
  2131. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2132. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2133. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2134. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2135. do { \
  2136. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2137. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2138. } while (0)
  2139. /* DWORD 6 */
  2140. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2141. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2142. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2143. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2144. do { \
  2145. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2146. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2147. } while (0)
  2148. typedef enum {
  2149. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2150. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2151. } htt_tcl_metadata_type;
  2152. /**
  2153. * @brief HTT TCL command number format
  2154. * @details
  2155. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2156. * available to firmware as tcl_exit_base->tcl_status_number.
  2157. * For regular / multicast packets host will send vdev and mac id and for
  2158. * NAWDS packets, host will send peer id.
  2159. * A_UINT32 is used to avoid endianness conversion problems.
  2160. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2161. */
  2162. typedef struct {
  2163. A_UINT32
  2164. type: 1, /* vdev_id based or peer_id based */
  2165. rsvd: 31;
  2166. } htt_tx_tcl_vdev_or_peer_t;
  2167. typedef struct {
  2168. A_UINT32
  2169. type: 1, /* vdev_id based or peer_id based */
  2170. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2171. vdev_id: 8,
  2172. pdev_id: 2,
  2173. host_inspected:1,
  2174. rsvd: 19;
  2175. } htt_tx_tcl_vdev_metadata;
  2176. typedef struct {
  2177. A_UINT32
  2178. type: 1, /* vdev_id based or peer_id based */
  2179. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2180. peer_id: 14,
  2181. rsvd: 16;
  2182. } htt_tx_tcl_peer_metadata;
  2183. PREPACK struct htt_tx_tcl_metadata {
  2184. union {
  2185. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2186. htt_tx_tcl_vdev_metadata vdev_meta;
  2187. htt_tx_tcl_peer_metadata peer_meta;
  2188. };
  2189. } POSTPACK;
  2190. /* DWORD 0 */
  2191. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2192. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2193. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2194. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2195. /* VDEV metadata */
  2196. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2197. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2198. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2199. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2200. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2201. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2202. /* PEER metadata */
  2203. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2204. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2205. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2206. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2207. HTT_TX_TCL_METADATA_TYPE_S)
  2208. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2209. do { \
  2210. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2211. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2212. } while (0)
  2213. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2214. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2215. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2216. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2217. do { \
  2218. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2219. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2220. } while (0)
  2221. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2222. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2223. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2224. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2225. do { \
  2226. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2227. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2228. } while (0)
  2229. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2230. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2231. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2232. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2233. do { \
  2234. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2235. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2236. } while (0)
  2237. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2238. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2239. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2240. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2241. do { \
  2242. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2243. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2244. } while (0)
  2245. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2246. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2247. HTT_TX_TCL_METADATA_PEER_ID_S)
  2248. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2249. do { \
  2250. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2251. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2252. } while (0)
  2253. /*------------------------------------------------------------------
  2254. * V2 Version of TCL Data Command
  2255. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2256. * MLO global_seq all flavours of TCL Data Cmd.
  2257. *-----------------------------------------------------------------*/
  2258. typedef enum {
  2259. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2260. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2261. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2262. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2263. } htt_tcl_metadata_type_v2;
  2264. /**
  2265. * @brief HTT TCL command number format
  2266. * @details
  2267. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2268. * available to firmware as tcl_exit_base->tcl_status_number.
  2269. * A_UINT32 is used to avoid endianness conversion problems.
  2270. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2271. */
  2272. typedef struct {
  2273. A_UINT32
  2274. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2275. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2276. vdev_id: 8,
  2277. pdev_id: 2,
  2278. host_inspected:1,
  2279. rsvd: 2,
  2280. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2281. } htt_tx_tcl_vdev_metadata_v2;
  2282. typedef struct {
  2283. A_UINT32
  2284. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2285. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2286. peer_id: 13,
  2287. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2288. } htt_tx_tcl_peer_metadata_v2;
  2289. typedef struct {
  2290. A_UINT32
  2291. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2292. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2293. svc_class_id: 8,
  2294. rsvd: 5,
  2295. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2296. } htt_tx_tcl_svc_class_id_metadata;
  2297. typedef struct {
  2298. A_UINT32
  2299. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2300. host_inspected: 1,
  2301. global_seq_no: 12,
  2302. rsvd: 1,
  2303. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2304. } htt_tx_tcl_global_seq_metadata;
  2305. PREPACK struct htt_tx_tcl_metadata_v2 {
  2306. union {
  2307. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2308. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2309. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2310. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2311. };
  2312. } POSTPACK;
  2313. /* DWORD 0 */
  2314. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2315. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2316. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2317. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2318. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2319. /* VDEV V2 metadata */
  2320. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2321. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2322. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2323. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2324. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2325. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2326. /* PEER V2 metadata */
  2327. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2328. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2329. /* SVC_CLASS_ID metadata */
  2330. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2331. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2332. /* Global Seq no metadata */
  2333. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2334. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2335. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2336. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2337. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2338. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2339. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2340. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2341. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2342. do { \
  2343. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2344. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2345. } while (0)
  2346. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2347. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2348. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2349. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2350. do { \
  2351. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2352. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2353. } while (0)
  2354. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2355. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2356. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2357. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2358. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2359. do { \
  2360. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2361. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2362. } while (0)
  2363. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2364. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2365. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2366. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2367. do { \
  2368. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2369. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2370. } while (0)
  2371. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2372. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2373. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2374. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2375. do { \
  2376. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2377. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2378. } while (0)
  2379. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2380. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2381. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2382. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2383. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2384. do { \
  2385. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2386. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2387. } while (0)
  2388. /*----- Get and Set V2 type field in Service Class fields ----*/
  2389. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2390. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2391. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2392. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2393. do { \
  2394. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2395. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2396. } while (0)
  2397. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2398. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2399. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2400. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2401. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2402. do { \
  2403. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2404. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2405. } while (0)
  2406. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2407. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2408. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2409. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2410. do { \
  2411. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2412. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2413. } while (0)
  2414. /*------------------------------------------------------------------
  2415. * End V2 Version of TCL Data Command
  2416. *-----------------------------------------------------------------*/
  2417. typedef enum {
  2418. HTT_TX_FW2WBM_TX_STATUS_OK,
  2419. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2420. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2421. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2422. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2423. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2424. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2425. HTT_TX_FW2WBM_TX_STATUS_MAX
  2426. } htt_tx_fw2wbm_tx_status_t;
  2427. typedef enum {
  2428. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2429. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2430. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2431. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2432. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2433. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2434. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2435. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2436. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2437. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2438. } htt_tx_fw2wbm_reinject_reason_t;
  2439. /**
  2440. * @brief HTT TX WBM Completion from firmware to host
  2441. * @details
  2442. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2443. * DWORD 3 and 4 for software based completions (Exception frames and
  2444. * TQM bypass frames)
  2445. * For software based completions, wbm_release_ring->release_source_module will
  2446. * be set to release_source_fw
  2447. */
  2448. PREPACK struct htt_tx_wbm_completion {
  2449. A_UINT32
  2450. sch_cmd_id: 24,
  2451. exception_frame: 1, /* If set, this packet was queued via exception path */
  2452. rsvd0_31_25: 7;
  2453. A_UINT32
  2454. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2455. * reception of an ACK or BA, this field indicates
  2456. * the RSSI of the received ACK or BA frame.
  2457. * When the frame is removed as result of a direct
  2458. * remove command from the SW, this field is set
  2459. * to 0x0 (which is never a valid value when real
  2460. * RSSI is available).
  2461. * Units: dB w.r.t noise floor
  2462. */
  2463. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2464. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2465. rsvd1_31_16: 16;
  2466. } POSTPACK;
  2467. /* DWORD 0 */
  2468. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2469. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2470. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2471. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2472. /* DWORD 1 */
  2473. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2474. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2475. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2476. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2477. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2478. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2479. /* DWORD 0 */
  2480. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2481. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2482. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2483. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2484. do { \
  2485. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2486. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2487. } while (0)
  2488. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2489. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2490. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2491. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2492. do { \
  2493. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2494. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2495. } while (0)
  2496. /* DWORD 1 */
  2497. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2498. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2499. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2500. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2501. do { \
  2502. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2503. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2504. } while (0)
  2505. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2506. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2507. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2508. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2509. do { \
  2510. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2511. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2512. } while (0)
  2513. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2514. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2515. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2516. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2517. do { \
  2518. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2519. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2520. } while (0)
  2521. /**
  2522. * @brief HTT TX WBM Completion from firmware to host
  2523. * @details
  2524. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2525. * (WBM) offload HW.
  2526. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2527. * For software based completions, release_source_module will
  2528. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2529. * struct wbm_release_ring and then switch to this after looking at
  2530. * release_source_module.
  2531. */
  2532. PREPACK struct htt_tx_wbm_completion_v2 {
  2533. A_UINT32
  2534. used_by_hw0; /* Refer to struct wbm_release_ring */
  2535. A_UINT32
  2536. used_by_hw1; /* Refer to struct wbm_release_ring */
  2537. A_UINT32
  2538. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2539. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2540. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2541. exception_frame: 1,
  2542. rsvd0: 12, /* For future use */
  2543. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2544. rsvd1: 1; /* For future use */
  2545. A_UINT32
  2546. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2547. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2548. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2549. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2550. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2551. */
  2552. A_UINT32
  2553. data1: 32;
  2554. A_UINT32
  2555. data2: 32;
  2556. A_UINT32
  2557. used_by_hw3; /* Refer to struct wbm_release_ring */
  2558. } POSTPACK;
  2559. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2560. /* DWORD 3 */
  2561. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2562. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2563. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2564. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2565. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2566. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2567. /* DWORD 3 */
  2568. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2569. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2570. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2571. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2572. do { \
  2573. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2574. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2575. } while (0)
  2576. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2577. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2578. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2579. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2580. do { \
  2581. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2582. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2583. } while (0)
  2584. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2585. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2586. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2587. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2588. do { \
  2589. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2590. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2591. } while (0)
  2592. /**
  2593. * @brief HTT TX WBM Completion from firmware to host (V3)
  2594. * @details
  2595. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2596. * (WBM) offload HW.
  2597. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2598. * For software based completions, release_source_module will
  2599. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2600. * struct wbm_release_ring and then switch to this after looking at
  2601. * release_source_module.
  2602. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2603. * by new generations of targets.
  2604. */
  2605. PREPACK struct htt_tx_wbm_completion_v3 {
  2606. A_UINT32
  2607. used_by_hw0; /* Refer to struct wbm_release_ring */
  2608. A_UINT32
  2609. used_by_hw1; /* Refer to struct wbm_release_ring */
  2610. A_UINT32
  2611. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2612. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2613. used_by_hw3: 15;
  2614. A_UINT32
  2615. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2616. exception_frame: 1,
  2617. rsvd0: 27; /* For future use */
  2618. A_UINT32
  2619. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2620. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2621. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2622. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2623. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2624. */
  2625. A_UINT32
  2626. data1: 32;
  2627. A_UINT32
  2628. data2: 32;
  2629. A_UINT32
  2630. rsvd1: 20,
  2631. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2632. } POSTPACK;
  2633. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2634. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2635. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2636. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2637. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2638. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2639. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2640. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2641. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2642. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2643. do { \
  2644. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2645. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2646. } while (0)
  2647. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2648. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2649. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2650. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2651. do { \
  2652. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2653. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2654. } while (0)
  2655. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2656. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2657. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2658. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2659. do { \
  2660. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2661. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2662. } while (0)
  2663. typedef enum {
  2664. TX_FRAME_TYPE_UNDEFINED = 0,
  2665. TX_FRAME_TYPE_EAPOL = 1,
  2666. } htt_tx_wbm_status_frame_type;
  2667. /**
  2668. * @brief HTT TX WBM transmit status from firmware to host
  2669. * @details
  2670. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2671. * (WBM) offload HW.
  2672. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2673. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2674. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2675. */
  2676. PREPACK struct htt_tx_wbm_transmit_status {
  2677. A_UINT32
  2678. sch_cmd_id: 24,
  2679. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2680. * reception of an ACK or BA, this field indicates
  2681. * the RSSI of the received ACK or BA frame.
  2682. * When the frame is removed as result of a direct
  2683. * remove command from the SW, this field is set
  2684. * to 0x0 (which is never a valid value when real
  2685. * RSSI is available).
  2686. * Units: dB w.r.t noise floor
  2687. */
  2688. A_UINT32
  2689. sw_peer_id: 16,
  2690. tid_num: 5,
  2691. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2692. * and tid_num fields contain valid data.
  2693. * If this "valid" flag is not set, the
  2694. * sw_peer_id and tid_num fields must be ignored.
  2695. */
  2696. mcast: 1,
  2697. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2698. * contains valid data.
  2699. */
  2700. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2701. reserved: 4;
  2702. A_UINT32
  2703. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2704. * packets in the wbm completion path
  2705. */
  2706. } POSTPACK;
  2707. /* DWORD 4 */
  2708. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2709. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2710. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2711. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2712. /* DWORD 5 */
  2713. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2714. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2715. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2716. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2717. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2718. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2719. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2720. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2721. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2722. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2723. /* DWORD 4 */
  2724. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2725. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2726. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2727. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2728. do { \
  2729. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2730. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2731. } while (0)
  2732. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2733. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2734. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2735. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2736. do { \
  2737. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2738. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2739. } while (0)
  2740. /* DWORD 5 */
  2741. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2742. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2743. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2744. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2745. do { \
  2746. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2747. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2748. } while (0)
  2749. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2750. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2751. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2752. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2753. do { \
  2754. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2755. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2756. } while (0)
  2757. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2758. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2759. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2760. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2761. do { \
  2762. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2763. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2764. } while (0)
  2765. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2766. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2767. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2768. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2769. do { \
  2770. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2771. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2772. } while (0)
  2773. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2774. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2775. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2776. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2777. do { \
  2778. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2779. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2780. } while (0)
  2781. /**
  2782. * @brief HTT TX WBM reinject status from firmware to host
  2783. * @details
  2784. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2785. * (WBM) offload HW.
  2786. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2787. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2788. */
  2789. PREPACK struct htt_tx_wbm_reinject_status {
  2790. A_UINT32
  2791. reserved0: 32;
  2792. A_UINT32
  2793. reserved1: 32;
  2794. A_UINT32
  2795. reserved2: 32;
  2796. } POSTPACK;
  2797. /**
  2798. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2799. * @details
  2800. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2801. * (WBM) offload HW.
  2802. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2803. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2804. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2805. * STA side.
  2806. */
  2807. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2808. A_UINT32
  2809. mec_sa_addr_31_0;
  2810. A_UINT32
  2811. mec_sa_addr_47_32: 16,
  2812. sa_ast_index: 16;
  2813. A_UINT32
  2814. vdev_id: 8,
  2815. reserved0: 24;
  2816. } POSTPACK;
  2817. /* DWORD 4 - mec_sa_addr_31_0 */
  2818. /* DWORD 5 */
  2819. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2820. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2821. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2822. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2823. /* DWORD 6 */
  2824. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2825. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2826. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2827. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2828. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2829. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2830. do { \
  2831. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2832. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2833. } while (0)
  2834. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2835. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2836. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2837. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2838. do { \
  2839. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2840. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2841. } while (0)
  2842. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2843. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2844. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2845. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2846. do { \
  2847. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2848. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2849. } while (0)
  2850. typedef enum {
  2851. TX_FLOW_PRIORITY_BE,
  2852. TX_FLOW_PRIORITY_HIGH,
  2853. TX_FLOW_PRIORITY_LOW,
  2854. } htt_tx_flow_priority_t;
  2855. typedef enum {
  2856. TX_FLOW_LATENCY_SENSITIVE,
  2857. TX_FLOW_LATENCY_INSENSITIVE,
  2858. } htt_tx_flow_latency_t;
  2859. typedef enum {
  2860. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2861. TX_FLOW_INTERACTIVE_TRAFFIC,
  2862. TX_FLOW_PERIODIC_TRAFFIC,
  2863. TX_FLOW_BURSTY_TRAFFIC,
  2864. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2865. } htt_tx_flow_traffic_pattern_t;
  2866. /**
  2867. * @brief HTT TX Flow search metadata format
  2868. * @details
  2869. * Host will set this metadata in flow table's flow search entry along with
  2870. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2871. * firmware and TQM ring if the flow search entry wins.
  2872. * This metadata is available to firmware in that first MSDU's
  2873. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2874. * to one of the available flows for specific tid and returns the tqm flow
  2875. * pointer as part of htt_tx_map_flow_info message.
  2876. */
  2877. PREPACK struct htt_tx_flow_metadata {
  2878. A_UINT32
  2879. rsvd0_1_0: 2,
  2880. tid: 4,
  2881. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2882. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2883. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2884. * Else choose final tid based on latency, priority.
  2885. */
  2886. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2887. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2888. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2889. } POSTPACK;
  2890. /* DWORD 0 */
  2891. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2892. #define HTT_TX_FLOW_METADATA_TID_S 2
  2893. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2894. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2895. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2896. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2897. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2898. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2899. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2900. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2901. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2902. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2903. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2904. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2905. /* DWORD 0 */
  2906. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2907. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2908. HTT_TX_FLOW_METADATA_TID_S)
  2909. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2910. do { \
  2911. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2912. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2913. } while (0)
  2914. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2915. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2916. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2917. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2918. do { \
  2919. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2920. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2921. } while (0)
  2922. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2923. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2924. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2925. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2926. do { \
  2927. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2928. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2929. } while (0)
  2930. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2931. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2932. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2933. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2934. do { \
  2935. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2936. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2937. } while (0)
  2938. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2939. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2940. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2941. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2942. do { \
  2943. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2944. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2945. } while (0)
  2946. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2947. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2948. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2949. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2950. do { \
  2951. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2952. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2953. } while (0)
  2954. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2955. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2956. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2957. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2960. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2961. } while (0)
  2962. /**
  2963. * @brief host -> target ADD WDS Entry
  2964. *
  2965. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2966. *
  2967. * @brief host -> target DELETE WDS Entry
  2968. *
  2969. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2970. *
  2971. * @details
  2972. * HTT wds entry from source port learning
  2973. * Host will learn wds entries from rx and send this message to firmware
  2974. * to enable firmware to configure/delete AST entries for wds clients.
  2975. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2976. * and when SA's entry is deleted, firmware removes this AST entry
  2977. *
  2978. * The message would appear as follows:
  2979. *
  2980. * |31 30|29 |17 16|15 8|7 0|
  2981. * |----------------+----------------+----------------+----------------|
  2982. * | rsvd0 |PDVID| vdev_id | msg_type |
  2983. * |-------------------------------------------------------------------|
  2984. * | sa_addr_31_0 |
  2985. * |-------------------------------------------------------------------|
  2986. * | | ta_peer_id | sa_addr_47_32 |
  2987. * |-------------------------------------------------------------------|
  2988. * Where PDVID = pdev_id
  2989. *
  2990. * The message is interpreted as follows:
  2991. *
  2992. * dword0 - b'0:7 - msg_type: This will be set to
  2993. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2994. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2995. *
  2996. * dword0 - b'8:15 - vdev_id
  2997. *
  2998. * dword0 - b'16:17 - pdev_id
  2999. *
  3000. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3001. *
  3002. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3003. *
  3004. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3005. *
  3006. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3007. */
  3008. PREPACK struct htt_wds_entry {
  3009. A_UINT32
  3010. msg_type: 8,
  3011. vdev_id: 8,
  3012. pdev_id: 2,
  3013. rsvd0: 14;
  3014. A_UINT32 sa_addr_31_0;
  3015. A_UINT32
  3016. sa_addr_47_32: 16,
  3017. ta_peer_id: 14,
  3018. rsvd2: 2;
  3019. } POSTPACK;
  3020. /* DWORD 0 */
  3021. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3022. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3023. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3024. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3025. /* DWORD 2 */
  3026. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3027. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3028. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3029. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3030. /* DWORD 0 */
  3031. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3032. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3033. HTT_WDS_ENTRY_VDEV_ID_S)
  3034. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3035. do { \
  3036. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3037. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3038. } while (0)
  3039. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3040. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3041. HTT_WDS_ENTRY_PDEV_ID_S)
  3042. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3043. do { \
  3044. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3045. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3046. } while (0)
  3047. /* DWORD 2 */
  3048. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3049. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3050. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3051. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3052. do { \
  3053. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3054. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3055. } while (0)
  3056. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3057. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3058. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3059. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3060. do { \
  3061. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3062. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3063. } while (0)
  3064. /**
  3065. * @brief MAC DMA rx ring setup specification
  3066. *
  3067. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3068. *
  3069. * @details
  3070. * To allow for dynamic rx ring reconfiguration and to avoid race
  3071. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3072. * it uses. Instead, it sends this message to the target, indicating how
  3073. * the rx ring used by the host should be set up and maintained.
  3074. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3075. * specifications.
  3076. *
  3077. * |31 16|15 8|7 0|
  3078. * |---------------------------------------------------------------|
  3079. * header: | reserved | num rings | msg type |
  3080. * |---------------------------------------------------------------|
  3081. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3082. #if HTT_PADDR64
  3083. * | FW_IDX shadow register physical address (bits 63:32) |
  3084. #endif
  3085. * |---------------------------------------------------------------|
  3086. * | rx ring base physical address (bits 31:0) |
  3087. #if HTT_PADDR64
  3088. * | rx ring base physical address (bits 63:32) |
  3089. #endif
  3090. * |---------------------------------------------------------------|
  3091. * | rx ring buffer size | rx ring length |
  3092. * |---------------------------------------------------------------|
  3093. * | FW_IDX initial value | enabled flags |
  3094. * |---------------------------------------------------------------|
  3095. * | MSDU payload offset | 802.11 header offset |
  3096. * |---------------------------------------------------------------|
  3097. * | PPDU end offset | PPDU start offset |
  3098. * |---------------------------------------------------------------|
  3099. * | MPDU end offset | MPDU start offset |
  3100. * |---------------------------------------------------------------|
  3101. * | MSDU end offset | MSDU start offset |
  3102. * |---------------------------------------------------------------|
  3103. * | frag info offset | rx attention offset |
  3104. * |---------------------------------------------------------------|
  3105. * payload 2, if present, has the same format as payload 1
  3106. * Header fields:
  3107. * - MSG_TYPE
  3108. * Bits 7:0
  3109. * Purpose: identifies this as an rx ring configuration message
  3110. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3111. * - NUM_RINGS
  3112. * Bits 15:8
  3113. * Purpose: indicates whether the host is setting up one rx ring or two
  3114. * Value: 1 or 2
  3115. * Payload:
  3116. * for systems using 64-bit format for bus addresses:
  3117. * - IDX_SHADOW_REG_PADDR_LO
  3118. * Bits 31:0
  3119. * Value: lower 4 bytes of physical address of the host's
  3120. * FW_IDX shadow register
  3121. * - IDX_SHADOW_REG_PADDR_HI
  3122. * Bits 31:0
  3123. * Value: upper 4 bytes of physical address of the host's
  3124. * FW_IDX shadow register
  3125. * - RING_BASE_PADDR_LO
  3126. * Bits 31:0
  3127. * Value: lower 4 bytes of physical address of the host's rx ring
  3128. * - RING_BASE_PADDR_HI
  3129. * Bits 31:0
  3130. * Value: uppper 4 bytes of physical address of the host's rx ring
  3131. * for systems using 32-bit format for bus addresses:
  3132. * - IDX_SHADOW_REG_PADDR
  3133. * Bits 31:0
  3134. * Value: physical address of the host's FW_IDX shadow register
  3135. * - RING_BASE_PADDR
  3136. * Bits 31:0
  3137. * Value: physical address of the host's rx ring
  3138. * - RING_LEN
  3139. * Bits 15:0
  3140. * Value: number of elements in the rx ring
  3141. * - RING_BUF_SZ
  3142. * Bits 31:16
  3143. * Value: size of the buffers referenced by the rx ring, in byte units
  3144. * - ENABLED_FLAGS
  3145. * Bits 15:0
  3146. * Value: 1-bit flags to show whether different rx fields are enabled
  3147. * bit 0: 802.11 header enabled (1) or disabled (0)
  3148. * bit 1: MSDU payload enabled (1) or disabled (0)
  3149. * bit 2: PPDU start enabled (1) or disabled (0)
  3150. * bit 3: PPDU end enabled (1) or disabled (0)
  3151. * bit 4: MPDU start enabled (1) or disabled (0)
  3152. * bit 5: MPDU end enabled (1) or disabled (0)
  3153. * bit 6: MSDU start enabled (1) or disabled (0)
  3154. * bit 7: MSDU end enabled (1) or disabled (0)
  3155. * bit 8: rx attention enabled (1) or disabled (0)
  3156. * bit 9: frag info enabled (1) or disabled (0)
  3157. * bit 10: unicast rx enabled (1) or disabled (0)
  3158. * bit 11: multicast rx enabled (1) or disabled (0)
  3159. * bit 12: ctrl rx enabled (1) or disabled (0)
  3160. * bit 13: mgmt rx enabled (1) or disabled (0)
  3161. * bit 14: null rx enabled (1) or disabled (0)
  3162. * bit 15: phy data rx enabled (1) or disabled (0)
  3163. * - IDX_INIT_VAL
  3164. * Bits 31:16
  3165. * Purpose: Specify the initial value for the FW_IDX.
  3166. * Value: the number of buffers initially present in the host's rx ring
  3167. * - OFFSET_802_11_HDR
  3168. * Bits 15:0
  3169. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3170. * - OFFSET_MSDU_PAYLOAD
  3171. * Bits 31:16
  3172. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3173. * - OFFSET_PPDU_START
  3174. * Bits 15:0
  3175. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3176. * - OFFSET_PPDU_END
  3177. * Bits 31:16
  3178. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3179. * - OFFSET_MPDU_START
  3180. * Bits 15:0
  3181. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3182. * - OFFSET_MPDU_END
  3183. * Bits 31:16
  3184. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3185. * - OFFSET_MSDU_START
  3186. * Bits 15:0
  3187. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3188. * - OFFSET_MSDU_END
  3189. * Bits 31:16
  3190. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3191. * - OFFSET_RX_ATTN
  3192. * Bits 15:0
  3193. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3194. * - OFFSET_FRAG_INFO
  3195. * Bits 31:16
  3196. * Value: offset in QUAD-bytes of frag info table
  3197. */
  3198. /* header fields */
  3199. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3200. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3201. /* payload fields */
  3202. /* for systems using a 64-bit format for bus addresses */
  3203. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3204. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3205. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3206. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3207. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3208. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3209. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3210. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3211. /* for systems using a 32-bit format for bus addresses */
  3212. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3213. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3214. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3215. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3216. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3217. #define HTT_RX_RING_CFG_LEN_S 0
  3218. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3219. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3220. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3221. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3222. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3223. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3224. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3225. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3226. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3227. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3228. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3229. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3230. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3231. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3232. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3233. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3234. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3235. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3236. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3237. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3238. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3239. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3240. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3241. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3242. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3243. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3244. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3245. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3246. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3247. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3248. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3249. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3250. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3251. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3252. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3253. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3254. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3255. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3256. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3257. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3258. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3259. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3260. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3261. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3262. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3263. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3264. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3265. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3266. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3267. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3268. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3269. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3270. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3271. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3272. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3273. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3274. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3275. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3276. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3277. #if HTT_PADDR64
  3278. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3279. #else
  3280. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3281. #endif
  3282. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3283. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3284. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3285. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3286. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3287. do { \
  3288. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3289. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3290. } while (0)
  3291. /* degenerate case for 32-bit fields */
  3292. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3293. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3294. ((_var) = (_val))
  3295. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3296. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3297. ((_var) = (_val))
  3298. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3299. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3300. ((_var) = (_val))
  3301. /* degenerate case for 32-bit fields */
  3302. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3303. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3304. ((_var) = (_val))
  3305. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3306. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3307. ((_var) = (_val))
  3308. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3309. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3310. ((_var) = (_val))
  3311. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3312. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3313. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3314. do { \
  3315. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3316. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3317. } while (0)
  3318. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3319. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3320. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3321. do { \
  3322. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3323. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3324. } while (0)
  3325. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3326. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3327. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3328. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3329. do { \
  3330. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3331. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3332. } while (0)
  3333. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3334. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3335. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3336. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3337. do { \
  3338. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3339. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3340. } while (0)
  3341. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3342. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3343. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3344. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3345. do { \
  3346. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3347. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3348. } while (0)
  3349. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3350. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3351. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3352. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3353. do { \
  3354. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3355. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3356. } while (0)
  3357. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3358. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3359. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3360. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3361. do { \
  3362. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3363. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3364. } while (0)
  3365. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3366. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3367. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3368. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3369. do { \
  3370. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3371. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3372. } while (0)
  3373. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3374. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3375. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3376. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3377. do { \
  3378. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3379. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3380. } while (0)
  3381. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3382. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3383. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3384. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3385. do { \
  3386. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3387. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3388. } while (0)
  3389. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3390. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3391. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3392. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3393. do { \
  3394. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3395. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3396. } while (0)
  3397. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3398. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3399. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3400. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3401. do { \
  3402. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3403. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3404. } while (0)
  3405. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3406. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3407. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3408. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3409. do { \
  3410. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3411. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3412. } while (0)
  3413. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3414. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3415. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3416. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3417. do { \
  3418. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3419. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3420. } while (0)
  3421. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3422. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3423. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3424. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3425. do { \
  3426. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3427. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3428. } while (0)
  3429. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3430. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3431. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3432. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3435. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3436. } while (0)
  3437. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3438. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3439. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3440. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3441. do { \
  3442. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3443. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3444. } while (0)
  3445. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3446. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3447. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3448. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3449. do { \
  3450. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3451. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3452. } while (0)
  3453. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3454. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3455. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3456. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3457. do { \
  3458. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3459. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3460. } while (0)
  3461. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3462. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3463. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3464. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3465. do { \
  3466. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3467. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3468. } while (0)
  3469. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3470. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3471. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3472. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3473. do { \
  3474. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3475. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3476. } while (0)
  3477. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3478. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3479. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3480. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3483. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3484. } while (0)
  3485. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3486. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3487. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3488. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3491. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3492. } while (0)
  3493. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3494. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3495. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3496. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3499. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3500. } while (0)
  3501. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3502. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3503. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3504. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3507. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3508. } while (0)
  3509. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3510. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3511. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3512. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3513. do { \
  3514. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3515. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3516. } while (0)
  3517. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3518. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3519. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3520. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3521. do { \
  3522. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3523. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3524. } while (0)
  3525. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3526. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3527. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3528. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3531. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3532. } while (0)
  3533. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3534. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3535. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3536. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3539. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3540. } while (0)
  3541. /**
  3542. * @brief host -> target FW statistics retrieve
  3543. *
  3544. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3545. *
  3546. * @details
  3547. * The following field definitions describe the format of the HTT host
  3548. * to target FW stats retrieve message. The message specifies the type of
  3549. * stats host wants to retrieve.
  3550. *
  3551. * |31 24|23 16|15 8|7 0|
  3552. * |-----------------------------------------------------------|
  3553. * | stats types request bitmask | msg type |
  3554. * |-----------------------------------------------------------|
  3555. * | stats types reset bitmask | reserved |
  3556. * |-----------------------------------------------------------|
  3557. * | stats type | config value |
  3558. * |-----------------------------------------------------------|
  3559. * | cookie LSBs |
  3560. * |-----------------------------------------------------------|
  3561. * | cookie MSBs |
  3562. * |-----------------------------------------------------------|
  3563. * Header fields:
  3564. * - MSG_TYPE
  3565. * Bits 7:0
  3566. * Purpose: identifies this is a stats upload request message
  3567. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3568. * - UPLOAD_TYPES
  3569. * Bits 31:8
  3570. * Purpose: identifies which types of FW statistics to upload
  3571. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3572. * - RESET_TYPES
  3573. * Bits 31:8
  3574. * Purpose: identifies which types of FW statistics to reset
  3575. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3576. * - CFG_VAL
  3577. * Bits 23:0
  3578. * Purpose: give an opaque configuration value to the specified stats type
  3579. * Value: stats-type specific configuration value
  3580. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3581. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3582. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3583. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3584. * - CFG_STAT_TYPE
  3585. * Bits 31:24
  3586. * Purpose: specify which stats type (if any) the config value applies to
  3587. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3588. * a valid configuration specification
  3589. * - COOKIE_LSBS
  3590. * Bits 31:0
  3591. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3592. * message with its preceding host->target stats request message.
  3593. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3594. * - COOKIE_MSBS
  3595. * Bits 31:0
  3596. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3597. * message with its preceding host->target stats request message.
  3598. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3599. */
  3600. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3601. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3602. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3603. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3604. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3605. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3606. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3607. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3608. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3609. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3610. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3611. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3612. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3613. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3614. do { \
  3615. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3616. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3617. } while (0)
  3618. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3619. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3620. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3621. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3622. do { \
  3623. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3624. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3625. } while (0)
  3626. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3627. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3628. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3629. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3630. do { \
  3631. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3632. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3633. } while (0)
  3634. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3635. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3636. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3637. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3638. do { \
  3639. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3640. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3641. } while (0)
  3642. /**
  3643. * @brief host -> target HTT out-of-band sync request
  3644. *
  3645. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3646. *
  3647. * @details
  3648. * The HTT SYNC tells the target to suspend processing of subsequent
  3649. * HTT host-to-target messages until some other target agent locally
  3650. * informs the target HTT FW that the current sync counter is equal to
  3651. * or greater than (in a modulo sense) the sync counter specified in
  3652. * the SYNC message.
  3653. * This allows other host-target components to synchronize their operation
  3654. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3655. * security key has been downloaded to and activated by the target.
  3656. * In the absence of any explicit synchronization counter value
  3657. * specification, the target HTT FW will use zero as the default current
  3658. * sync value.
  3659. *
  3660. * |31 24|23 16|15 8|7 0|
  3661. * |-----------------------------------------------------------|
  3662. * | reserved | sync count | msg type |
  3663. * |-----------------------------------------------------------|
  3664. * Header fields:
  3665. * - MSG_TYPE
  3666. * Bits 7:0
  3667. * Purpose: identifies this as a sync message
  3668. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3669. * - SYNC_COUNT
  3670. * Bits 15:8
  3671. * Purpose: specifies what sync value the HTT FW will wait for from
  3672. * an out-of-band specification to resume its operation
  3673. * Value: in-band sync counter value to compare against the out-of-band
  3674. * counter spec.
  3675. * The HTT target FW will suspend its host->target message processing
  3676. * as long as
  3677. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3678. */
  3679. #define HTT_H2T_SYNC_MSG_SZ 4
  3680. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3681. #define HTT_H2T_SYNC_COUNT_S 8
  3682. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3683. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3684. HTT_H2T_SYNC_COUNT_S)
  3685. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3688. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3689. } while (0)
  3690. /**
  3691. * @brief host -> target HTT aggregation configuration
  3692. *
  3693. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3694. */
  3695. #define HTT_AGGR_CFG_MSG_SZ 4
  3696. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3697. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3698. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3699. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3700. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3701. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3702. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3703. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3704. do { \
  3705. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3706. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3707. } while (0)
  3708. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3709. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3710. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3711. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3712. do { \
  3713. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3714. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3715. } while (0)
  3716. /**
  3717. * @brief host -> target HTT configure max amsdu info per vdev
  3718. *
  3719. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3720. *
  3721. * @details
  3722. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3723. *
  3724. * |31 21|20 16|15 8|7 0|
  3725. * |-----------------------------------------------------------|
  3726. * | reserved | vdev id | max amsdu | msg type |
  3727. * |-----------------------------------------------------------|
  3728. * Header fields:
  3729. * - MSG_TYPE
  3730. * Bits 7:0
  3731. * Purpose: identifies this as a aggr cfg ex message
  3732. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3733. * - MAX_NUM_AMSDU_SUBFRM
  3734. * Bits 15:8
  3735. * Purpose: max MSDUs per A-MSDU
  3736. * - VDEV_ID
  3737. * Bits 20:16
  3738. * Purpose: ID of the vdev to which this limit is applied
  3739. */
  3740. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3741. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3742. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3743. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3744. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3745. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3746. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3747. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3748. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3749. do { \
  3750. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3751. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3752. } while (0)
  3753. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3754. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3755. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3756. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3757. do { \
  3758. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3759. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3760. } while (0)
  3761. /**
  3762. * @brief HTT WDI_IPA Config Message
  3763. *
  3764. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3765. *
  3766. * @details
  3767. * The HTT WDI_IPA config message is created/sent by host at driver
  3768. * init time. It contains information about data structures used on
  3769. * WDI_IPA TX and RX path.
  3770. * TX CE ring is used for pushing packet metadata from IPA uC
  3771. * to WLAN FW
  3772. * TX Completion ring is used for generating TX completions from
  3773. * WLAN FW to IPA uC
  3774. * RX Indication ring is used for indicating RX packets from FW
  3775. * to IPA uC
  3776. * RX Ring2 is used as either completion ring or as second
  3777. * indication ring. when Ring2 is used as completion ring, IPA uC
  3778. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3779. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3780. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3781. * indicated in RX Indication ring. Please see WDI_IPA specification
  3782. * for more details.
  3783. * |31 24|23 16|15 8|7 0|
  3784. * |----------------+----------------+----------------+----------------|
  3785. * | tx pkt pool size | Rsvd | msg_type |
  3786. * |-------------------------------------------------------------------|
  3787. * | tx comp ring base (bits 31:0) |
  3788. #if HTT_PADDR64
  3789. * | tx comp ring base (bits 63:32) |
  3790. #endif
  3791. * |-------------------------------------------------------------------|
  3792. * | tx comp ring size |
  3793. * |-------------------------------------------------------------------|
  3794. * | tx comp WR_IDX physical address (bits 31:0) |
  3795. #if HTT_PADDR64
  3796. * | tx comp WR_IDX physical address (bits 63:32) |
  3797. #endif
  3798. * |-------------------------------------------------------------------|
  3799. * | tx CE WR_IDX physical address (bits 31:0) |
  3800. #if HTT_PADDR64
  3801. * | tx CE WR_IDX physical address (bits 63:32) |
  3802. #endif
  3803. * |-------------------------------------------------------------------|
  3804. * | rx indication ring base (bits 31:0) |
  3805. #if HTT_PADDR64
  3806. * | rx indication ring base (bits 63:32) |
  3807. #endif
  3808. * |-------------------------------------------------------------------|
  3809. * | rx indication ring size |
  3810. * |-------------------------------------------------------------------|
  3811. * | rx ind RD_IDX physical address (bits 31:0) |
  3812. #if HTT_PADDR64
  3813. * | rx ind RD_IDX physical address (bits 63:32) |
  3814. #endif
  3815. * |-------------------------------------------------------------------|
  3816. * | rx ind WR_IDX physical address (bits 31:0) |
  3817. #if HTT_PADDR64
  3818. * | rx ind WR_IDX physical address (bits 63:32) |
  3819. #endif
  3820. * |-------------------------------------------------------------------|
  3821. * |-------------------------------------------------------------------|
  3822. * | rx ring2 base (bits 31:0) |
  3823. #if HTT_PADDR64
  3824. * | rx ring2 base (bits 63:32) |
  3825. #endif
  3826. * |-------------------------------------------------------------------|
  3827. * | rx ring2 size |
  3828. * |-------------------------------------------------------------------|
  3829. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3830. #if HTT_PADDR64
  3831. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3832. #endif
  3833. * |-------------------------------------------------------------------|
  3834. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3835. #if HTT_PADDR64
  3836. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3837. #endif
  3838. * |-------------------------------------------------------------------|
  3839. *
  3840. * Header fields:
  3841. * Header fields:
  3842. * - MSG_TYPE
  3843. * Bits 7:0
  3844. * Purpose: Identifies this as WDI_IPA config message
  3845. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3846. * - TX_PKT_POOL_SIZE
  3847. * Bits 15:0
  3848. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3849. * WDI_IPA TX path
  3850. * For systems using 32-bit format for bus addresses:
  3851. * - TX_COMP_RING_BASE_ADDR
  3852. * Bits 31:0
  3853. * Purpose: TX Completion Ring base address in DDR
  3854. * - TX_COMP_RING_SIZE
  3855. * Bits 31:0
  3856. * Purpose: TX Completion Ring size (must be power of 2)
  3857. * - TX_COMP_WR_IDX_ADDR
  3858. * Bits 31:0
  3859. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3860. * updates the Write Index for WDI_IPA TX completion ring
  3861. * - TX_CE_WR_IDX_ADDR
  3862. * Bits 31:0
  3863. * Purpose: DDR address where IPA uC
  3864. * updates the WR Index for TX CE ring
  3865. * (needed for fusion platforms)
  3866. * - RX_IND_RING_BASE_ADDR
  3867. * Bits 31:0
  3868. * Purpose: RX Indication Ring base address in DDR
  3869. * - RX_IND_RING_SIZE
  3870. * Bits 31:0
  3871. * Purpose: RX Indication Ring size
  3872. * - RX_IND_RD_IDX_ADDR
  3873. * Bits 31:0
  3874. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3875. * RX indication ring
  3876. * - RX_IND_WR_IDX_ADDR
  3877. * Bits 31:0
  3878. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3879. * updates the Write Index for WDI_IPA RX indication ring
  3880. * - RX_RING2_BASE_ADDR
  3881. * Bits 31:0
  3882. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3883. * - RX_RING2_SIZE
  3884. * Bits 31:0
  3885. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3886. * - RX_RING2_RD_IDX_ADDR
  3887. * Bits 31:0
  3888. * Purpose: If Second RX ring is Indication ring, DDR address where
  3889. * IPA uC updates the Read Index for Ring2.
  3890. * If Second RX ring is completion ring, this is NOT used
  3891. * - RX_RING2_WR_IDX_ADDR
  3892. * Bits 31:0
  3893. * Purpose: If Second RX ring is Indication ring, DDR address where
  3894. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3895. * If second RX ring is completion ring, DDR address where
  3896. * IPA uC updates the Write Index for Ring 2.
  3897. * For systems using 64-bit format for bus addresses:
  3898. * - TX_COMP_RING_BASE_ADDR_LO
  3899. * Bits 31:0
  3900. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3901. * - TX_COMP_RING_BASE_ADDR_HI
  3902. * Bits 31:0
  3903. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3904. * - TX_COMP_RING_SIZE
  3905. * Bits 31:0
  3906. * Purpose: TX Completion Ring size (must be power of 2)
  3907. * - TX_COMP_WR_IDX_ADDR_LO
  3908. * Bits 31:0
  3909. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3910. * Lower 4 bytes of DDR address where WIFI FW
  3911. * updates the Write Index for WDI_IPA TX completion ring
  3912. * - TX_COMP_WR_IDX_ADDR_HI
  3913. * Bits 31:0
  3914. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3915. * Higher 4 bytes of DDR address where WIFI FW
  3916. * updates the Write Index for WDI_IPA TX completion ring
  3917. * - TX_CE_WR_IDX_ADDR_LO
  3918. * Bits 31:0
  3919. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3920. * updates the WR Index for TX CE ring
  3921. * (needed for fusion platforms)
  3922. * - TX_CE_WR_IDX_ADDR_HI
  3923. * Bits 31:0
  3924. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3925. * updates the WR Index for TX CE ring
  3926. * (needed for fusion platforms)
  3927. * - RX_IND_RING_BASE_ADDR_LO
  3928. * Bits 31:0
  3929. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3930. * - RX_IND_RING_BASE_ADDR_HI
  3931. * Bits 31:0
  3932. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3933. * - RX_IND_RING_SIZE
  3934. * Bits 31:0
  3935. * Purpose: RX Indication Ring size
  3936. * - RX_IND_RD_IDX_ADDR_LO
  3937. * Bits 31:0
  3938. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3939. * for WDI_IPA RX indication ring
  3940. * - RX_IND_RD_IDX_ADDR_HI
  3941. * Bits 31:0
  3942. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3943. * for WDI_IPA RX indication ring
  3944. * - RX_IND_WR_IDX_ADDR_LO
  3945. * Bits 31:0
  3946. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3947. * Lower 4 bytes of DDR address where WIFI FW
  3948. * updates the Write Index for WDI_IPA RX indication ring
  3949. * - RX_IND_WR_IDX_ADDR_HI
  3950. * Bits 31:0
  3951. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3952. * Higher 4 bytes of DDR address where WIFI FW
  3953. * updates the Write Index for WDI_IPA RX indication ring
  3954. * - RX_RING2_BASE_ADDR_LO
  3955. * Bits 31:0
  3956. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3957. * - RX_RING2_BASE_ADDR_HI
  3958. * Bits 31:0
  3959. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3960. * - RX_RING2_SIZE
  3961. * Bits 31:0
  3962. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3963. * - RX_RING2_RD_IDX_ADDR_LO
  3964. * Bits 31:0
  3965. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3966. * DDR address where IPA uC updates the Read Index for Ring2.
  3967. * If Second RX ring is completion ring, this is NOT used
  3968. * - RX_RING2_RD_IDX_ADDR_HI
  3969. * Bits 31:0
  3970. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3971. * DDR address where IPA uC updates the Read Index for Ring2.
  3972. * If Second RX ring is completion ring, this is NOT used
  3973. * - RX_RING2_WR_IDX_ADDR_LO
  3974. * Bits 31:0
  3975. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3976. * DDR address where WIFI FW updates the Write Index
  3977. * for WDI_IPA RX ring2
  3978. * If second RX ring is completion ring, lower 4 bytes of
  3979. * DDR address where IPA uC updates the Write Index for Ring 2.
  3980. * - RX_RING2_WR_IDX_ADDR_HI
  3981. * Bits 31:0
  3982. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3983. * DDR address where WIFI FW updates the Write Index
  3984. * for WDI_IPA RX ring2
  3985. * If second RX ring is completion ring, higher 4 bytes of
  3986. * DDR address where IPA uC updates the Write Index for Ring 2.
  3987. */
  3988. #if HTT_PADDR64
  3989. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3990. #else
  3991. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3992. #endif
  3993. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3994. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3995. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3996. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3997. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3998. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3999. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4000. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4002. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4003. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4004. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4005. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4006. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4007. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4008. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4009. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4010. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4011. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4012. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4013. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4014. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4015. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4016. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4017. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4018. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4019. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4020. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4021. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4022. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4023. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4025. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4027. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4029. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4031. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4033. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4035. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4037. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4039. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4041. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4053. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4055. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4056. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4057. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4058. do { \
  4059. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4060. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4061. } while (0)
  4062. /* for systems using 32-bit format for bus addr */
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4064. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4065. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4066. do { \
  4067. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4068. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4069. } while (0)
  4070. /* for systems using 64-bit format for bus addr */
  4071. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4072. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4073. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4074. do { \
  4075. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4076. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4077. } while (0)
  4078. /* for systems using 64-bit format for bus addr */
  4079. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4080. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4081. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4082. do { \
  4083. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4084. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4085. } while (0)
  4086. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4087. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4088. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4089. do { \
  4090. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4091. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4092. } while (0)
  4093. /* for systems using 32-bit format for bus addr */
  4094. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4095. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4096. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4097. do { \
  4098. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4099. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4100. } while (0)
  4101. /* for systems using 64-bit format for bus addr */
  4102. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4103. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4104. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4105. do { \
  4106. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4107. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4108. } while (0)
  4109. /* for systems using 64-bit format for bus addr */
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4111. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4112. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4115. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4116. } while (0)
  4117. /* for systems using 32-bit format for bus addr */
  4118. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4119. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4120. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4123. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4124. } while (0)
  4125. /* for systems using 64-bit format for bus addr */
  4126. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4127. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4128. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4129. do { \
  4130. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4131. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4132. } while (0)
  4133. /* for systems using 64-bit format for bus addr */
  4134. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4135. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4136. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4137. do { \
  4138. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4139. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4140. } while (0)
  4141. /* for systems using 32-bit format for bus addr */
  4142. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4143. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4144. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4147. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4148. } while (0)
  4149. /* for systems using 64-bit format for bus addr */
  4150. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4151. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4152. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4153. do { \
  4154. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4155. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4156. } while (0)
  4157. /* for systems using 64-bit format for bus addr */
  4158. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4159. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4160. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4163. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4164. } while (0)
  4165. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4166. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4167. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4168. do { \
  4169. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4170. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4171. } while (0)
  4172. /* for systems using 32-bit format for bus addr */
  4173. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4174. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4175. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4176. do { \
  4177. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4178. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4179. } while (0)
  4180. /* for systems using 64-bit format for bus addr */
  4181. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4182. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4183. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4184. do { \
  4185. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4186. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4187. } while (0)
  4188. /* for systems using 64-bit format for bus addr */
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4190. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4191. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4192. do { \
  4193. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4194. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4195. } while (0)
  4196. /* for systems using 32-bit format for bus addr */
  4197. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4198. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4199. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4200. do { \
  4201. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4202. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4203. } while (0)
  4204. /* for systems using 64-bit format for bus addr */
  4205. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4206. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4207. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4208. do { \
  4209. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4210. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4211. } while (0)
  4212. /* for systems using 64-bit format for bus addr */
  4213. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4214. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4215. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4218. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4219. } while (0)
  4220. /* for systems using 32-bit format for bus addr */
  4221. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4222. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4223. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4224. do { \
  4225. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4226. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4227. } while (0)
  4228. /* for systems using 64-bit format for bus addr */
  4229. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4230. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4231. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4232. do { \
  4233. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4234. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4235. } while (0)
  4236. /* for systems using 64-bit format for bus addr */
  4237. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4238. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4239. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4240. do { \
  4241. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4242. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4243. } while (0)
  4244. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4245. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4246. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4247. do { \
  4248. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4249. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4250. } while (0)
  4251. /* for systems using 32-bit format for bus addr */
  4252. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4253. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4254. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4255. do { \
  4256. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4257. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4258. } while (0)
  4259. /* for systems using 64-bit format for bus addr */
  4260. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4261. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4262. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4263. do { \
  4264. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4265. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4266. } while (0)
  4267. /* for systems using 64-bit format for bus addr */
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4269. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4270. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4271. do { \
  4272. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4273. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4274. } while (0)
  4275. /* for systems using 32-bit format for bus addr */
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4277. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4278. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4281. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4282. } while (0)
  4283. /* for systems using 64-bit format for bus addr */
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4285. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4286. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4287. do { \
  4288. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4289. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4290. } while (0)
  4291. /* for systems using 64-bit format for bus addr */
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4293. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4294. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4295. do { \
  4296. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4297. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4298. } while (0)
  4299. /*
  4300. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4301. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4302. * addresses are stored in a XXX-bit field.
  4303. * This macro is used to define both htt_wdi_ipa_config32_t and
  4304. * htt_wdi_ipa_config64_t structs.
  4305. */
  4306. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4307. _paddr__tx_comp_ring_base_addr_, \
  4308. _paddr__tx_comp_wr_idx_addr_, \
  4309. _paddr__tx_ce_wr_idx_addr_, \
  4310. _paddr__rx_ind_ring_base_addr_, \
  4311. _paddr__rx_ind_rd_idx_addr_, \
  4312. _paddr__rx_ind_wr_idx_addr_, \
  4313. _paddr__rx_ring2_base_addr_,\
  4314. _paddr__rx_ring2_rd_idx_addr_,\
  4315. _paddr__rx_ring2_wr_idx_addr_) \
  4316. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4317. { \
  4318. /* DWORD 0: flags and meta-data */ \
  4319. A_UINT32 \
  4320. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4321. reserved: 8, \
  4322. tx_pkt_pool_size: 16;\
  4323. /* DWORD 1 */\
  4324. _paddr__tx_comp_ring_base_addr_;\
  4325. /* DWORD 2 (or 3)*/\
  4326. A_UINT32 tx_comp_ring_size;\
  4327. /* DWORD 3 (or 4)*/\
  4328. _paddr__tx_comp_wr_idx_addr_;\
  4329. /* DWORD 4 (or 6)*/\
  4330. _paddr__tx_ce_wr_idx_addr_;\
  4331. /* DWORD 5 (or 8)*/\
  4332. _paddr__rx_ind_ring_base_addr_;\
  4333. /* DWORD 6 (or 10)*/\
  4334. A_UINT32 rx_ind_ring_size;\
  4335. /* DWORD 7 (or 11)*/\
  4336. _paddr__rx_ind_rd_idx_addr_;\
  4337. /* DWORD 8 (or 13)*/\
  4338. _paddr__rx_ind_wr_idx_addr_;\
  4339. /* DWORD 9 (or 15)*/\
  4340. _paddr__rx_ring2_base_addr_;\
  4341. /* DWORD 10 (or 17) */\
  4342. A_UINT32 rx_ring2_size;\
  4343. /* DWORD 11 (or 18) */\
  4344. _paddr__rx_ring2_rd_idx_addr_;\
  4345. /* DWORD 12 (or 20) */\
  4346. _paddr__rx_ring2_wr_idx_addr_;\
  4347. } POSTPACK
  4348. /* define a htt_wdi_ipa_config32_t type */
  4349. 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));
  4350. /* define a htt_wdi_ipa_config64_t type */
  4351. 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));
  4352. #if HTT_PADDR64
  4353. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4354. #else
  4355. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4356. #endif
  4357. enum htt_wdi_ipa_op_code {
  4358. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4359. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4360. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4361. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4362. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4363. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4364. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4365. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4366. /* keep this last */
  4367. HTT_WDI_IPA_OPCODE_MAX
  4368. };
  4369. /**
  4370. * @brief HTT WDI_IPA Operation Request Message
  4371. *
  4372. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4373. *
  4374. * @details
  4375. * HTT WDI_IPA Operation Request message is sent by host
  4376. * to either suspend or resume WDI_IPA TX or RX path.
  4377. * |31 24|23 16|15 8|7 0|
  4378. * |----------------+----------------+----------------+----------------|
  4379. * | op_code | Rsvd | msg_type |
  4380. * |-------------------------------------------------------------------|
  4381. *
  4382. * Header fields:
  4383. * - MSG_TYPE
  4384. * Bits 7:0
  4385. * Purpose: Identifies this as WDI_IPA Operation Request message
  4386. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4387. * - OP_CODE
  4388. * Bits 31:16
  4389. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4390. * value: = enum htt_wdi_ipa_op_code
  4391. */
  4392. PREPACK struct htt_wdi_ipa_op_request_t
  4393. {
  4394. /* DWORD 0: flags and meta-data */
  4395. A_UINT32
  4396. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4397. reserved: 8,
  4398. op_code: 16;
  4399. } POSTPACK;
  4400. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4401. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4402. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4403. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4404. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4405. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4406. do { \
  4407. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4408. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4409. } while (0)
  4410. /*
  4411. * @brief host -> target HTT_MSI_SETUP message
  4412. *
  4413. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4414. *
  4415. * @details
  4416. * After target is booted up, host can send MSI setup message so that
  4417. * target sets up HW registers based on setup message.
  4418. *
  4419. * The message would appear as follows:
  4420. * |31 24|23 16|15|14 8|7 0|
  4421. * |---------------+-----------------+-----------------+-----------------|
  4422. * | reserved | msi_type | pdev_id | msg_type |
  4423. * |---------------------------------------------------------------------|
  4424. * | msi_addr_lo |
  4425. * |---------------------------------------------------------------------|
  4426. * | msi_addr_hi |
  4427. * |---------------------------------------------------------------------|
  4428. * | msi_data |
  4429. * |---------------------------------------------------------------------|
  4430. *
  4431. * The message is interpreted as follows:
  4432. * dword0 - b'0:7 - msg_type: This will be set to
  4433. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4434. * b'8:15 - pdev_id:
  4435. * 0 (for rings at SOC/UMAC level),
  4436. * 1/2/3 mac id (for rings at LMAC level)
  4437. * b'16:23 - msi_type: identify which msi registers need to be setup
  4438. * more details can be got from enum htt_msi_setup_type
  4439. * b'24:31 - reserved
  4440. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4441. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4442. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4443. */
  4444. PREPACK struct htt_msi_setup_t {
  4445. A_UINT32 msg_type: 8,
  4446. pdev_id: 8,
  4447. msi_type: 8,
  4448. reserved: 8;
  4449. A_UINT32 msi_addr_lo;
  4450. A_UINT32 msi_addr_hi;
  4451. A_UINT32 msi_data;
  4452. } POSTPACK;
  4453. enum htt_msi_setup_type {
  4454. HTT_PPDU_END_MSI_SETUP_TYPE,
  4455. /* Insert new types here*/
  4456. };
  4457. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4458. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4459. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4460. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4461. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4462. HTT_MSI_SETUP_PDEV_ID_S)
  4463. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4464. do { \
  4465. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4466. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4467. } while (0)
  4468. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4469. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4470. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4471. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4472. HTT_MSI_SETUP_MSI_TYPE_S)
  4473. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4474. do { \
  4475. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4476. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4477. } while (0)
  4478. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4479. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4480. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4481. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4482. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4483. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4484. do { \
  4485. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4486. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4487. } while (0)
  4488. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4489. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4490. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4491. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4492. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4493. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4494. do { \
  4495. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4496. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4497. } while (0)
  4498. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4499. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4500. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4501. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4502. HTT_MSI_SETUP_MSI_DATA_S)
  4503. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4504. do { \
  4505. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4506. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4507. } while (0)
  4508. /*
  4509. * @brief host -> target HTT_SRING_SETUP message
  4510. *
  4511. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4512. *
  4513. * @details
  4514. * After target is booted up, Host can send SRING setup message for
  4515. * each host facing LMAC SRING. Target setups up HW registers based
  4516. * on setup message and confirms back to Host if response_required is set.
  4517. * Host should wait for confirmation message before sending new SRING
  4518. * setup message
  4519. *
  4520. * The message would appear as follows:
  4521. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4522. * |--------------- +-----------------+-----------------+-----------------|
  4523. * | ring_type | ring_id | pdev_id | msg_type |
  4524. * |----------------------------------------------------------------------|
  4525. * | ring_base_addr_lo |
  4526. * |----------------------------------------------------------------------|
  4527. * | ring_base_addr_hi |
  4528. * |----------------------------------------------------------------------|
  4529. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4530. * |----------------------------------------------------------------------|
  4531. * | ring_head_offset32_remote_addr_lo |
  4532. * |----------------------------------------------------------------------|
  4533. * | ring_head_offset32_remote_addr_hi |
  4534. * |----------------------------------------------------------------------|
  4535. * | ring_tail_offset32_remote_addr_lo |
  4536. * |----------------------------------------------------------------------|
  4537. * | ring_tail_offset32_remote_addr_hi |
  4538. * |----------------------------------------------------------------------|
  4539. * | ring_msi_addr_lo |
  4540. * |----------------------------------------------------------------------|
  4541. * | ring_msi_addr_hi |
  4542. * |----------------------------------------------------------------------|
  4543. * | ring_msi_data |
  4544. * |----------------------------------------------------------------------|
  4545. * | intr_timer_th |IM| intr_batch_counter_th |
  4546. * |----------------------------------------------------------------------|
  4547. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4548. * |----------------------------------------------------------------------|
  4549. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4550. * |----------------------------------------------------------------------|
  4551. * Where
  4552. * IM = sw_intr_mode
  4553. * RR = response_required
  4554. * PTCF = prefetch_timer_cfg
  4555. * IP = IPA drop flag
  4556. *
  4557. * The message is interpreted as follows:
  4558. * dword0 - b'0:7 - msg_type: This will be set to
  4559. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4560. * b'8:15 - pdev_id:
  4561. * 0 (for rings at SOC/UMAC level),
  4562. * 1/2/3 mac id (for rings at LMAC level)
  4563. * b'16:23 - ring_id: identify which ring is to setup,
  4564. * more details can be got from enum htt_srng_ring_id
  4565. * b'24:31 - ring_type: identify type of host rings,
  4566. * more details can be got from enum htt_srng_ring_type
  4567. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4568. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4569. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4570. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4571. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4572. * SW_TO_HW_RING.
  4573. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4574. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4575. * Lower 32 bits of memory address of the remote variable
  4576. * storing the 4-byte word offset that identifies the head
  4577. * element within the ring.
  4578. * (The head offset variable has type A_UINT32.)
  4579. * Valid for HW_TO_SW and SW_TO_SW rings.
  4580. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4581. * Upper 32 bits of memory address of the remote variable
  4582. * storing the 4-byte word offset that identifies the head
  4583. * element within the ring.
  4584. * (The head offset variable has type A_UINT32.)
  4585. * Valid for HW_TO_SW and SW_TO_SW rings.
  4586. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4587. * Lower 32 bits of memory address of the remote variable
  4588. * storing the 4-byte word offset that identifies the tail
  4589. * element within the ring.
  4590. * (The tail offset variable has type A_UINT32.)
  4591. * Valid for HW_TO_SW and SW_TO_SW rings.
  4592. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4593. * Upper 32 bits of memory address of the remote variable
  4594. * storing the 4-byte word offset that identifies the tail
  4595. * element within the ring.
  4596. * (The tail offset variable has type A_UINT32.)
  4597. * Valid for HW_TO_SW and SW_TO_SW rings.
  4598. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4599. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4600. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4601. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4602. * dword10 - b'0:31 - ring_msi_data: MSI data
  4603. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4604. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4605. * dword11 - b'0:14 - intr_batch_counter_th:
  4606. * batch counter threshold is in units of 4-byte words.
  4607. * HW internally maintains and increments batch count.
  4608. * (see SRING spec for detail description).
  4609. * When batch count reaches threshold value, an interrupt
  4610. * is generated by HW.
  4611. * b'15 - sw_intr_mode:
  4612. * This configuration shall be static.
  4613. * Only programmed at power up.
  4614. * 0: generate pulse style sw interrupts
  4615. * 1: generate level style sw interrupts
  4616. * b'16:31 - intr_timer_th:
  4617. * The timer init value when timer is idle or is
  4618. * initialized to start downcounting.
  4619. * In 8us units (to cover a range of 0 to 524 ms)
  4620. * dword12 - b'0:15 - intr_low_threshold:
  4621. * Used only by Consumer ring to generate ring_sw_int_p.
  4622. * Ring entries low threshold water mark, that is used
  4623. * in combination with the interrupt timer as well as
  4624. * the the clearing of the level interrupt.
  4625. * b'16:18 - prefetch_timer_cfg:
  4626. * Used only by Consumer ring to set timer mode to
  4627. * support Application prefetch handling.
  4628. * The external tail offset/pointer will be updated
  4629. * at following intervals:
  4630. * 3'b000: (Prefetch feature disabled; used only for debug)
  4631. * 3'b001: 1 usec
  4632. * 3'b010: 4 usec
  4633. * 3'b011: 8 usec (default)
  4634. * 3'b100: 16 usec
  4635. * Others: Reserverd
  4636. * b'19 - response_required:
  4637. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4638. * b'20 - ipa_drop_flag:
  4639. Indicates that host will config ipa drop threshold percentage
  4640. * b'21:31 - reserved: reserved for future use
  4641. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4642. * b'8:15 - ipa drop high threshold percentage:
  4643. * b'16:31 - Reserved
  4644. */
  4645. PREPACK struct htt_sring_setup_t {
  4646. A_UINT32 msg_type: 8,
  4647. pdev_id: 8,
  4648. ring_id: 8,
  4649. ring_type: 8;
  4650. A_UINT32 ring_base_addr_lo;
  4651. A_UINT32 ring_base_addr_hi;
  4652. A_UINT32 ring_size: 16,
  4653. ring_entry_size: 8,
  4654. ring_misc_cfg_flag: 8;
  4655. A_UINT32 ring_head_offset32_remote_addr_lo;
  4656. A_UINT32 ring_head_offset32_remote_addr_hi;
  4657. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4658. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4659. A_UINT32 ring_msi_addr_lo;
  4660. A_UINT32 ring_msi_addr_hi;
  4661. A_UINT32 ring_msi_data;
  4662. A_UINT32 intr_batch_counter_th: 15,
  4663. sw_intr_mode: 1,
  4664. intr_timer_th: 16;
  4665. A_UINT32 intr_low_threshold: 16,
  4666. prefetch_timer_cfg: 3,
  4667. response_required: 1,
  4668. ipa_drop_flag: 1,
  4669. reserved1: 11;
  4670. A_UINT32 ipa_drop_low_threshold: 8,
  4671. ipa_drop_high_threshold: 8,
  4672. reserved: 16;
  4673. } POSTPACK;
  4674. enum htt_srng_ring_type {
  4675. HTT_HW_TO_SW_RING = 0,
  4676. HTT_SW_TO_HW_RING,
  4677. HTT_SW_TO_SW_RING,
  4678. /* Insert new ring types above this line */
  4679. };
  4680. enum htt_srng_ring_id {
  4681. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4682. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4683. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4684. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4685. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4686. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4687. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4688. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4689. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4690. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4691. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4692. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4693. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4694. /* Add Other SRING which can't be directly configured by host software above this line */
  4695. };
  4696. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4697. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4698. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4699. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4700. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4701. HTT_SRING_SETUP_PDEV_ID_S)
  4702. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4703. do { \
  4704. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4705. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4706. } while (0)
  4707. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4708. #define HTT_SRING_SETUP_RING_ID_S 16
  4709. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4710. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4711. HTT_SRING_SETUP_RING_ID_S)
  4712. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4713. do { \
  4714. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4715. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4716. } while (0)
  4717. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4718. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4719. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4720. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4721. HTT_SRING_SETUP_RING_TYPE_S)
  4722. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4723. do { \
  4724. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4725. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4726. } while (0)
  4727. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4728. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4729. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4730. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4731. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4732. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4733. do { \
  4734. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4735. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4736. } while (0)
  4737. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4738. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4739. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4740. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4741. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4742. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4743. do { \
  4744. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4745. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4746. } while (0)
  4747. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4748. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4749. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4750. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4751. HTT_SRING_SETUP_RING_SIZE_S)
  4752. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4753. do { \
  4754. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4755. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4756. } while (0)
  4757. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4758. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4759. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4760. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4761. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4762. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4765. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4766. } while (0)
  4767. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4768. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4769. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4770. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4771. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4772. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4775. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4776. } while (0)
  4777. /* This control bit is applicable to only Producer, which updates Ring ID field
  4778. * of each descriptor before pushing into the ring.
  4779. * 0: updates ring_id(default)
  4780. * 1: ring_id updating disabled */
  4781. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4782. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4783. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4784. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4785. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4786. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4787. do { \
  4788. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4789. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4790. } while (0)
  4791. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4792. * of each descriptor before pushing into the ring.
  4793. * 0: updates Loopcnt(default)
  4794. * 1: Loopcnt updating disabled */
  4795. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4796. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4797. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4798. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4799. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4800. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4801. do { \
  4802. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4803. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4804. } while (0)
  4805. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4806. * into security_id port of GXI/AXI. */
  4807. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4808. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4809. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4810. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4811. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4812. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4813. do { \
  4814. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4815. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4816. } while (0)
  4817. /* During MSI write operation, SRNG drives value of this register bit into
  4818. * swap bit of GXI/AXI. */
  4819. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4820. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4821. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4822. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4823. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4824. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4825. do { \
  4826. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4827. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4828. } while (0)
  4829. /* During Pointer write operation, SRNG drives value of this register bit into
  4830. * swap bit of GXI/AXI. */
  4831. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4832. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4833. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4834. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4835. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4837. do { \
  4838. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4839. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4840. } while (0)
  4841. /* During any data or TLV write operation, SRNG drives value of this register
  4842. * bit into swap bit of GXI/AXI. */
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4845. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4846. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4847. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4849. do { \
  4850. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4851. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4852. } while (0)
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4855. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4856. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4857. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4858. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4859. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4860. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4861. do { \
  4862. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4863. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4864. } while (0)
  4865. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4866. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4867. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4868. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4869. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4870. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4871. do { \
  4872. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4873. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4874. } while (0)
  4875. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4876. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4877. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4878. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4879. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4880. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4881. do { \
  4882. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4883. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4884. } while (0)
  4885. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4886. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4887. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4888. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4889. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4890. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4891. do { \
  4892. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4893. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4894. } while (0)
  4895. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4896. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4897. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4898. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4899. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4900. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4901. do { \
  4902. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4903. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4904. } while (0)
  4905. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4906. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4907. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4908. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4909. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4910. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4911. do { \
  4912. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4913. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4914. } while (0)
  4915. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4916. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4917. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4918. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4919. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4920. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4921. do { \
  4922. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4923. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4924. } while (0)
  4925. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4926. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4927. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4928. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4929. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4930. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4931. do { \
  4932. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4933. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4934. } while (0)
  4935. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4936. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4937. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4938. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4939. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4940. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4941. do { \
  4942. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4943. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4944. } while (0)
  4945. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4946. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4947. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4948. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4949. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4950. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4951. do { \
  4952. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4953. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4954. } while (0)
  4955. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4956. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4957. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4958. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4959. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4960. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4961. do { \
  4962. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4963. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4964. } while (0)
  4965. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4966. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4967. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4968. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4969. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4970. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4971. do { \
  4972. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4973. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4974. } while (0)
  4975. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4976. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4977. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4978. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4979. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4980. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4981. do { \
  4982. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4983. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4984. } while (0)
  4985. /**
  4986. * @brief host -> target RX ring selection config message
  4987. *
  4988. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4989. *
  4990. * @details
  4991. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4992. * configure RXDMA rings.
  4993. * The configuration is per ring based and includes both packet subtypes
  4994. * and PPDU/MPDU TLVs.
  4995. *
  4996. * The message would appear as follows:
  4997. *
  4998. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4999. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5000. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5001. * |-------------------------------------------------------------------|
  5002. * | rsvd2 | ring_buffer_size |
  5003. * |-------------------------------------------------------------------|
  5004. * | packet_type_enable_flags_0 |
  5005. * |-------------------------------------------------------------------|
  5006. * | packet_type_enable_flags_1 |
  5007. * |-------------------------------------------------------------------|
  5008. * | packet_type_enable_flags_2 |
  5009. * |-------------------------------------------------------------------|
  5010. * | packet_type_enable_flags_3 |
  5011. * |-------------------------------------------------------------------|
  5012. * | tlv_filter_in_flags |
  5013. * |-------------------------------------------------------------------|
  5014. * | rx_header_offset | rx_packet_offset |
  5015. * |-------------------------------------------------------------------|
  5016. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5017. * |-------------------------------------------------------------------|
  5018. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5019. * |-------------------------------------------------------------------|
  5020. * | rsvd3 | rx_attention_offset |
  5021. * |-------------------------------------------------------------------|
  5022. * | rsvd4 | mo| fp| rx_drop_threshold |
  5023. * | |ndp|ndp| |
  5024. * |-------------------------------------------------------------------|
  5025. * Where:
  5026. * PS = pkt_swap
  5027. * SS = status_swap
  5028. * OV = rx_offsets_valid
  5029. * DT = drop_thresh_valid
  5030. * The message is interpreted as follows:
  5031. * dword0 - b'0:7 - msg_type: This will be set to
  5032. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5033. * b'8:15 - pdev_id:
  5034. * 0 (for rings at SOC/UMAC level),
  5035. * 1/2/3 mac id (for rings at LMAC level)
  5036. * b'16:23 - ring_id : Identify the ring to configure.
  5037. * More details can be got from enum htt_srng_ring_id
  5038. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5039. * BUF_RING_CFG_0 defs within HW .h files,
  5040. * e.g. wmac_top_reg_seq_hwioreg.h
  5041. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5042. * BUF_RING_CFG_0 defs within HW .h files,
  5043. * e.g. wmac_top_reg_seq_hwioreg.h
  5044. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5045. * configuration fields are valid
  5046. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5047. * rx_drop_threshold field is valid
  5048. * b'28:31 - rsvd1: reserved for future use
  5049. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5050. * in byte units.
  5051. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5052. * b'16:18 - config_length_mgmt (MGMT):
  5053. * Represents the length of mpdu bytes for mgmt pkt.
  5054. * valid values:
  5055. * 001 - 64bytes
  5056. * 010 - 128bytes
  5057. * 100 - 256bytes
  5058. * 111 - Full mpdu bytes
  5059. * b'19:21 - config_length_ctrl (CTRL):
  5060. * Represents the length of mpdu bytes for ctrl pkt.
  5061. * valid values:
  5062. * 001 - 64bytes
  5063. * 010 - 128bytes
  5064. * 100 - 256bytes
  5065. * 111 - Full mpdu bytes
  5066. * b'22:24 - config_length_data (DATA):
  5067. * Represents the length of mpdu bytes for data pkt.
  5068. * valid values:
  5069. * 001 - 64bytes
  5070. * 010 - 128bytes
  5071. * 100 - 256bytes
  5072. * 111 - Full mpdu bytes
  5073. * b'25:31 - rsvd2: Reserved for future use
  5074. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5075. * Enable MGMT packet from 0b0000 to 0b1001
  5076. * bits from low to high: FP, MD, MO - 3 bits
  5077. * FP: Filter_Pass
  5078. * MD: Monitor_Direct
  5079. * MO: Monitor_Other
  5080. * 10 mgmt subtypes * 3 bits -> 30 bits
  5081. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5082. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5083. * Enable MGMT packet from 0b1010 to 0b1111
  5084. * bits from low to high: FP, MD, MO - 3 bits
  5085. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5086. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5087. * Enable CTRL packet from 0b0000 to 0b1001
  5088. * bits from low to high: FP, MD, MO - 3 bits
  5089. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5090. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5091. * Enable CTRL packet from 0b1010 to 0b1111,
  5092. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5093. * bits from low to high: FP, MD, MO - 3 bits
  5094. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5095. * dword6 - b'0:31 - tlv_filter_in_flags:
  5096. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5097. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5098. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5099. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5100. * A value of 0 will be considered as ignore this config.
  5101. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5102. * e.g. wmac_top_reg_seq_hwioreg.h
  5103. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5104. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5105. * A value of 0 will be considered as ignore this config.
  5106. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5107. * e.g. wmac_top_reg_seq_hwioreg.h
  5108. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5109. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5110. * A value of 0 will be considered as ignore this config.
  5111. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5112. * e.g. wmac_top_reg_seq_hwioreg.h
  5113. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5114. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5115. * A value of 0 will be considered as ignore this config.
  5116. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5117. * e.g. wmac_top_reg_seq_hwioreg.h
  5118. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5119. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5120. * A value of 0 will be considered as ignore this config.
  5121. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5122. * e.g. wmac_top_reg_seq_hwioreg.h
  5123. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5124. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5125. * A value of 0 will be considered as ignore this config.
  5126. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5127. * e.g. wmac_top_reg_seq_hwioreg.h
  5128. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5129. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5130. * A value of 0 will be considered as ignore this config.
  5131. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5132. * e.g. wmac_top_reg_seq_hwioreg.h
  5133. * - b'16:31 - rsvd3 for future use
  5134. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5135. * to source rings. Consumer drops packets if the available
  5136. * words in the ring falls below the configured threshold
  5137. * value.
  5138. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5139. * by host. 1 -> subscribed
  5140. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5141. * by host. 1 -> subscribed
  5142. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5143. * subscribed by host. 1 -> subscribed
  5144. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5145. * selection for the FP PHY ERR status tlv.
  5146. * 0 - wbm2rxdma_buf_source_ring
  5147. * 1 - fw2rxdma_buf_source_ring
  5148. * 2 - sw2rxdma_buf_source_ring
  5149. * 3 - no_buffer_ring
  5150. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5151. * selection for the FP PHY ERR status tlv.
  5152. * 0 - rxdma_release_ring
  5153. * 1 - rxdma2fw_ring
  5154. * 2 - rxdma2sw_ring
  5155. * 3 - rxdma2reo_ring
  5156. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5157. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5158. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5159. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5160. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5161. * 0: MSDU level logging
  5162. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5163. * 0: MSDU level logging
  5164. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5165. * 0: MSDU level logging
  5166. * - b'23 - word_mask_compaction: enable/disable word mask for
  5167. * mpdu/msdu start/end tlvs
  5168. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5169. * manager override
  5170. * - b'25:28 - rbm_override_val: return buffer manager override value
  5171. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5172. * which have to be posted to host from phy.
  5173. * Corresponding to errors defined in
  5174. * phyrx_abort_request_reason enums 0 to 31.
  5175. * Refer to RXPCU register definition header files for the
  5176. * phyrx_abort_request_reason enum definition.
  5177. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5178. * errors which have to be posted to host from phy.
  5179. * Corresponding to errors defined in
  5180. * phyrx_abort_request_reason enums 32 to 63.
  5181. * Refer to RXPCU register definition header files for the
  5182. * phyrx_abort_request_reason enum definition.
  5183. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5184. * applicable if word mask enabled
  5185. * - b'16:31 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5186. * applicable if word mask enabled
  5187. * dword15- b'0:16 - rx_msdu_end_word_mask
  5188. b'17:31 - rsvd5
  5189. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5190. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5191. * buffer
  5192. * 1: RX_PKT TLV logging at specified offset for the
  5193. * subsequent buffer
  5194. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5195. */
  5196. PREPACK struct htt_rx_ring_selection_cfg_t {
  5197. A_UINT32 msg_type: 8,
  5198. pdev_id: 8,
  5199. ring_id: 8,
  5200. status_swap: 1,
  5201. pkt_swap: 1,
  5202. rx_offsets_valid: 1,
  5203. drop_thresh_valid: 1,
  5204. rsvd1: 4;
  5205. A_UINT32 ring_buffer_size: 16,
  5206. config_length_mgmt:3,
  5207. config_length_ctrl:3,
  5208. config_length_data:3,
  5209. rsvd2: 7;
  5210. A_UINT32 packet_type_enable_flags_0;
  5211. A_UINT32 packet_type_enable_flags_1;
  5212. A_UINT32 packet_type_enable_flags_2;
  5213. A_UINT32 packet_type_enable_flags_3;
  5214. A_UINT32 tlv_filter_in_flags;
  5215. A_UINT32 rx_packet_offset: 16,
  5216. rx_header_offset: 16;
  5217. A_UINT32 rx_mpdu_end_offset: 16,
  5218. rx_mpdu_start_offset: 16;
  5219. A_UINT32 rx_msdu_end_offset: 16,
  5220. rx_msdu_start_offset: 16;
  5221. A_UINT32 rx_attn_offset: 16,
  5222. rsvd3: 16;
  5223. A_UINT32 rx_drop_threshold: 10,
  5224. fp_ndp: 1,
  5225. mo_ndp: 1,
  5226. fp_phy_err: 1,
  5227. fp_phy_err_buf_src: 2,
  5228. fp_phy_err_buf_dest: 2,
  5229. pkt_type_enable_msdu_or_mpdu_logging:3,
  5230. dma_mpdu_mgmt: 1,
  5231. dma_mpdu_ctrl: 1,
  5232. dma_mpdu_data: 1,
  5233. word_mask_compaction_enable:1,
  5234. rbm_override_enable: 1,
  5235. rbm_override_val: 4,
  5236. rsvd4: 3;
  5237. A_UINT32 phy_err_mask;
  5238. A_UINT32 phy_err_mask_cont;
  5239. A_UINT32 rx_mpdu_start_word_mask:16,
  5240. rx_mpdu_end_word_mask: 16;
  5241. A_UINT32 rx_msdu_end_word_mask: 17,
  5242. rsvd5: 15;
  5243. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5244. rx_pkt_tlv_offset: 15,
  5245. rsvd6: 16;
  5246. } POSTPACK;
  5247. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5248. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5249. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5250. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5251. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5252. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5253. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5254. do { \
  5255. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5256. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5257. } while (0)
  5258. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5259. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5260. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5261. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5262. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5263. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5264. do { \
  5265. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5266. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5267. } while (0)
  5268. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5269. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5270. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5271. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5272. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5273. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5274. do { \
  5275. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5276. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5277. } while (0)
  5278. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5279. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5280. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5281. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5282. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5283. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5284. do { \
  5285. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5286. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5287. } while (0)
  5288. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5289. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5290. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5291. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5292. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5293. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5294. do { \
  5295. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5296. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5297. } while (0)
  5298. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5299. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5300. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5301. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5302. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5303. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5304. do { \
  5305. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5306. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5307. } while (0)
  5308. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5309. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5310. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5311. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5312. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5313. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5314. do { \
  5315. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5316. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5317. } while (0)
  5318. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5319. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5320. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5321. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5322. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5323. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5324. do { \
  5325. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5326. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5327. } while (0)
  5328. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5329. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5330. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5331. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5332. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5333. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5334. do { \
  5335. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5336. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5337. } while (0)
  5338. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5339. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5340. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5341. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5342. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5343. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5344. do { \
  5345. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5346. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5347. } while (0)
  5348. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5349. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5350. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5351. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5352. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5354. do { \
  5355. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5356. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5357. } while (0)
  5358. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5359. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5361. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5362. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5364. do { \
  5365. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5366. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5367. } while (0)
  5368. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5369. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5370. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5371. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5372. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5373. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5374. do { \
  5375. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5376. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5377. } while (0)
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5381. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5382. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5383. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5384. do { \
  5385. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5386. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5387. } while (0)
  5388. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5389. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5390. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5391. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5392. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5393. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5394. do { \
  5395. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5396. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5397. } while (0)
  5398. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5399. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5400. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5401. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5402. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5403. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5404. do { \
  5405. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5406. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5407. } while (0)
  5408. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5409. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5410. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5411. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5412. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5413. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5414. do { \
  5415. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5416. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5417. } while (0)
  5418. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5419. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5420. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5421. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5422. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5423. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5424. do { \
  5425. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5426. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5427. } while (0)
  5428. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5429. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5430. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5431. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5432. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5433. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5434. do { \
  5435. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5436. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5437. } while (0)
  5438. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5439. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5440. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5441. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5442. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5443. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5446. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5447. } while (0)
  5448. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5449. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5450. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5451. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5452. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5453. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5454. do { \
  5455. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5456. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5457. } while (0)
  5458. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5459. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5460. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5461. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5462. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5463. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5466. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5467. } while (0)
  5468. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5469. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5470. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5471. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5472. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5473. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5474. do { \
  5475. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5476. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5477. } while (0)
  5478. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5479. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5480. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5481. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5482. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5483. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5484. do { \
  5485. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5486. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5487. } while (0)
  5488. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5489. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5490. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5491. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5492. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5493. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5496. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5497. } while (0)
  5498. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5499. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5500. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5501. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5502. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5503. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5506. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5507. } while (0)
  5508. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5509. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5510. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5511. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5512. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5513. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5516. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5517. } while (0)
  5518. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5519. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5520. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5521. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5522. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5523. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5524. do { \
  5525. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5526. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5527. } while (0)
  5528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5531. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5532. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5536. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5537. } while (0)
  5538. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5539. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5540. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5541. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5542. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5543. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5546. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5547. } while (0)
  5548. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5549. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5550. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5551. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5552. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5553. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5556. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5557. } while (0)
  5558. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5559. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5560. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5561. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5562. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5563. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5566. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5567. } while (0)
  5568. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5569. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5570. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5571. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5572. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5573. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5576. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5577. } while (0)
  5578. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5579. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5580. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5581. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5582. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5583. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5586. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5587. } while (0)
  5588. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5589. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5590. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5591. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5592. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5593. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5594. do { \
  5595. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5596. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5597. } while (0)
  5598. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5599. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5600. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5601. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5602. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5603. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5604. do { \
  5605. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5606. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5607. } while (0)
  5608. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5609. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5610. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5611. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5612. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5613. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5616. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5617. } while (0)
  5618. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5619. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5620. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5621. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5622. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5623. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5626. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5627. } while (0)
  5628. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0xFFFF0000
  5629. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5630. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5631. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5632. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5633. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5634. do { \
  5635. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5636. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5637. } while (0)
  5638. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5639. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5640. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5641. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5642. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5643. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5644. do { \
  5645. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5646. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5647. } while (0)
  5648. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5649. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5650. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5651. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5652. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5653. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5654. do { \
  5655. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5656. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5657. } while (0)
  5658. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5659. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5660. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5661. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5662. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5663. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5664. do { \
  5665. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5666. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5667. } while (0)
  5668. /*
  5669. * Subtype based MGMT frames enable bits.
  5670. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5671. */
  5672. /* association request */
  5673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5679. /* association response */
  5680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5686. /* Reassociation request */
  5687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5693. /* Reassociation response */
  5694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5700. /* Probe request */
  5701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5707. /* Probe response */
  5708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5714. /* Timing Advertisement */
  5715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5721. /* Reserved */
  5722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5728. /* Beacon */
  5729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5735. /* ATIM */
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5742. /* Disassociation */
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5749. /* Authentication */
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5756. /* Deauthentication */
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5763. /* Action */
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5770. /* Action No Ack */
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5777. /* Reserved */
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5784. /*
  5785. * Subtype based CTRL frames enable bits.
  5786. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5787. */
  5788. /* Reserved */
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5795. /* Reserved */
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5802. /* Reserved */
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5809. /* Reserved */
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5816. /* Reserved */
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5823. /* Reserved */
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5830. /* Reserved */
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5837. /* Control Wrapper */
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5844. /* Block Ack Request */
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5851. /* Block Ack*/
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5858. /* PS-POLL */
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5865. /* RTS */
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5872. /* CTS */
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5879. /* ACK */
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5886. /* CF-END */
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5893. /* CF-END + CF-ACK */
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5900. /* Multicast data */
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5907. /* Unicast data */
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5914. /* NULL data */
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5922. do { \
  5923. HTT_CHECK_SET_VAL(httsym, value); \
  5924. (word) |= (value) << httsym##_S; \
  5925. } while (0)
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5927. (((word) & httsym##_M) >> httsym##_S)
  5928. #define htt_rx_ring_pkt_enable_subtype_set( \
  5929. word, flag, mode, type, subtype, val) \
  5930. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5931. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5932. #define htt_rx_ring_pkt_enable_subtype_get( \
  5933. word, flag, mode, type, subtype) \
  5934. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5935. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5936. /* Definition to filter in TLVs */
  5937. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5938. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5939. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5940. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5941. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5942. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5943. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5944. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5945. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5946. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5947. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5948. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5949. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5950. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5951. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5952. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5953. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5954. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5955. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5956. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5957. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5958. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5959. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5960. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5961. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5962. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5963. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5964. do { \
  5965. HTT_CHECK_SET_VAL(httsym, enable); \
  5966. (word) |= (enable) << httsym##_S; \
  5967. } while (0)
  5968. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5969. (((word) & httsym##_M) >> httsym##_S)
  5970. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5971. HTT_RX_RING_TLV_ENABLE_SET( \
  5972. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5973. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5974. HTT_RX_RING_TLV_ENABLE_GET( \
  5975. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5976. /**
  5977. * @brief host -> target TX monitor config message
  5978. *
  5979. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5980. *
  5981. * @details
  5982. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5983. * configure RXDMA rings.
  5984. * The configuration is per ring based and includes both packet types
  5985. * and PPDU/MPDU TLVs.
  5986. *
  5987. * The message would appear as follows:
  5988. *
  5989. * |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|
  5990. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5991. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5992. * |-----------+--------+--------+-----+------------------------------------|
  5993. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5994. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5995. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5996. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5997. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5998. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5999. * |------------------------------------------------------------------------|
  6000. * | tlv_filter_mask_in0 |
  6001. * |------------------------------------------------------------------------|
  6002. * | tlv_filter_mask_in1 |
  6003. * |------------------------------------------------------------------------|
  6004. * | tlv_filter_mask_in2 |
  6005. * |------------------------------------------------------------------------|
  6006. * | tlv_filter_mask_in3 |
  6007. * |-----------------+-----------------+---------------------+--------------|
  6008. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6009. * |------------------------------------------------------------------------|
  6010. * | pcu_ppdu_setup_word_mask |
  6011. * |--------------------+--+--+--+-----+---------------------+--------------|
  6012. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6013. * |------------------------------------------------------------------------|
  6014. *
  6015. * Where:
  6016. * PS = pkt_swap
  6017. * SS = status_swap
  6018. * The message is interpreted as follows:
  6019. * dword0 - b'0:7 - msg_type: This will be set to
  6020. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6021. * b'8:15 - pdev_id:
  6022. * 0 (for rings at SOC level),
  6023. * 1/2/3 mac id (for rings at LMAC level)
  6024. * b'16:23 - ring_id : Identify the ring to configure.
  6025. * More details can be got from enum htt_srng_ring_id
  6026. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6027. * BUF_RING_CFG_0 defs within HW .h files,
  6028. * e.g. wmac_top_reg_seq_hwioreg.h
  6029. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6030. * BUF_RING_CFG_0 defs within HW .h files,
  6031. * e.g. wmac_top_reg_seq_hwioreg.h
  6032. * b'26:31 - rsvd1: reserved for future use
  6033. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6034. * in byte units.
  6035. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6036. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6037. * 64, 128, 256.
  6038. * If all 3 bits are set config length is > 256.
  6039. * if val is '0', then ignore this field.
  6040. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6041. * 64, 128, 256.
  6042. * If all 3 bits are set config length is > 256.
  6043. * if val is '0', then ignore this field.
  6044. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6045. * 64, 128, 256.
  6046. * If all 3 bits are set config length is > 256.
  6047. * If val is '0', then ignore this field.
  6048. * - b'25:31 - rsvd2: Reserved for future use
  6049. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6050. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6051. * If packet_type_enable_flags is '1' for MGMT type,
  6052. * monitor will ignore this bit and allow this TLV.
  6053. * If packet_type_enable_flags is '0' for MGMT type,
  6054. * monitor will use this bit to enable/disable logging
  6055. * of this TLV.
  6056. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6057. * If packet_type_enable_flags is '1' for CTRL type,
  6058. * monitor will ignore this bit and allow this TLV.
  6059. * If packet_type_enable_flags is '0' for CTRL type,
  6060. * monitor will use this bit to enable/disable logging
  6061. * of this TLV.
  6062. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6063. * If packet_type_enable_flags is '1' for DATA type,
  6064. * monitor will ignore this bit and allow this TLV.
  6065. * If packet_type_enable_flags is '0' for DATA type,
  6066. * monitor will use this bit to enable/disable logging
  6067. * of this TLV.
  6068. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6069. * If packet_type_enable_flags is '1' for MGMT type,
  6070. * monitor will ignore this bit and allow this TLV.
  6071. * If packet_type_enable_flags is '0' for MGMT type,
  6072. * monitor will use this bit to enable/disable logging
  6073. * of this TLV.
  6074. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6075. * If packet_type_enable_flags is '1' for CTRL type,
  6076. * monitor will ignore this bit and allow this TLV.
  6077. * If packet_type_enable_flags is '0' for CTRL type,
  6078. * monitor will use this bit to enable/disable logging
  6079. * of this TLV.
  6080. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6081. * If packet_type_enable_flags is '1' for DATA type,
  6082. * monitor will ignore this bit and allow this TLV.
  6083. * If packet_type_enable_flags is '0' for DATA type,
  6084. * monitor will use this bit to enable/disable logging
  6085. * of this TLV.
  6086. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6087. * If packet_type_enable_flags is '1' for MGMT type,
  6088. * monitor will ignore this bit and allow this TLV.
  6089. * If packet_type_enable_flags is '0' for MGMT type,
  6090. * monitor will use this bit to enable/disable logging
  6091. * of this TLV.
  6092. * If filter_in_TX_MPDU_START = 1 it is recommended
  6093. * to set this bit.
  6094. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6095. * If packet_type_enable_flags is '1' for CTRL type,
  6096. * monitor will ignore this bit and allow this TLV.
  6097. * If packet_type_enable_flags is '0' for CTRL type,
  6098. * monitor will use this bit to enable/disable logging
  6099. * of this TLV.
  6100. * If filter_in_TX_MPDU_START = 1 it is recommended
  6101. * to set this bit.
  6102. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6103. * If packet_type_enable_flags is '1' for DATA type,
  6104. * monitor will ignore this bit and allow this TLV.
  6105. * If packet_type_enable_flags is '0' for DATA type,
  6106. * monitor will use this bit to enable/disable logging
  6107. * of this TLV.
  6108. * If filter_in_TX_MPDU_START = 1 it is recommended
  6109. * to set this bit.
  6110. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6111. * If packet_type_enable_flags is '1' for MGMT type,
  6112. * monitor will ignore this bit and allow this TLV.
  6113. * If packet_type_enable_flags is '0' for MGMT type,
  6114. * monitor will use this bit to enable/disable logging
  6115. * of this TLV.
  6116. * If filter_in_TX_MSDU_START = 1 it is recommended
  6117. * to set this bit.
  6118. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6119. * If packet_type_enable_flags is '1' for CTRL type,
  6120. * monitor will ignore this bit and allow this TLV.
  6121. * If packet_type_enable_flags is '0' for CTRL type,
  6122. * monitor will use this bit to enable/disable logging
  6123. * of this TLV.
  6124. * If filter_in_TX_MSDU_START = 1 it is recommended
  6125. * to set this bit.
  6126. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6127. * If packet_type_enable_flags is '1' for DATA type,
  6128. * monitor will ignore this bit and allow this TLV.
  6129. * If packet_type_enable_flags is '0' for DATA type,
  6130. * monitor will use this bit to enable/disable logging
  6131. * of this TLV.
  6132. * If filter_in_TX_MSDU_START = 1 it is recommended
  6133. * to set this bit.
  6134. * b'15:31 - rsvd3: Reserved for future use
  6135. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6136. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6137. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6138. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6139. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6140. * - b'8:15 - tx_peer_entry_word_mask:
  6141. * - b'16:23 - tx_queue_ext_word_mask:
  6142. * - b'24:31 - tx_msdu_start_word_mask:
  6143. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6144. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6145. * - b'8:15 - rxpcu_user_setup_word_mask:
  6146. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6147. * MGMT, CTRL, DATA
  6148. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6149. * 0 -> MSDU level logging is enabled
  6150. * (valid only if bit is set in
  6151. * pkt_type_enable_msdu_or_mpdu_logging)
  6152. * 1 -> MPDU level logging is enabled
  6153. * (valid only if bit is set in
  6154. * pkt_type_enable_msdu_or_mpdu_logging)
  6155. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6156. * 0 -> MSDU level logging is enabled
  6157. * (valid only if bit is set in
  6158. * pkt_type_enable_msdu_or_mpdu_logging)
  6159. * 1 -> MPDU level logging is enabled
  6160. * (valid only if bit is set in
  6161. * pkt_type_enable_msdu_or_mpdu_logging)
  6162. * - b'21 - dma_mpdu_data(D) : For DATA
  6163. * 0 -> MSDU level logging is enabled
  6164. * (valid only if bit is set in
  6165. * pkt_type_enable_msdu_or_mpdu_logging)
  6166. * 1 -> MPDU level logging is enabled
  6167. * (valid only if bit is set in
  6168. * pkt_type_enable_msdu_or_mpdu_logging)
  6169. * - b'22:31 - rsvd4 for future use
  6170. */
  6171. PREPACK struct htt_tx_monitor_cfg_t {
  6172. A_UINT32 msg_type: 8,
  6173. pdev_id: 8,
  6174. ring_id: 8,
  6175. status_swap: 1,
  6176. pkt_swap: 1,
  6177. rsvd1: 6;
  6178. A_UINT32 ring_buffer_size: 16,
  6179. config_length_mgmt: 3,
  6180. config_length_ctrl: 3,
  6181. config_length_data: 3,
  6182. rsvd2: 7;
  6183. A_UINT32 pkt_type_enable_flags: 3,
  6184. filter_in_tx_mpdu_start_mgmt: 1,
  6185. filter_in_tx_mpdu_start_ctrl: 1,
  6186. filter_in_tx_mpdu_start_data: 1,
  6187. filter_in_tx_msdu_start_mgmt: 1,
  6188. filter_in_tx_msdu_start_ctrl: 1,
  6189. filter_in_tx_msdu_start_data: 1,
  6190. filter_in_tx_mpdu_end_mgmt: 1,
  6191. filter_in_tx_mpdu_end_ctrl: 1,
  6192. filter_in_tx_mpdu_end_data: 1,
  6193. filter_in_tx_msdu_end_mgmt: 1,
  6194. filter_in_tx_msdu_end_ctrl: 1,
  6195. filter_in_tx_msdu_end_data: 1,
  6196. rsvd3: 17;
  6197. A_UINT32 tlv_filter_mask_in0;
  6198. A_UINT32 tlv_filter_mask_in1;
  6199. A_UINT32 tlv_filter_mask_in2;
  6200. A_UINT32 tlv_filter_mask_in3;
  6201. A_UINT32 tx_fes_setup_word_mask: 8,
  6202. tx_peer_entry_word_mask: 8,
  6203. tx_queue_ext_word_mask: 8,
  6204. tx_msdu_start_word_mask: 8;
  6205. A_UINT32 pcu_ppdu_setup_word_mask;
  6206. A_UINT32 tx_mpdu_start_word_mask: 8,
  6207. rxpcu_user_setup_word_mask: 8,
  6208. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6209. dma_mpdu_mgmt: 1,
  6210. dma_mpdu_ctrl: 1,
  6211. dma_mpdu_data: 1,
  6212. rsvd4: 10;
  6213. } POSTPACK;
  6214. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6215. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6216. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6217. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6218. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6219. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6220. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6221. do { \
  6222. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6223. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6224. } while (0)
  6225. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6226. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6227. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6228. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6229. HTT_TX_MONITOR_CFG_RING_ID_S)
  6230. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6231. do { \
  6232. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6233. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6234. } while (0)
  6235. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6236. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6237. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6238. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6239. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6240. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6241. do { \
  6242. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6243. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6244. } while (0)
  6245. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6246. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6247. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6248. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6249. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6250. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6251. do { \
  6252. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6253. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6254. } while (0)
  6255. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6256. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6257. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6258. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6259. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6260. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6261. do { \
  6262. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6263. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6264. } while (0)
  6265. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6266. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6267. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6268. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6269. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6270. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6271. do { \
  6272. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6273. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6274. } while (0)
  6275. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6276. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6277. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6278. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6279. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6280. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6281. do { \
  6282. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6283. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6284. } while (0)
  6285. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6286. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6287. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6288. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6289. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6290. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6291. do { \
  6292. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6293. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6294. } while (0)
  6295. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6296. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6297. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6298. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6299. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6300. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6301. do { \
  6302. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6303. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6304. } while (0)
  6305. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6306. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6307. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6308. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6309. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6310. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6311. do { \
  6312. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6313. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6314. } while (0)
  6315. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6316. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6317. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6318. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6319. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6320. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6321. do { \
  6322. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6323. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6324. } while (0
  6325. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6326. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6327. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6328. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6329. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6330. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6331. do { \
  6332. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6333. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6334. } while (0)
  6335. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6336. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6337. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6338. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6339. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6340. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6341. do { \
  6342. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6343. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6344. } while (0)
  6345. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6346. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6347. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6348. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6349. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6350. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6351. do { \
  6352. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6353. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6354. } while (0
  6355. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6356. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6357. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6358. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6359. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6360. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6361. do { \
  6362. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6363. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6364. } while (0)
  6365. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6366. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6367. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6368. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6369. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6370. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6373. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6374. } while (0)
  6375. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6376. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6377. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6378. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6379. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6380. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6381. do { \
  6382. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6383. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6384. } while (0
  6385. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6386. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6387. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6388. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6389. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6390. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6391. do { \
  6392. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6393. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6394. } while (0)
  6395. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6396. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6397. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6398. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6399. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6400. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6401. do { \
  6402. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6403. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6404. } while (0)
  6405. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6406. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6407. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6408. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6409. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6410. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6411. do { \
  6412. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6413. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6414. } while (0
  6415. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6416. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6417. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6418. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6419. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6420. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6421. do { \
  6422. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6423. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6424. } while (0)
  6425. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6426. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6427. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6428. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6429. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6430. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6431. do { \
  6432. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6433. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6434. } while (0)
  6435. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6436. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6437. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6438. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6439. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6440. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6441. do { \
  6442. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6443. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6444. } while (0)
  6445. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6446. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6447. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6448. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6449. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6450. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6451. do { \
  6452. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6453. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6454. } while (0)
  6455. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6456. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6457. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6458. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6459. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6460. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6461. do { \
  6462. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6463. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6464. } while (0)
  6465. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6466. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6467. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6468. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6469. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6470. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6471. do { \
  6472. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6473. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6474. } while (0)
  6475. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6476. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6477. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6478. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6479. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6480. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6481. do { \
  6482. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6483. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6484. } while (0)
  6485. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6486. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6487. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6488. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6489. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6490. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6491. do { \
  6492. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6493. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6494. } while (0)
  6495. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6496. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6497. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6498. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6499. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6500. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6503. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6504. } while (0)
  6505. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6506. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6507. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6508. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6509. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6510. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6511. do { \
  6512. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6513. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6514. } while (0)
  6515. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6516. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6517. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6518. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6519. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6520. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6521. do { \
  6522. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6523. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6524. } while (0)
  6525. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6526. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6527. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6528. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6529. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6530. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6533. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6534. } while (0)
  6535. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6536. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6537. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6538. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6539. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6540. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6543. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6544. } while (0)
  6545. /*
  6546. * pkt_type_enable_flags
  6547. */
  6548. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6549. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6550. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6551. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6552. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6553. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6554. /*
  6555. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6556. */
  6557. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6558. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6559. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6560. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6561. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6562. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6563. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6564. do { \
  6565. HTT_CHECK_SET_VAL(httsym, value); \
  6566. (word) |= (value) << httsym##_S; \
  6567. } while (0)
  6568. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6569. (((word) & httsym##_M) >> httsym##_S)
  6570. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6571. * type -> MGMT, CTRL, DATA*/
  6572. #define htt_tx_ring_pkt_type_set( \
  6573. word, mode, type, val) \
  6574. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6575. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6576. #define htt_tx_ring_pkt_type_get( \
  6577. word, mode, type) \
  6578. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6579. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6580. /* Definition to filter in TLVs */
  6581. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6582. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6583. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6584. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6585. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6586. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6587. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6588. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6589. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6590. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6591. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6592. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6593. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6594. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6595. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6596. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6597. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6598. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6599. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6600. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6601. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6602. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6603. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6604. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6605. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6606. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6607. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6608. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6609. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6610. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6611. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6612. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6613. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6614. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6615. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6616. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6617. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6618. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6619. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6620. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6621. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6622. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6623. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6624. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6625. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6626. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6627. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6628. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6629. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6630. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6631. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6632. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6633. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6634. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6635. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6636. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6637. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6638. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6639. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6640. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6641. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6642. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6643. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6644. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6645. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6646. do { \
  6647. HTT_CHECK_SET_VAL(httsym, enable); \
  6648. (word) |= (enable) << httsym##_S; \
  6649. } while (0)
  6650. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6651. (((word) & httsym##_M) >> httsym##_S)
  6652. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6653. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6654. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6655. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6656. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6657. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6722. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6723. do { \
  6724. HTT_CHECK_SET_VAL(httsym, enable); \
  6725. (word) |= (enable) << httsym##_S; \
  6726. } while (0)
  6727. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6728. (((word) & httsym##_M) >> httsym##_S)
  6729. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6730. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6731. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6732. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6733. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6734. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6799. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6800. do { \
  6801. HTT_CHECK_SET_VAL(httsym, enable); \
  6802. (word) |= (enable) << httsym##_S; \
  6803. } while (0)
  6804. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6805. (((word) & httsym##_M) >> httsym##_S)
  6806. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6807. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6808. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6809. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6810. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6811. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6856. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6857. do { \
  6858. HTT_CHECK_SET_VAL(httsym, enable); \
  6859. (word) |= (enable) << httsym##_S; \
  6860. } while (0)
  6861. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6862. (((word) & httsym##_M) >> httsym##_S)
  6863. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6864. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6865. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6866. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6867. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6868. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6869. /**
  6870. * @brief host --> target Receive Flow Steering configuration message definition
  6871. *
  6872. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6873. *
  6874. * host --> target Receive Flow Steering configuration message definition.
  6875. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6876. * The reason for this is we want RFS to be configured and ready before MAC
  6877. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6878. *
  6879. * |31 24|23 16|15 9|8|7 0|
  6880. * |----------------+----------------+----------------+----------------|
  6881. * | reserved |E| msg type |
  6882. * |-------------------------------------------------------------------|
  6883. * Where E = RFS enable flag
  6884. *
  6885. * The RFS_CONFIG message consists of a single 4-byte word.
  6886. *
  6887. * Header fields:
  6888. * - MSG_TYPE
  6889. * Bits 7:0
  6890. * Purpose: identifies this as a RFS config msg
  6891. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6892. * - RFS_CONFIG
  6893. * Bit 8
  6894. * Purpose: Tells target whether to enable (1) or disable (0)
  6895. * flow steering feature when sending rx indication messages to host
  6896. */
  6897. #define HTT_H2T_RFS_CONFIG_M 0x100
  6898. #define HTT_H2T_RFS_CONFIG_S 8
  6899. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6900. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6901. HTT_H2T_RFS_CONFIG_S)
  6902. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6903. do { \
  6904. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6905. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6906. } while (0)
  6907. #define HTT_RFS_CFG_REQ_BYTES 4
  6908. /**
  6909. * @brief host -> target FW extended statistics retrieve
  6910. *
  6911. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6912. *
  6913. * @details
  6914. * The following field definitions describe the format of the HTT host
  6915. * to target FW extended stats retrieve message.
  6916. * The message specifies the type of stats the host wants to retrieve.
  6917. *
  6918. * |31 24|23 16|15 8|7 0|
  6919. * |-----------------------------------------------------------|
  6920. * | reserved | stats type | pdev_mask | msg type |
  6921. * |-----------------------------------------------------------|
  6922. * | config param [0] |
  6923. * |-----------------------------------------------------------|
  6924. * | config param [1] |
  6925. * |-----------------------------------------------------------|
  6926. * | config param [2] |
  6927. * |-----------------------------------------------------------|
  6928. * | config param [3] |
  6929. * |-----------------------------------------------------------|
  6930. * | reserved |
  6931. * |-----------------------------------------------------------|
  6932. * | cookie LSBs |
  6933. * |-----------------------------------------------------------|
  6934. * | cookie MSBs |
  6935. * |-----------------------------------------------------------|
  6936. * Header fields:
  6937. * - MSG_TYPE
  6938. * Bits 7:0
  6939. * Purpose: identifies this is a extended stats upload request message
  6940. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6941. * - PDEV_MASK
  6942. * Bits 8:15
  6943. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6944. * Value: This is a overloaded field, refer to usage and interpretation of
  6945. * PDEV in interface document.
  6946. * Bit 8 : Reserved for SOC stats
  6947. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6948. * Indicates MACID_MASK in DBS
  6949. * - STATS_TYPE
  6950. * Bits 23:16
  6951. * Purpose: identifies which FW statistics to upload
  6952. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6953. * - Reserved
  6954. * Bits 31:24
  6955. * - CONFIG_PARAM [0]
  6956. * Bits 31:0
  6957. * Purpose: give an opaque configuration value to the specified stats type
  6958. * Value: stats-type specific configuration value
  6959. * Refer to htt_stats.h for interpretation for each stats sub_type
  6960. * - CONFIG_PARAM [1]
  6961. * Bits 31:0
  6962. * Purpose: give an opaque configuration value to the specified stats type
  6963. * Value: stats-type specific configuration value
  6964. * Refer to htt_stats.h for interpretation for each stats sub_type
  6965. * - CONFIG_PARAM [2]
  6966. * Bits 31:0
  6967. * Purpose: give an opaque configuration value to the specified stats type
  6968. * Value: stats-type specific configuration value
  6969. * Refer to htt_stats.h for interpretation for each stats sub_type
  6970. * - CONFIG_PARAM [3]
  6971. * Bits 31:0
  6972. * Purpose: give an opaque configuration value to the specified stats type
  6973. * Value: stats-type specific configuration value
  6974. * Refer to htt_stats.h for interpretation for each stats sub_type
  6975. * - Reserved [31:0] for future use.
  6976. * - COOKIE_LSBS
  6977. * Bits 31:0
  6978. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6979. * message with its preceding host->target stats request message.
  6980. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6981. * - COOKIE_MSBS
  6982. * Bits 31:0
  6983. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6984. * message with its preceding host->target stats request message.
  6985. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6986. */
  6987. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6988. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6989. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6990. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6991. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6992. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6993. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6994. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6995. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6996. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6997. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6998. do { \
  6999. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7000. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7001. } while (0)
  7002. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7003. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7004. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7005. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7006. do { \
  7007. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7008. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7009. } while (0)
  7010. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7011. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7012. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7013. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7014. do { \
  7015. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7016. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7017. } while (0)
  7018. /**
  7019. * @brief host -> target FW PPDU_STATS request message
  7020. *
  7021. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7022. *
  7023. * @details
  7024. * The following field definitions describe the format of the HTT host
  7025. * to target FW for PPDU_STATS_CFG msg.
  7026. * The message allows the host to configure the PPDU_STATS_IND messages
  7027. * produced by the target.
  7028. *
  7029. * |31 24|23 16|15 8|7 0|
  7030. * |-----------------------------------------------------------|
  7031. * | REQ bit mask | pdev_mask | msg type |
  7032. * |-----------------------------------------------------------|
  7033. * Header fields:
  7034. * - MSG_TYPE
  7035. * Bits 7:0
  7036. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7037. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7038. * - PDEV_MASK
  7039. * Bits 8:15
  7040. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7041. * Value: This is a overloaded field, refer to usage and interpretation of
  7042. * PDEV in interface document.
  7043. * Bit 8 : Reserved for SOC stats
  7044. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7045. * Indicates MACID_MASK in DBS
  7046. * - REQ_TLV_BIT_MASK
  7047. * Bits 16:31
  7048. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7049. * needs to be included in the target's PPDU_STATS_IND messages.
  7050. * Value: refer htt_ppdu_stats_tlv_tag_t
  7051. *
  7052. */
  7053. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7054. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7055. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7056. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7057. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7058. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7059. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7060. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7061. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7062. do { \
  7063. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7064. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7065. } while (0)
  7066. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7067. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7068. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7069. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7070. do { \
  7071. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7072. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7073. } while (0)
  7074. /**
  7075. * @brief Host-->target HTT RX FSE setup message
  7076. *
  7077. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7078. *
  7079. * @details
  7080. * Through this message, the host will provide details of the flow tables
  7081. * in host DDR along with hash keys.
  7082. * This message can be sent per SOC or per PDEV, which is differentiated
  7083. * by pdev id values.
  7084. * The host will allocate flow search table and sends table size,
  7085. * physical DMA address of flow table, and hash keys to firmware to
  7086. * program into the RXOLE FSE HW block.
  7087. *
  7088. * The following field definitions describe the format of the RX FSE setup
  7089. * message sent from the host to target
  7090. *
  7091. * Header fields:
  7092. * dword0 - b'7:0 - msg_type: This will be set to
  7093. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7094. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7095. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7096. * pdev's LMAC ring.
  7097. * b'31:16 - reserved : Reserved for future use
  7098. * dword1 - b'19:0 - number of records: This field indicates the number of
  7099. * entries in the flow table. For example: 8k number of
  7100. * records is equivalent to
  7101. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7102. * b'27:20 - max search: This field specifies the skid length to FSE
  7103. * parser HW module whenever match is not found at the
  7104. * exact index pointed by hash.
  7105. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7106. * Refer htt_ip_da_sa_prefix below for more details.
  7107. * b'31:30 - reserved: Reserved for future use
  7108. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7109. * table allocated by host in DDR
  7110. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7111. * table allocated by host in DDR
  7112. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7113. * entry hashing
  7114. *
  7115. *
  7116. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7117. * |---------------------------------------------------------------|
  7118. * | reserved | pdev_id | MSG_TYPE |
  7119. * |---------------------------------------------------------------|
  7120. * |resvd|IPDSA| max_search | Number of records |
  7121. * |---------------------------------------------------------------|
  7122. * | base address lo |
  7123. * |---------------------------------------------------------------|
  7124. * | base address high |
  7125. * |---------------------------------------------------------------|
  7126. * | toeplitz key 31_0 |
  7127. * |---------------------------------------------------------------|
  7128. * | toeplitz key 63_32 |
  7129. * |---------------------------------------------------------------|
  7130. * | toeplitz key 95_64 |
  7131. * |---------------------------------------------------------------|
  7132. * | toeplitz key 127_96 |
  7133. * |---------------------------------------------------------------|
  7134. * | toeplitz key 159_128 |
  7135. * |---------------------------------------------------------------|
  7136. * | toeplitz key 191_160 |
  7137. * |---------------------------------------------------------------|
  7138. * | toeplitz key 223_192 |
  7139. * |---------------------------------------------------------------|
  7140. * | toeplitz key 255_224 |
  7141. * |---------------------------------------------------------------|
  7142. * | toeplitz key 287_256 |
  7143. * |---------------------------------------------------------------|
  7144. * | reserved | toeplitz key 314_288(26:0 bits) |
  7145. * |---------------------------------------------------------------|
  7146. * where:
  7147. * IPDSA = ip_da_sa
  7148. */
  7149. /**
  7150. * @brief: htt_ip_da_sa_prefix
  7151. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7152. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7153. * documentation per RFC3849
  7154. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7155. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7156. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7157. */
  7158. enum htt_ip_da_sa_prefix {
  7159. HTT_RX_IPV6_20010db8,
  7160. HTT_RX_IPV4_MAPPED_IPV6,
  7161. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7162. HTT_RX_IPV6_64FF9B,
  7163. };
  7164. /**
  7165. * @brief Host-->target HTT RX FISA configure and enable
  7166. *
  7167. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7168. *
  7169. * @details
  7170. * The host will send this command down to configure and enable the FISA
  7171. * operational params.
  7172. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7173. * register.
  7174. * Should configure both the MACs.
  7175. *
  7176. * dword0 - b'7:0 - msg_type:
  7177. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7178. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7179. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7180. * pdev's LMAC ring.
  7181. * b'31:16 - reserved : Reserved for future use
  7182. *
  7183. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7184. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7185. * packets. 1 flow search will be skipped
  7186. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7187. * tcp,udp packets
  7188. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7189. * calculation
  7190. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7191. * calculation
  7192. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7193. * calculation
  7194. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7195. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7196. * length
  7197. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7198. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7199. * length
  7200. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7201. * num jump
  7202. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7203. * num jump
  7204. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7205. * data type switch has happend for MPDU Sequence num jump
  7206. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7207. * for MPDU Sequence num jump
  7208. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7209. * for decrypt errors
  7210. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7211. * while aggregating a msdu
  7212. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7213. * The aggregation is done until (number of MSDUs aggregated
  7214. * < LIMIT + 1)
  7215. * b'31:18 - Reserved
  7216. *
  7217. * fisa_control_value - 32bit value FW can write to register
  7218. *
  7219. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7220. * Threshold value for FISA timeout (units are microseconds).
  7221. * When the global timestamp exceeds this threshold, FISA
  7222. * aggregation will be restarted.
  7223. * A value of 0 means timeout is disabled.
  7224. * Compare the threshold register with timestamp field in
  7225. * flow entry to generate timeout for the flow.
  7226. *
  7227. * |31 18 |17 16|15 8|7 0|
  7228. * |-------------------------------------------------------------|
  7229. * | reserved | pdev_mask | msg type |
  7230. * |-------------------------------------------------------------|
  7231. * | reserved | FISA_CTRL |
  7232. * |-------------------------------------------------------------|
  7233. * | FISA_TIMEOUT_THRESH |
  7234. * |-------------------------------------------------------------|
  7235. */
  7236. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7237. A_UINT32 msg_type:8,
  7238. pdev_id:8,
  7239. reserved0:16;
  7240. /**
  7241. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7242. * [17:0]
  7243. */
  7244. union {
  7245. /*
  7246. * fisa_control_bits structure is deprecated.
  7247. * Please use fisa_control_bits_v2 going forward.
  7248. */
  7249. struct {
  7250. A_UINT32 fisa_enable: 1,
  7251. ipsec_skip_search: 1,
  7252. nontcp_skip_search: 1,
  7253. add_ipv4_fixed_hdr_len: 1,
  7254. add_ipv6_fixed_hdr_len: 1,
  7255. add_tcp_fixed_hdr_len: 1,
  7256. add_udp_hdr_len: 1,
  7257. chksum_cum_ip_len_en: 1,
  7258. disable_tid_check: 1,
  7259. disable_ta_check: 1,
  7260. disable_qos_check: 1,
  7261. disable_raw_check: 1,
  7262. disable_decrypt_err_check: 1,
  7263. disable_msdu_drop_check: 1,
  7264. fisa_aggr_limit: 4,
  7265. reserved: 14;
  7266. } fisa_control_bits;
  7267. struct {
  7268. A_UINT32 fisa_enable: 1,
  7269. fisa_aggr_limit: 4,
  7270. reserved: 27;
  7271. } fisa_control_bits_v2;
  7272. A_UINT32 fisa_control_value;
  7273. } u_fisa_control;
  7274. /**
  7275. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7276. * timeout threshold for aggregation. Unit in usec.
  7277. * [31:0]
  7278. */
  7279. A_UINT32 fisa_timeout_threshold;
  7280. } POSTPACK;
  7281. /* DWord 0: pdev-ID */
  7282. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7283. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7284. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7285. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7286. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7287. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7288. do { \
  7289. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7290. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7291. } while (0)
  7292. /* Dword 1: fisa_control_value fisa config */
  7293. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7294. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7295. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7296. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7297. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7298. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7299. do { \
  7300. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7301. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7302. } while (0)
  7303. /* Dword 1: fisa_control_value ipsec_skip_search */
  7304. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7305. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7306. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7307. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7308. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7309. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7310. do { \
  7311. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7312. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7313. } while (0)
  7314. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7315. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7316. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7317. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7318. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7319. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7320. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7321. do { \
  7322. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7323. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7324. } while (0)
  7325. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7326. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7327. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7328. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7329. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7330. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7331. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7332. do { \
  7333. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7334. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7335. } while (0)
  7336. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7337. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7338. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7339. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7340. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7341. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7342. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7343. do { \
  7344. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7345. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7346. } while (0)
  7347. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7348. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7349. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7350. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7351. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7352. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7353. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7354. do { \
  7355. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7356. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7357. } while (0)
  7358. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7359. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7360. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7361. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7362. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7363. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7364. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7365. do { \
  7366. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7367. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7368. } while (0)
  7369. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7370. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7371. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7372. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7373. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7374. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7375. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7376. do { \
  7377. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7378. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7379. } while (0)
  7380. /* Dword 1: fisa_control_value disable_tid_check */
  7381. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7382. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7383. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7384. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7385. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7386. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7387. do { \
  7388. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7389. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7390. } while (0)
  7391. /* Dword 1: fisa_control_value disable_ta_check */
  7392. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7393. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7394. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7395. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7396. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7397. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7398. do { \
  7399. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7400. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7401. } while (0)
  7402. /* Dword 1: fisa_control_value disable_qos_check */
  7403. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7404. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7405. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7406. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7407. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7408. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7409. do { \
  7410. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7411. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7412. } while (0)
  7413. /* Dword 1: fisa_control_value disable_raw_check */
  7414. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7415. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7416. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7417. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7418. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7419. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7420. do { \
  7421. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7422. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7423. } while (0)
  7424. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7425. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7426. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7427. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7428. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7429. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7430. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7431. do { \
  7432. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7433. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7434. } while (0)
  7435. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7436. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7437. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7438. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7439. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7440. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7441. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7442. do { \
  7443. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7444. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7445. } while (0)
  7446. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7447. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7448. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7449. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7450. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7451. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7452. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7453. do { \
  7454. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7455. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7456. } while (0)
  7457. /* Dword 1: fisa_control_value fisa config */
  7458. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7459. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7460. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7461. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7462. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7463. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7464. do { \
  7465. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7466. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7467. } while (0)
  7468. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7469. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7470. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7471. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7472. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7473. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7474. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7475. do { \
  7476. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7477. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7478. } while (0)
  7479. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7480. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7481. pdev_id:8,
  7482. reserved0:16;
  7483. A_UINT32 num_records:20,
  7484. max_search:8,
  7485. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7486. reserved1:2;
  7487. A_UINT32 base_addr_lo;
  7488. A_UINT32 base_addr_hi;
  7489. A_UINT32 toeplitz31_0;
  7490. A_UINT32 toeplitz63_32;
  7491. A_UINT32 toeplitz95_64;
  7492. A_UINT32 toeplitz127_96;
  7493. A_UINT32 toeplitz159_128;
  7494. A_UINT32 toeplitz191_160;
  7495. A_UINT32 toeplitz223_192;
  7496. A_UINT32 toeplitz255_224;
  7497. A_UINT32 toeplitz287_256;
  7498. A_UINT32 toeplitz314_288:27,
  7499. reserved2:5;
  7500. } POSTPACK;
  7501. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7502. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7503. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7504. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7505. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7506. /* DWORD 0: Pdev ID */
  7507. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7508. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7509. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7510. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7511. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7512. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7513. do { \
  7514. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7515. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7516. } while (0)
  7517. /* DWORD 1:num of records */
  7518. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7519. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7520. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7521. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7522. HTT_RX_FSE_SETUP_NUM_REC_S)
  7523. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7524. do { \
  7525. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7526. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7527. } while (0)
  7528. /* DWORD 1:max_search */
  7529. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7530. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7531. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7532. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7533. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7534. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7535. do { \
  7536. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7537. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7538. } while (0)
  7539. /* DWORD 1:ip_da_sa prefix */
  7540. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7541. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7542. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7543. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7544. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7545. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7546. do { \
  7547. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7548. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7549. } while (0)
  7550. /* DWORD 2: Base Address LO */
  7551. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7552. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7553. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7554. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7555. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7556. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7557. do { \
  7558. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7559. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7560. } while (0)
  7561. /* DWORD 3: Base Address High */
  7562. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7563. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7564. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7565. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7566. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7567. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7568. do { \
  7569. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7570. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7571. } while (0)
  7572. /* DWORD 4-12: Hash Value */
  7573. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7574. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7575. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7576. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7577. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7578. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7579. do { \
  7580. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7581. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7582. } while (0)
  7583. /* DWORD 13: Hash Value 314:288 bits */
  7584. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7585. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7586. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7587. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7588. do { \
  7589. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7590. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7591. } while (0)
  7592. /**
  7593. * @brief Host-->target HTT RX FSE operation message
  7594. *
  7595. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7596. *
  7597. * @details
  7598. * The host will send this Flow Search Engine (FSE) operation message for
  7599. * every flow add/delete operation.
  7600. * The FSE operation includes FSE full cache invalidation or individual entry
  7601. * invalidation.
  7602. * This message can be sent per SOC or per PDEV which is differentiated
  7603. * by pdev id values.
  7604. *
  7605. * |31 16|15 8|7 1|0|
  7606. * |-------------------------------------------------------------|
  7607. * | reserved | pdev_id | MSG_TYPE |
  7608. * |-------------------------------------------------------------|
  7609. * | reserved | operation |I|
  7610. * |-------------------------------------------------------------|
  7611. * | ip_src_addr_31_0 |
  7612. * |-------------------------------------------------------------|
  7613. * | ip_src_addr_63_32 |
  7614. * |-------------------------------------------------------------|
  7615. * | ip_src_addr_95_64 |
  7616. * |-------------------------------------------------------------|
  7617. * | ip_src_addr_127_96 |
  7618. * |-------------------------------------------------------------|
  7619. * | ip_dst_addr_31_0 |
  7620. * |-------------------------------------------------------------|
  7621. * | ip_dst_addr_63_32 |
  7622. * |-------------------------------------------------------------|
  7623. * | ip_dst_addr_95_64 |
  7624. * |-------------------------------------------------------------|
  7625. * | ip_dst_addr_127_96 |
  7626. * |-------------------------------------------------------------|
  7627. * | l4_dst_port | l4_src_port |
  7628. * | (32-bit SPI incase of IPsec) |
  7629. * |-------------------------------------------------------------|
  7630. * | reserved | l4_proto |
  7631. * |-------------------------------------------------------------|
  7632. *
  7633. * where I is 1-bit ipsec_valid.
  7634. *
  7635. * The following field definitions describe the format of the RX FSE operation
  7636. * message sent from the host to target for every add/delete flow entry to flow
  7637. * table.
  7638. *
  7639. * Header fields:
  7640. * dword0 - b'7:0 - msg_type: This will be set to
  7641. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7642. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7643. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7644. * specified pdev's LMAC ring.
  7645. * b'31:16 - reserved : Reserved for future use
  7646. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7647. * (Internet Protocol Security).
  7648. * IPsec describes the framework for providing security at
  7649. * IP layer. IPsec is defined for both versions of IP:
  7650. * IPV4 and IPV6.
  7651. * Please refer to htt_rx_flow_proto enumeration below for
  7652. * more info.
  7653. * ipsec_valid = 1 for IPSEC packets
  7654. * ipsec_valid = 0 for IP Packets
  7655. * b'7:1 - operation: This indicates types of FSE operation.
  7656. * Refer to htt_rx_fse_operation enumeration:
  7657. * 0 - No Cache Invalidation required
  7658. * 1 - Cache invalidate only one entry given by IP
  7659. * src/dest address at DWORD[2:9]
  7660. * 2 - Complete FSE Cache Invalidation
  7661. * 3 - FSE Disable
  7662. * 4 - FSE Enable
  7663. * b'31:8 - reserved: Reserved for future use
  7664. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7665. * for per flow addition/deletion
  7666. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7667. * and the subsequent 3 A_UINT32 will be padding bytes.
  7668. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7669. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7670. * from 0 to 65535 but only 0 to 1023 are designated as
  7671. * well-known ports. Refer to [RFC1700] for more details.
  7672. * This field is valid only if
  7673. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7674. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7675. * range from 0 to 65535 but only 0 to 1023 are designated
  7676. * as well-known ports. Refer to [RFC1700] for more details.
  7677. * This field is valid only if
  7678. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7679. * - SPI (31:0): Security Parameters Index is an
  7680. * identification tag added to the header while using IPsec
  7681. * for tunneling the IP traffici.
  7682. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7683. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7684. * Assigned Internet Protocol Numbers.
  7685. * l4_proto numbers for standard protocol like UDP/TCP
  7686. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7687. * l4_proto = 17 for UDP etc.
  7688. * b'31:8 - reserved: Reserved for future use.
  7689. *
  7690. */
  7691. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7692. A_UINT32 msg_type:8,
  7693. pdev_id:8,
  7694. reserved0:16;
  7695. A_UINT32 ipsec_valid:1,
  7696. operation:7,
  7697. reserved1:24;
  7698. A_UINT32 ip_src_addr_31_0;
  7699. A_UINT32 ip_src_addr_63_32;
  7700. A_UINT32 ip_src_addr_95_64;
  7701. A_UINT32 ip_src_addr_127_96;
  7702. A_UINT32 ip_dest_addr_31_0;
  7703. A_UINT32 ip_dest_addr_63_32;
  7704. A_UINT32 ip_dest_addr_95_64;
  7705. A_UINT32 ip_dest_addr_127_96;
  7706. union {
  7707. A_UINT32 spi;
  7708. struct {
  7709. A_UINT32 l4_src_port:16,
  7710. l4_dest_port:16;
  7711. } ip;
  7712. } u;
  7713. A_UINT32 l4_proto:8,
  7714. reserved:24;
  7715. } POSTPACK;
  7716. /**
  7717. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7718. *
  7719. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7720. *
  7721. * @details
  7722. * The host will send this Full monitor mode register configuration message.
  7723. * This message can be sent per SOC or per PDEV which is differentiated
  7724. * by pdev id values.
  7725. *
  7726. * |31 16|15 11|10 8|7 3|2|1|0|
  7727. * |-------------------------------------------------------------|
  7728. * | reserved | pdev_id | MSG_TYPE |
  7729. * |-------------------------------------------------------------|
  7730. * | reserved |Release Ring |N|Z|E|
  7731. * |-------------------------------------------------------------|
  7732. *
  7733. * where E is 1-bit full monitor mode enable/disable.
  7734. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7735. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7736. *
  7737. * The following field definitions describe the format of the full monitor
  7738. * mode configuration message sent from the host to target for each pdev.
  7739. *
  7740. * Header fields:
  7741. * dword0 - b'7:0 - msg_type: This will be set to
  7742. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7743. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7744. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7745. * specified pdev's LMAC ring.
  7746. * b'31:16 - reserved : Reserved for future use.
  7747. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7748. * monitor mode rxdma register is to be enabled or disabled.
  7749. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7750. * additional descriptors at ppdu end for zero mpdus
  7751. * enabled or disabled.
  7752. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7753. * additional descriptors at ppdu end for non zero mpdus
  7754. * enabled or disabled.
  7755. * b'10:3 - release_ring: This indicates the destination ring
  7756. * selection for the descriptor at the end of PPDU
  7757. * 0 - REO ring select
  7758. * 1 - FW ring select
  7759. * 2 - SW ring select
  7760. * 3 - Release ring select
  7761. * Refer to htt_rx_full_mon_release_ring.
  7762. * b'31:11 - reserved for future use
  7763. */
  7764. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7765. A_UINT32 msg_type:8,
  7766. pdev_id:8,
  7767. reserved0:16;
  7768. A_UINT32 full_monitor_mode_enable:1,
  7769. addnl_descs_zero_mpdus_end:1,
  7770. addnl_descs_non_zero_mpdus_end:1,
  7771. release_ring:8,
  7772. reserved1:21;
  7773. } POSTPACK;
  7774. /**
  7775. * Enumeration for full monitor mode destination ring select
  7776. * 0 - REO destination ring select
  7777. * 1 - FW destination ring select
  7778. * 2 - SW destination ring select
  7779. * 3 - Release destination ring select
  7780. */
  7781. enum htt_rx_full_mon_release_ring {
  7782. HTT_RX_MON_RING_REO,
  7783. HTT_RX_MON_RING_FW,
  7784. HTT_RX_MON_RING_SW,
  7785. HTT_RX_MON_RING_RELEASE,
  7786. };
  7787. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7788. /* DWORD 0: Pdev ID */
  7789. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7790. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7791. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7792. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7793. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7794. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7795. do { \
  7796. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7797. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7798. } while (0)
  7799. /* DWORD 1:ENABLE */
  7800. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7801. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7802. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7803. do { \
  7804. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7805. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7806. } while (0)
  7807. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7808. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7809. /* DWORD 1:ZERO_MPDU */
  7810. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7811. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7812. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7813. do { \
  7814. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7815. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7816. } while (0)
  7817. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7818. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7819. /* DWORD 1:NON_ZERO_MPDU */
  7820. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7821. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7822. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7823. do { \
  7824. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7825. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7826. } while (0)
  7827. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7828. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7829. /* DWORD 1:RELEASE_RINGS */
  7830. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7831. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7832. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7833. do { \
  7834. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7835. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7836. } while (0)
  7837. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7838. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7839. /**
  7840. * Enumeration for IP Protocol or IPSEC Protocol
  7841. * IPsec describes the framework for providing security at IP layer.
  7842. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7843. */
  7844. enum htt_rx_flow_proto {
  7845. HTT_RX_FLOW_IP_PROTO,
  7846. HTT_RX_FLOW_IPSEC_PROTO,
  7847. };
  7848. /**
  7849. * Enumeration for FSE Cache Invalidation
  7850. * 0 - No Cache Invalidation required
  7851. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7852. * 2 - Complete FSE Cache Invalidation
  7853. * 3 - FSE Disable
  7854. * 4 - FSE Enable
  7855. */
  7856. enum htt_rx_fse_operation {
  7857. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7858. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7859. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7860. HTT_RX_FSE_DISABLE,
  7861. HTT_RX_FSE_ENABLE,
  7862. };
  7863. /* DWORD 0: Pdev ID */
  7864. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7865. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7866. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7867. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7868. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7869. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7870. do { \
  7871. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7872. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7873. } while (0)
  7874. /* DWORD 1:IP PROTO or IPSEC */
  7875. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7876. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7877. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7878. do { \
  7879. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7880. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7881. } while (0)
  7882. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7883. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7884. /* DWORD 1:FSE Operation */
  7885. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7886. #define HTT_RX_FSE_OPERATION_S 1
  7887. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7888. do { \
  7889. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7890. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7891. } while (0)
  7892. #define HTT_RX_FSE_OPERATION_GET(word) \
  7893. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7894. /* DWORD 2-9:IP Address */
  7895. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7896. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7897. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7898. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7899. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7900. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7901. do { \
  7902. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7903. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7904. } while (0)
  7905. /* DWORD 10:Source Port Number */
  7906. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7907. #define HTT_RX_FSE_SOURCEPORT_S 0
  7908. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7909. do { \
  7910. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7911. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7912. } while (0)
  7913. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7914. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7915. /* DWORD 11:Destination Port Number */
  7916. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7917. #define HTT_RX_FSE_DESTPORT_S 16
  7918. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7919. do { \
  7920. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7921. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7922. } while (0)
  7923. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7924. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7925. /* DWORD 10-11:SPI (In case of IPSEC) */
  7926. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7927. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7928. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7929. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7930. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7931. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7932. do { \
  7933. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7934. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7935. } while (0)
  7936. /* DWORD 12:L4 PROTO */
  7937. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7938. #define HTT_RX_FSE_L4_PROTO_S 0
  7939. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7940. do { \
  7941. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7942. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7943. } while (0)
  7944. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7945. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7946. /**
  7947. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7948. *
  7949. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7950. *
  7951. * |31 24|23 |15 8|7 2|1|0|
  7952. * |----------------+----------------+----------------+----------------|
  7953. * | reserved | pdev_id | msg_type |
  7954. * |---------------------------------+----------------+----------------|
  7955. * | reserved |E|F|
  7956. * |---------------------------------+----------------+----------------|
  7957. * Where E = Configure the target to provide the 3-tuple hash value in
  7958. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7959. * F = Configure the target to provide the 3-tuple hash value in
  7960. * flow_id_toeplitz field of rx_msdu_start tlv
  7961. *
  7962. * The following field definitions describe the format of the 3 tuple hash value
  7963. * message sent from the host to target as part of initialization sequence.
  7964. *
  7965. * Header fields:
  7966. * dword0 - b'7:0 - msg_type: This will be set to
  7967. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7968. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7969. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7970. * specified pdev's LMAC ring.
  7971. * b'31:16 - reserved : Reserved for future use
  7972. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7973. * b'1 - toeplitz_hash_2_or_4_field_enable
  7974. * b'31:2 - reserved : Reserved for future use
  7975. * ---------+------+----------------------------------------------------------
  7976. * bit1 | bit0 | Functionality
  7977. * ---------+------+----------------------------------------------------------
  7978. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7979. * | | in flow_id_toeplitz field
  7980. * ---------+------+----------------------------------------------------------
  7981. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7982. * | | in toeplitz_hash_2_or_4 field
  7983. * ---------+------+----------------------------------------------------------
  7984. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7985. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7986. * ---------+------+----------------------------------------------------------
  7987. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7988. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7989. * | | toeplitz_hash_2_or_4 field
  7990. *----------------------------------------------------------------------------
  7991. */
  7992. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7993. A_UINT32 msg_type :8,
  7994. pdev_id :8,
  7995. reserved0 :16;
  7996. A_UINT32 flow_id_toeplitz_field_enable :1,
  7997. toeplitz_hash_2_or_4_field_enable :1,
  7998. reserved1 :30;
  7999. } POSTPACK;
  8000. /* DWORD0 : pdev_id configuration Macros */
  8001. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8002. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8003. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8004. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8005. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8006. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8007. do { \
  8008. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8009. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8010. } while (0)
  8011. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8012. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8013. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8014. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8015. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8016. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8017. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8018. do { \
  8019. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8020. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8021. } while (0)
  8022. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8023. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8024. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8025. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8026. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8027. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8028. do { \
  8029. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8030. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8031. } while (0)
  8032. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8033. /**
  8034. * @brief host --> target Host PA Address Size
  8035. *
  8036. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8037. *
  8038. * @details
  8039. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8040. * provide the physical start address and size of each of the memory
  8041. * areas within host DDR that the target FW may need to access.
  8042. *
  8043. * For example, the host can use this message to allow the target FW
  8044. * to set up access to the host's pools of TQM link descriptors.
  8045. * The message would appear as follows:
  8046. *
  8047. * |31 24|23 16|15 8|7 0|
  8048. * |----------------+----------------+----------------+----------------|
  8049. * | reserved | num_entries | msg_type |
  8050. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8051. * | mem area 0 size |
  8052. * |----------------+----------------+----------------+----------------|
  8053. * | mem area 0 physical_address_lo |
  8054. * |----------------+----------------+----------------+----------------|
  8055. * | mem area 0 physical_address_hi |
  8056. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8057. * | mem area 1 size |
  8058. * |----------------+----------------+----------------+----------------|
  8059. * | mem area 1 physical_address_lo |
  8060. * |----------------+----------------+----------------+----------------|
  8061. * | mem area 1 physical_address_hi |
  8062. * |----------------+----------------+----------------+----------------|
  8063. * ...
  8064. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8065. * | mem area N size |
  8066. * |----------------+----------------+----------------+----------------|
  8067. * | mem area N physical_address_lo |
  8068. * |----------------+----------------+----------------+----------------|
  8069. * | mem area N physical_address_hi |
  8070. * |----------------+----------------+----------------+----------------|
  8071. *
  8072. * The message is interpreted as follows:
  8073. * dword0 - b'0:7 - msg_type: This will be set to
  8074. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8075. * b'8:15 - number_entries: Indicated the number of host memory
  8076. * areas specified within the remainder of the message
  8077. * b'16:31 - reserved.
  8078. * dword1 - b'0:31 - memory area 0 size in bytes
  8079. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8080. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8081. * and similar for memory area 1 through memory area N.
  8082. */
  8083. PREPACK struct htt_h2t_host_paddr_size {
  8084. A_UINT32 msg_type: 8,
  8085. num_entries: 8,
  8086. reserved: 16;
  8087. } POSTPACK;
  8088. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8089. A_UINT32 size;
  8090. A_UINT32 physical_address_lo;
  8091. A_UINT32 physical_address_hi;
  8092. } POSTPACK;
  8093. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8094. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8095. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8096. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8097. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8098. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8099. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8100. do { \
  8101. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8102. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8103. } while (0)
  8104. /**
  8105. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8106. *
  8107. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8108. *
  8109. * @details
  8110. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8111. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8112. *
  8113. * The message would appear as follows:
  8114. *
  8115. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8116. * |---------------------------------+---+---+----------+-+-----------|
  8117. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8118. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8119. *
  8120. *
  8121. * The message is interpreted as follows:
  8122. * dword0 - b'0:7 - msg_type: This will be set to
  8123. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8124. * b'8 - override bit to drive MSDUs to PPE ring
  8125. * b'9:13 - REO destination ring indication
  8126. * b'14 - Multi buffer msdu override enable bit
  8127. * b'15 - Intra BSS override
  8128. * b'16 - Decap raw override
  8129. * b'17 - Decap Native wifi override
  8130. * b'18 - IP frag override
  8131. * b'19:31 - reserved
  8132. */
  8133. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8134. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8135. override: 1,
  8136. reo_destination_indication: 5,
  8137. multi_buffer_msdu_override_en: 1,
  8138. intra_bss_override: 1,
  8139. decap_raw_override: 1,
  8140. decap_nwifi_override: 1,
  8141. ip_frag_override: 1,
  8142. reserved: 13;
  8143. } POSTPACK;
  8144. /* DWORD 0: Override */
  8145. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8146. #define HTT_PPE_CFG_OVERRIDE_S 8
  8147. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8148. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8149. HTT_PPE_CFG_OVERRIDE_S)
  8150. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8151. do { \
  8152. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8153. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8154. } while (0)
  8155. /* DWORD 0: REO Destination Indication*/
  8156. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8157. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8158. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8159. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8160. HTT_PPE_CFG_REO_DEST_IND_S)
  8161. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8162. do { \
  8163. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8164. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8165. } while (0)
  8166. /* DWORD 0: Multi buffer MSDU override */
  8167. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8168. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8169. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8170. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8171. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8172. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8173. do { \
  8174. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8175. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8176. } while (0)
  8177. /* DWORD 0: Intra BSS override */
  8178. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8179. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8180. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8181. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8182. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8183. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8184. do { \
  8185. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8186. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8187. } while (0)
  8188. /* DWORD 0: Decap RAW override */
  8189. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8190. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8191. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8192. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8193. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8194. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8195. do { \
  8196. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8197. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8198. } while (0)
  8199. /* DWORD 0: Decap NWIFI override */
  8200. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8201. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8202. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8203. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8204. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8205. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8206. do { \
  8207. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8208. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8209. } while (0)
  8210. /* DWORD 0: IP frag override */
  8211. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8212. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8213. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8214. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8215. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8216. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8217. do { \
  8218. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8219. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8220. } while (0)
  8221. /*
  8222. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8223. *
  8224. * @details
  8225. * The following field definitions describe the format of the HTT host
  8226. * to target FW VDEV TX RX stats retrieve message.
  8227. * The message specifies the type of stats the host wants to retrieve.
  8228. *
  8229. * |31 27|26 25|24 17|16|15 8|7 0|
  8230. * |-----------------------------------------------------------|
  8231. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8232. * |-----------------------------------------------------------|
  8233. * | vdev_id lower bitmask |
  8234. * |-----------------------------------------------------------|
  8235. * | vdev_id upper bitmask |
  8236. * |-----------------------------------------------------------|
  8237. * Header fields:
  8238. * Where:
  8239. * dword0 - b'7:0 - msg_type: This will be set to
  8240. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8241. * b'15:8 - pdev id
  8242. * b'16(E) - Enable/Disable the vdev HW stats
  8243. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8244. * b'25:26(R) - Reset stats bits
  8245. * 0: don't reset stats
  8246. * 1: reset stats once
  8247. * 2: reset stats at the start of each periodic interval
  8248. * b'27:31 - reserved for future use
  8249. * dword1 - b'0:31 - vdev_id lower bitmask
  8250. * dword2 - b'0:31 - vdev_id upper bitmask
  8251. */
  8252. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8253. A_UINT32 msg_type :8,
  8254. pdev_id :8,
  8255. enable :1,
  8256. periodic_interval :8,
  8257. reset_stats_bits :2,
  8258. reserved0 :5;
  8259. A_UINT32 vdev_id_lower_bitmask;
  8260. A_UINT32 vdev_id_upper_bitmask;
  8261. } POSTPACK;
  8262. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8263. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8264. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8265. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8266. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8267. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8268. do { \
  8269. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8270. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8271. } while (0)
  8272. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8273. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8274. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8275. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8276. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8277. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8278. do { \
  8279. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8280. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8281. } while (0)
  8282. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8283. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8284. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8285. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8286. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8287. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8288. do { \
  8289. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8290. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8291. } while (0)
  8292. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8293. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8294. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8295. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8296. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8297. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8298. do { \
  8299. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8300. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8301. } while (0)
  8302. /*
  8303. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8304. *
  8305. * @details
  8306. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8307. * the default MSDU queues for one of the TIDs within the specified peer
  8308. * to the specified service class.
  8309. * The TID is indirectly specified - each service class is associated
  8310. * with a TID. All default MSDU queues for this peer-TID will be
  8311. * linked to the service class in question.
  8312. *
  8313. * |31 16|15 8|7 0|
  8314. * |------------------------------+--------------+--------------|
  8315. * | peer ID | svc class ID | msg type |
  8316. * |------------------------------------------------------------|
  8317. * Header fields:
  8318. * dword0 - b'7:0 - msg_type: This will be set to
  8319. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8320. * b'15:8 - service class ID
  8321. * b'31:16 - peer ID
  8322. */
  8323. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8324. A_UINT32 msg_type :8,
  8325. svc_class_id :8,
  8326. peer_id :16;
  8327. } POSTPACK;
  8328. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8329. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8330. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8331. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8332. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8333. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8334. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8335. do { \
  8336. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8337. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8338. } while (0)
  8339. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8340. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8341. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8342. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8343. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8344. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8345. do { \
  8346. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8347. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8348. } while (0)
  8349. /*
  8350. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8351. *
  8352. * @details
  8353. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8354. * remove the linkage of the specified peer-TID's MSDU queues to
  8355. * service classes.
  8356. *
  8357. * |31 16|15 8|7 0|
  8358. * |------------------------------+--------------+--------------|
  8359. * | peer ID | svc class ID | msg type |
  8360. * |------------------------------------------------------------|
  8361. * Header fields:
  8362. * dword0 - b'7:0 - msg_type: This will be set to
  8363. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8364. * b'15:8 - service class ID
  8365. * dword1 - b'31:16 - peer ID
  8366. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8367. * value for peer ID indicates that the target should
  8368. * apply the UNMAP_REQ to all peers.
  8369. */
  8370. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8371. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8372. A_UINT32 msg_type :8,
  8373. svc_class_id :8,
  8374. peer_id :16;
  8375. } POSTPACK;
  8376. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8377. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8378. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8379. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(_var) \
  8380. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8381. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8382. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8383. do { \
  8384. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8385. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8386. } while (0)
  8387. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8388. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8389. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(_var) \
  8390. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8391. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8392. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(_var, _val) \
  8393. do { \
  8394. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8395. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8396. } while (0)
  8397. /*
  8398. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8399. *
  8400. * @details
  8401. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8402. * request the target to report what service class the default MSDU queues
  8403. * of the specified TIDs within the peer are linked to.
  8404. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8405. * to report what service class (if any) the default MSDU queues for
  8406. * each of the specified TIDs are linked to.
  8407. *
  8408. * |31 16|15 8|7 0|
  8409. * |------------------------------+--------------+--------------|
  8410. * | peer ID | TID mask | msg type |
  8411. * |------------------------------------------------------------|
  8412. * Header fields:
  8413. * dword0 - b'7:0 - msg_type: This will be set to
  8414. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8415. * b'15:8 - TID mask
  8416. * dword1 - b'31:16 - peer ID
  8417. */
  8418. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8419. A_UINT32 msg_type :8,
  8420. tid_mask :8,
  8421. peer_id :16;
  8422. } POSTPACK;
  8423. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 4
  8424. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8425. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8426. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(_var) \
  8427. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8428. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8429. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(_var, _val) \
  8430. do { \
  8431. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8432. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8433. } while (0)
  8434. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8435. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8436. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(_var) \
  8437. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8438. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8439. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(_var, _val) \
  8440. do { \
  8441. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8442. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8443. } while (0)
  8444. /*=== target -> host messages ===============================================*/
  8445. enum htt_t2h_msg_type {
  8446. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8447. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8448. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8449. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8450. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8451. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8452. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8453. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8454. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8455. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8456. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8457. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8458. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8459. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8460. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8461. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8462. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8463. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8464. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8465. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8466. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8467. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8468. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8469. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8470. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8471. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8472. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8473. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8474. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8475. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8476. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8477. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8478. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8479. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8480. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8481. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8482. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8483. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8484. /* TX_OFFLOAD_DELIVER_IND:
  8485. * Forward the target's locally-generated packets to the host,
  8486. * to provide to the monitor mode interface.
  8487. */
  8488. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8489. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8490. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8491. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8492. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8493. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8494. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8495. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8496. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8497. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e,
  8498. HTT_T2H_MSG_TYPE_TEST,
  8499. /* keep this last */
  8500. HTT_T2H_NUM_MSGS
  8501. };
  8502. /*
  8503. * HTT target to host message type -
  8504. * stored in bits 7:0 of the first word of the message
  8505. */
  8506. #define HTT_T2H_MSG_TYPE_M 0xff
  8507. #define HTT_T2H_MSG_TYPE_S 0
  8508. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8509. do { \
  8510. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8511. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8512. } while (0)
  8513. #define HTT_T2H_MSG_TYPE_GET(word) \
  8514. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8515. /**
  8516. * @brief target -> host version number confirmation message definition
  8517. *
  8518. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8519. *
  8520. * |31 24|23 16|15 8|7 0|
  8521. * |----------------+----------------+----------------+----------------|
  8522. * | reserved | major number | minor number | msg type |
  8523. * |-------------------------------------------------------------------|
  8524. * : option request TLV (optional) |
  8525. * :...................................................................:
  8526. *
  8527. * The VER_CONF message may consist of a single 4-byte word, or may be
  8528. * extended with TLVs that specify HTT options selected by the target.
  8529. * The following option TLVs may be appended to the VER_CONF message:
  8530. * - LL_BUS_ADDR_SIZE
  8531. * - HL_SUPPRESS_TX_COMPL_IND
  8532. * - MAX_TX_QUEUE_GROUPS
  8533. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8534. * may be appended to the VER_CONF message (but only one TLV of each type).
  8535. *
  8536. * Header fields:
  8537. * - MSG_TYPE
  8538. * Bits 7:0
  8539. * Purpose: identifies this as a version number confirmation message
  8540. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8541. * - VER_MINOR
  8542. * Bits 15:8
  8543. * Purpose: Specify the minor number of the HTT message library version
  8544. * in use by the target firmware.
  8545. * The minor number specifies the specific revision within a range
  8546. * of fundamentally compatible HTT message definition revisions.
  8547. * Compatible revisions involve adding new messages or perhaps
  8548. * adding new fields to existing messages, in a backwards-compatible
  8549. * manner.
  8550. * Incompatible revisions involve changing the message type values,
  8551. * or redefining existing messages.
  8552. * Value: minor number
  8553. * - VER_MAJOR
  8554. * Bits 15:8
  8555. * Purpose: Specify the major number of the HTT message library version
  8556. * in use by the target firmware.
  8557. * The major number specifies the family of minor revisions that are
  8558. * fundamentally compatible with each other, but not with prior or
  8559. * later families.
  8560. * Value: major number
  8561. */
  8562. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8563. #define HTT_VER_CONF_MINOR_S 8
  8564. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8565. #define HTT_VER_CONF_MAJOR_S 16
  8566. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8567. do { \
  8568. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8569. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8570. } while (0)
  8571. #define HTT_VER_CONF_MINOR_GET(word) \
  8572. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8573. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8574. do { \
  8575. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8576. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8577. } while (0)
  8578. #define HTT_VER_CONF_MAJOR_GET(word) \
  8579. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8580. #define HTT_VER_CONF_BYTES 4
  8581. /**
  8582. * @brief - target -> host HTT Rx In order indication message
  8583. *
  8584. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8585. *
  8586. * @details
  8587. *
  8588. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8589. * |----------------+-------------------+---------------------+---------------|
  8590. * | peer ID | P| F| O| ext TID | msg type |
  8591. * |--------------------------------------------------------------------------|
  8592. * | MSDU count | Reserved | vdev id |
  8593. * |--------------------------------------------------------------------------|
  8594. * | MSDU 0 bus address (bits 31:0) |
  8595. #if HTT_PADDR64
  8596. * | MSDU 0 bus address (bits 63:32) |
  8597. #endif
  8598. * |--------------------------------------------------------------------------|
  8599. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8600. * |--------------------------------------------------------------------------|
  8601. * | MSDU 1 bus address (bits 31:0) |
  8602. #if HTT_PADDR64
  8603. * | MSDU 1 bus address (bits 63:32) |
  8604. #endif
  8605. * |--------------------------------------------------------------------------|
  8606. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8607. * |--------------------------------------------------------------------------|
  8608. */
  8609. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8610. *
  8611. * @details
  8612. * bits
  8613. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8614. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8615. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8616. * | | frag | | | | fail |chksum fail|
  8617. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8618. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8619. */
  8620. struct htt_rx_in_ord_paddr_ind_hdr_t
  8621. {
  8622. A_UINT32 /* word 0 */
  8623. msg_type: 8,
  8624. ext_tid: 5,
  8625. offload: 1,
  8626. frag: 1,
  8627. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8628. peer_id: 16;
  8629. A_UINT32 /* word 1 */
  8630. vap_id: 8,
  8631. /* NOTE:
  8632. * This reserved_1 field is not truly reserved - certain targets use
  8633. * this field internally to store debug information, and do not zero
  8634. * out the contents of the field before uploading the message to the
  8635. * host. Thus, any host-target communication supported by this field
  8636. * is limited to using values that are never used by the debug
  8637. * information stored by certain targets in the reserved_1 field.
  8638. * In particular, the targets in question don't use the value 0x3
  8639. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8640. * so this previously-unused value within these bits is available to
  8641. * use as the host / target PKT_CAPTURE_MODE flag.
  8642. */
  8643. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8644. /* if pkt_capture_mode == 0x3, host should
  8645. * send rx frames to monitor mode interface
  8646. */
  8647. msdu_cnt: 16;
  8648. };
  8649. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8650. {
  8651. A_UINT32 dma_addr;
  8652. A_UINT32
  8653. length: 16,
  8654. fw_desc: 8,
  8655. msdu_info:8;
  8656. };
  8657. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8658. {
  8659. A_UINT32 dma_addr_lo;
  8660. A_UINT32 dma_addr_hi;
  8661. A_UINT32
  8662. length: 16,
  8663. fw_desc: 8,
  8664. msdu_info:8;
  8665. };
  8666. #if HTT_PADDR64
  8667. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8668. #else
  8669. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8670. #endif
  8671. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8672. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8673. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8674. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8675. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8676. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8677. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8678. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8679. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8680. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8681. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8682. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8683. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8684. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8685. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8686. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8687. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8688. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8689. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8690. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8691. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8692. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8693. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8694. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8695. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8696. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8697. /* for systems using 64-bit format for bus addresses */
  8698. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8699. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8700. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8701. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8702. /* for systems using 32-bit format for bus addresses */
  8703. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8704. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8705. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8706. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8707. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8708. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8709. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8710. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8711. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8712. do { \
  8713. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8714. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8715. } while (0)
  8716. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8717. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8718. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8719. do { \
  8720. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8721. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8722. } while (0)
  8723. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8724. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8725. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8726. do { \
  8727. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8728. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8729. } while (0)
  8730. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8731. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8732. /*
  8733. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8734. * deliver the rx frames to the monitor mode interface.
  8735. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8736. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8737. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8738. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8739. */
  8740. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8741. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8742. do { \
  8743. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8744. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8745. } while (0)
  8746. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8747. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8748. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8749. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8750. do { \
  8751. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8752. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8753. } while (0)
  8754. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8755. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8756. /* for systems using 64-bit format for bus addresses */
  8757. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8758. do { \
  8759. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8760. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8761. } while (0)
  8762. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8763. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8764. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8765. do { \
  8766. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8767. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8768. } while (0)
  8769. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8770. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8771. /* for systems using 32-bit format for bus addresses */
  8772. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8773. do { \
  8774. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8775. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8776. } while (0)
  8777. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8778. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8779. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8780. do { \
  8781. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8782. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8783. } while (0)
  8784. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8785. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8786. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8787. do { \
  8788. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8789. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8790. } while (0)
  8791. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8792. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8793. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8794. do { \
  8795. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8796. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8797. } while (0)
  8798. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8799. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8800. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8801. do { \
  8802. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8803. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8804. } while (0)
  8805. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8806. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8807. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8808. do { \
  8809. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8810. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8811. } while (0)
  8812. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8813. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8814. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8815. do { \
  8816. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8817. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8818. } while (0)
  8819. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8820. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8821. /* definitions used within target -> host rx indication message */
  8822. PREPACK struct htt_rx_ind_hdr_prefix_t
  8823. {
  8824. A_UINT32 /* word 0 */
  8825. msg_type: 8,
  8826. ext_tid: 5,
  8827. release_valid: 1,
  8828. flush_valid: 1,
  8829. reserved0: 1,
  8830. peer_id: 16;
  8831. A_UINT32 /* word 1 */
  8832. flush_start_seq_num: 6,
  8833. flush_end_seq_num: 6,
  8834. release_start_seq_num: 6,
  8835. release_end_seq_num: 6,
  8836. num_mpdu_ranges: 8;
  8837. } POSTPACK;
  8838. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8839. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8840. #define HTT_TGT_RSSI_INVALID 0x80
  8841. PREPACK struct htt_rx_ppdu_desc_t
  8842. {
  8843. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8844. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8845. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8846. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8847. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8848. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8849. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8850. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8851. A_UINT32 /* word 0 */
  8852. rssi_cmb: 8,
  8853. timestamp_submicrosec: 8,
  8854. phy_err_code: 8,
  8855. phy_err: 1,
  8856. legacy_rate: 4,
  8857. legacy_rate_sel: 1,
  8858. end_valid: 1,
  8859. start_valid: 1;
  8860. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8861. union {
  8862. A_UINT32 /* word 1 */
  8863. rssi0_pri20: 8,
  8864. rssi0_ext20: 8,
  8865. rssi0_ext40: 8,
  8866. rssi0_ext80: 8;
  8867. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8868. } u0;
  8869. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8870. union {
  8871. A_UINT32 /* word 2 */
  8872. rssi1_pri20: 8,
  8873. rssi1_ext20: 8,
  8874. rssi1_ext40: 8,
  8875. rssi1_ext80: 8;
  8876. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8877. } u1;
  8878. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8879. union {
  8880. A_UINT32 /* word 3 */
  8881. rssi2_pri20: 8,
  8882. rssi2_ext20: 8,
  8883. rssi2_ext40: 8,
  8884. rssi2_ext80: 8;
  8885. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8886. } u2;
  8887. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8888. union {
  8889. A_UINT32 /* word 4 */
  8890. rssi3_pri20: 8,
  8891. rssi3_ext20: 8,
  8892. rssi3_ext40: 8,
  8893. rssi3_ext80: 8;
  8894. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8895. } u3;
  8896. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8897. A_UINT32 tsf32; /* word 5 */
  8898. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8899. A_UINT32 timestamp_microsec; /* word 6 */
  8900. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8901. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8902. A_UINT32 /* word 7 */
  8903. vht_sig_a1: 24,
  8904. preamble_type: 8;
  8905. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8906. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8907. A_UINT32 /* word 8 */
  8908. vht_sig_a2: 24,
  8909. /* sa_ant_matrix
  8910. * For cases where a single rx chain has options to be connected to
  8911. * different rx antennas, show which rx antennas were in use during
  8912. * receipt of a given PPDU.
  8913. * This sa_ant_matrix provides a bitmask of the antennas used while
  8914. * receiving this frame.
  8915. */
  8916. sa_ant_matrix: 8;
  8917. } POSTPACK;
  8918. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8919. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8920. PREPACK struct htt_rx_ind_hdr_suffix_t
  8921. {
  8922. A_UINT32 /* word 0 */
  8923. fw_rx_desc_bytes: 16,
  8924. reserved0: 16;
  8925. } POSTPACK;
  8926. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8927. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8928. PREPACK struct htt_rx_ind_hdr_t
  8929. {
  8930. struct htt_rx_ind_hdr_prefix_t prefix;
  8931. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8932. struct htt_rx_ind_hdr_suffix_t suffix;
  8933. } POSTPACK;
  8934. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8935. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8936. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8937. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8938. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8939. /*
  8940. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8941. * the offset into the HTT rx indication message at which the
  8942. * FW rx PPDU descriptor resides
  8943. */
  8944. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8945. /*
  8946. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8947. * the offset into the HTT rx indication message at which the
  8948. * header suffix (FW rx MSDU byte count) resides
  8949. */
  8950. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8951. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8952. /*
  8953. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8954. * the offset into the HTT rx indication message at which the per-MSDU
  8955. * information starts
  8956. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8957. * per-MSDU information portion of the message. The per-MSDU info itself
  8958. * starts at byte 12.
  8959. */
  8960. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8961. /**
  8962. * @brief target -> host rx indication message definition
  8963. *
  8964. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8965. *
  8966. * @details
  8967. * The following field definitions describe the format of the rx indication
  8968. * message sent from the target to the host.
  8969. * The message consists of three major sections:
  8970. * 1. a fixed-length header
  8971. * 2. a variable-length list of firmware rx MSDU descriptors
  8972. * 3. one or more 4-octet MPDU range information elements
  8973. * The fixed length header itself has two sub-sections
  8974. * 1. the message meta-information, including identification of the
  8975. * sender and type of the received data, and a 4-octet flush/release IE
  8976. * 2. the firmware rx PPDU descriptor
  8977. *
  8978. * The format of the message is depicted below.
  8979. * in this depiction, the following abbreviations are used for information
  8980. * elements within the message:
  8981. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8982. * elements associated with the PPDU start are valid.
  8983. * Specifically, the following fields are valid only if SV is set:
  8984. * RSSI (all variants), L, legacy rate, preamble type, service,
  8985. * VHT-SIG-A
  8986. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8987. * elements associated with the PPDU end are valid.
  8988. * Specifically, the following fields are valid only if EV is set:
  8989. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8990. * - L - Legacy rate selector - if legacy rates are used, this flag
  8991. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8992. * (L == 0) PHY.
  8993. * - P - PHY error flag - boolean indication of whether the rx frame had
  8994. * a PHY error
  8995. *
  8996. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8997. * |----------------+-------------------+---------------------+---------------|
  8998. * | peer ID | |RV|FV| ext TID | msg type |
  8999. * |--------------------------------------------------------------------------|
  9000. * | num | release | release | flush | flush |
  9001. * | MPDU | end | start | end | start |
  9002. * | ranges | seq num | seq num | seq num | seq num |
  9003. * |==========================================================================|
  9004. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9005. * |V|V| | rate | | | timestamp | RSSI |
  9006. * |--------------------------------------------------------------------------|
  9007. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9008. * |--------------------------------------------------------------------------|
  9009. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9010. * |--------------------------------------------------------------------------|
  9011. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9012. * |--------------------------------------------------------------------------|
  9013. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9014. * |--------------------------------------------------------------------------|
  9015. * | TSF LSBs |
  9016. * |--------------------------------------------------------------------------|
  9017. * | microsec timestamp |
  9018. * |--------------------------------------------------------------------------|
  9019. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9020. * |--------------------------------------------------------------------------|
  9021. * | service | HT-SIG / VHT-SIG-A2 |
  9022. * |==========================================================================|
  9023. * | reserved | FW rx desc bytes |
  9024. * |--------------------------------------------------------------------------|
  9025. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9026. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9027. * |--------------------------------------------------------------------------|
  9028. * : : :
  9029. * |--------------------------------------------------------------------------|
  9030. * | alignment | MSDU Rx |
  9031. * | padding | desc Bn |
  9032. * |--------------------------------------------------------------------------|
  9033. * | reserved | MPDU range status | MPDU count |
  9034. * |--------------------------------------------------------------------------|
  9035. * : reserved : MPDU range status : MPDU count :
  9036. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9037. *
  9038. * Header fields:
  9039. * - MSG_TYPE
  9040. * Bits 7:0
  9041. * Purpose: identifies this as an rx indication message
  9042. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9043. * - EXT_TID
  9044. * Bits 12:8
  9045. * Purpose: identify the traffic ID of the rx data, including
  9046. * special "extended" TID values for multicast, broadcast, and
  9047. * non-QoS data frames
  9048. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9049. * - FLUSH_VALID (FV)
  9050. * Bit 13
  9051. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9052. * is valid
  9053. * Value:
  9054. * 1 -> flush IE is valid and needs to be processed
  9055. * 0 -> flush IE is not valid and should be ignored
  9056. * - REL_VALID (RV)
  9057. * Bit 13
  9058. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9059. * is valid
  9060. * Value:
  9061. * 1 -> release IE is valid and needs to be processed
  9062. * 0 -> release IE is not valid and should be ignored
  9063. * - PEER_ID
  9064. * Bits 31:16
  9065. * Purpose: Identify, by ID, which peer sent the rx data
  9066. * Value: ID of the peer who sent the rx data
  9067. * - FLUSH_SEQ_NUM_START
  9068. * Bits 5:0
  9069. * Purpose: Indicate the start of a series of MPDUs to flush
  9070. * Not all MPDUs within this series are necessarily valid - the host
  9071. * must check each sequence number within this range to see if the
  9072. * corresponding MPDU is actually present.
  9073. * This field is only valid if the FV bit is set.
  9074. * Value:
  9075. * The sequence number for the first MPDUs to check to flush.
  9076. * The sequence number is masked by 0x3f.
  9077. * - FLUSH_SEQ_NUM_END
  9078. * Bits 11:6
  9079. * Purpose: Indicate the end of a series of MPDUs to flush
  9080. * Value:
  9081. * The sequence number one larger than the sequence number of the
  9082. * last MPDU to check to flush.
  9083. * The sequence number is masked by 0x3f.
  9084. * Not all MPDUs within this series are necessarily valid - the host
  9085. * must check each sequence number within this range to see if the
  9086. * corresponding MPDU is actually present.
  9087. * This field is only valid if the FV bit is set.
  9088. * - REL_SEQ_NUM_START
  9089. * Bits 17:12
  9090. * Purpose: Indicate the start of a series of MPDUs to release.
  9091. * All MPDUs within this series are present and valid - the host
  9092. * need not check each sequence number within this range to see if
  9093. * the corresponding MPDU is actually present.
  9094. * This field is only valid if the RV bit is set.
  9095. * Value:
  9096. * The sequence number for the first MPDUs to check to release.
  9097. * The sequence number is masked by 0x3f.
  9098. * - REL_SEQ_NUM_END
  9099. * Bits 23:18
  9100. * Purpose: Indicate the end of a series of MPDUs to release.
  9101. * Value:
  9102. * The sequence number one larger than the sequence number of the
  9103. * last MPDU to check to release.
  9104. * The sequence number is masked by 0x3f.
  9105. * All MPDUs within this series are present and valid - the host
  9106. * need not check each sequence number within this range to see if
  9107. * the corresponding MPDU is actually present.
  9108. * This field is only valid if the RV bit is set.
  9109. * - NUM_MPDU_RANGES
  9110. * Bits 31:24
  9111. * Purpose: Indicate how many ranges of MPDUs are present.
  9112. * Each MPDU range consists of a series of contiguous MPDUs within the
  9113. * rx frame sequence which all have the same MPDU status.
  9114. * Value: 1-63 (typically a small number, like 1-3)
  9115. *
  9116. * Rx PPDU descriptor fields:
  9117. * - RSSI_CMB
  9118. * Bits 7:0
  9119. * Purpose: Combined RSSI from all active rx chains, across the active
  9120. * bandwidth.
  9121. * Value: RSSI dB units w.r.t. noise floor
  9122. * - TIMESTAMP_SUBMICROSEC
  9123. * Bits 15:8
  9124. * Purpose: high-resolution timestamp
  9125. * Value:
  9126. * Sub-microsecond time of PPDU reception.
  9127. * This timestamp ranges from [0,MAC clock MHz).
  9128. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9129. * to form a high-resolution, large range rx timestamp.
  9130. * - PHY_ERR_CODE
  9131. * Bits 23:16
  9132. * Purpose:
  9133. * If the rx frame processing resulted in a PHY error, indicate what
  9134. * type of rx PHY error occurred.
  9135. * Value:
  9136. * This field is valid if the "P" (PHY_ERR) flag is set.
  9137. * TBD: document/specify the values for this field
  9138. * - PHY_ERR
  9139. * Bit 24
  9140. * Purpose: indicate whether the rx PPDU had a PHY error
  9141. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9142. * - LEGACY_RATE
  9143. * Bits 28:25
  9144. * Purpose:
  9145. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9146. * specify which rate was used.
  9147. * Value:
  9148. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9149. * flag.
  9150. * If LEGACY_RATE_SEL is 0:
  9151. * 0x8: OFDM 48 Mbps
  9152. * 0x9: OFDM 24 Mbps
  9153. * 0xA: OFDM 12 Mbps
  9154. * 0xB: OFDM 6 Mbps
  9155. * 0xC: OFDM 54 Mbps
  9156. * 0xD: OFDM 36 Mbps
  9157. * 0xE: OFDM 18 Mbps
  9158. * 0xF: OFDM 9 Mbps
  9159. * If LEGACY_RATE_SEL is 1:
  9160. * 0x8: CCK 11 Mbps long preamble
  9161. * 0x9: CCK 5.5 Mbps long preamble
  9162. * 0xA: CCK 2 Mbps long preamble
  9163. * 0xB: CCK 1 Mbps long preamble
  9164. * 0xC: CCK 11 Mbps short preamble
  9165. * 0xD: CCK 5.5 Mbps short preamble
  9166. * 0xE: CCK 2 Mbps short preamble
  9167. * - LEGACY_RATE_SEL
  9168. * Bit 29
  9169. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9170. * Value:
  9171. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9172. * used a legacy rate.
  9173. * 0 -> OFDM, 1 -> CCK
  9174. * - END_VALID
  9175. * Bit 30
  9176. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9177. * the start of the PPDU are valid. Specifically, the following
  9178. * fields are only valid if END_VALID is set:
  9179. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9180. * TIMESTAMP_SUBMICROSEC
  9181. * Value:
  9182. * 0 -> rx PPDU desc end fields are not valid
  9183. * 1 -> rx PPDU desc end fields are valid
  9184. * - START_VALID
  9185. * Bit 31
  9186. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9187. * the end of the PPDU are valid. Specifically, the following
  9188. * fields are only valid if START_VALID is set:
  9189. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9190. * VHT-SIG-A
  9191. * Value:
  9192. * 0 -> rx PPDU desc start fields are not valid
  9193. * 1 -> rx PPDU desc start fields are valid
  9194. * - RSSI0_PRI20
  9195. * Bits 7:0
  9196. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9197. * Value: RSSI dB units w.r.t. noise floor
  9198. *
  9199. * - RSSI0_EXT20
  9200. * Bits 7:0
  9201. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9202. * (if the rx bandwidth was >= 40 MHz)
  9203. * Value: RSSI dB units w.r.t. noise floor
  9204. * - RSSI0_EXT40
  9205. * Bits 7:0
  9206. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9207. * (if the rx bandwidth was >= 80 MHz)
  9208. * Value: RSSI dB units w.r.t. noise floor
  9209. * - RSSI0_EXT80
  9210. * Bits 7:0
  9211. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9212. * (if the rx bandwidth was >= 160 MHz)
  9213. * Value: RSSI dB units w.r.t. noise floor
  9214. *
  9215. * - RSSI1_PRI20
  9216. * Bits 7:0
  9217. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9218. * Value: RSSI dB units w.r.t. noise floor
  9219. * - RSSI1_EXT20
  9220. * Bits 7:0
  9221. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9222. * (if the rx bandwidth was >= 40 MHz)
  9223. * Value: RSSI dB units w.r.t. noise floor
  9224. * - RSSI1_EXT40
  9225. * Bits 7:0
  9226. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9227. * (if the rx bandwidth was >= 80 MHz)
  9228. * Value: RSSI dB units w.r.t. noise floor
  9229. * - RSSI1_EXT80
  9230. * Bits 7:0
  9231. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9232. * (if the rx bandwidth was >= 160 MHz)
  9233. * Value: RSSI dB units w.r.t. noise floor
  9234. *
  9235. * - RSSI2_PRI20
  9236. * Bits 7:0
  9237. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9238. * Value: RSSI dB units w.r.t. noise floor
  9239. * - RSSI2_EXT20
  9240. * Bits 7:0
  9241. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9242. * (if the rx bandwidth was >= 40 MHz)
  9243. * Value: RSSI dB units w.r.t. noise floor
  9244. * - RSSI2_EXT40
  9245. * Bits 7:0
  9246. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9247. * (if the rx bandwidth was >= 80 MHz)
  9248. * Value: RSSI dB units w.r.t. noise floor
  9249. * - RSSI2_EXT80
  9250. * Bits 7:0
  9251. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9252. * (if the rx bandwidth was >= 160 MHz)
  9253. * Value: RSSI dB units w.r.t. noise floor
  9254. *
  9255. * - RSSI3_PRI20
  9256. * Bits 7:0
  9257. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9258. * Value: RSSI dB units w.r.t. noise floor
  9259. * - RSSI3_EXT20
  9260. * Bits 7:0
  9261. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9262. * (if the rx bandwidth was >= 40 MHz)
  9263. * Value: RSSI dB units w.r.t. noise floor
  9264. * - RSSI3_EXT40
  9265. * Bits 7:0
  9266. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9267. * (if the rx bandwidth was >= 80 MHz)
  9268. * Value: RSSI dB units w.r.t. noise floor
  9269. * - RSSI3_EXT80
  9270. * Bits 7:0
  9271. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9272. * (if the rx bandwidth was >= 160 MHz)
  9273. * Value: RSSI dB units w.r.t. noise floor
  9274. *
  9275. * - TSF32
  9276. * Bits 31:0
  9277. * Purpose: specify the time the rx PPDU was received, in TSF units
  9278. * Value: 32 LSBs of the TSF
  9279. * - TIMESTAMP_MICROSEC
  9280. * Bits 31:0
  9281. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9282. * Value: PPDU rx time, in microseconds
  9283. * - VHT_SIG_A1
  9284. * Bits 23:0
  9285. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9286. * from the rx PPDU
  9287. * Value:
  9288. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9289. * VHT-SIG-A1 data.
  9290. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9291. * first 24 bits of the HT-SIG data.
  9292. * Otherwise, this field is invalid.
  9293. * Refer to the the 802.11 protocol for the definition of the
  9294. * HT-SIG and VHT-SIG-A1 fields
  9295. * - VHT_SIG_A2
  9296. * Bits 23:0
  9297. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9298. * from the rx PPDU
  9299. * Value:
  9300. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9301. * VHT-SIG-A2 data.
  9302. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9303. * last 24 bits of the HT-SIG data.
  9304. * Otherwise, this field is invalid.
  9305. * Refer to the the 802.11 protocol for the definition of the
  9306. * HT-SIG and VHT-SIG-A2 fields
  9307. * - PREAMBLE_TYPE
  9308. * Bits 31:24
  9309. * Purpose: indicate the PHY format of the received burst
  9310. * Value:
  9311. * 0x4: Legacy (OFDM/CCK)
  9312. * 0x8: HT
  9313. * 0x9: HT with TxBF
  9314. * 0xC: VHT
  9315. * 0xD: VHT with TxBF
  9316. * - SERVICE
  9317. * Bits 31:24
  9318. * Purpose: TBD
  9319. * Value: TBD
  9320. *
  9321. * Rx MSDU descriptor fields:
  9322. * - FW_RX_DESC_BYTES
  9323. * Bits 15:0
  9324. * Purpose: Indicate how many bytes in the Rx indication are used for
  9325. * FW Rx descriptors
  9326. *
  9327. * Payload fields:
  9328. * - MPDU_COUNT
  9329. * Bits 7:0
  9330. * Purpose: Indicate how many sequential MPDUs share the same status.
  9331. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9332. * - MPDU_STATUS
  9333. * Bits 15:8
  9334. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9335. * received successfully.
  9336. * Value:
  9337. * 0x1: success
  9338. * 0x2: FCS error
  9339. * 0x3: duplicate error
  9340. * 0x4: replay error
  9341. * 0x5: invalid peer
  9342. */
  9343. /* header fields */
  9344. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9345. #define HTT_RX_IND_EXT_TID_S 8
  9346. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9347. #define HTT_RX_IND_FLUSH_VALID_S 13
  9348. #define HTT_RX_IND_REL_VALID_M 0x4000
  9349. #define HTT_RX_IND_REL_VALID_S 14
  9350. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9351. #define HTT_RX_IND_PEER_ID_S 16
  9352. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9353. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9354. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9355. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9356. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9357. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9358. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9359. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9360. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9361. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9362. /* rx PPDU descriptor fields */
  9363. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9364. #define HTT_RX_IND_RSSI_CMB_S 0
  9365. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9366. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9367. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9368. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9369. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9370. #define HTT_RX_IND_PHY_ERR_S 24
  9371. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9372. #define HTT_RX_IND_LEGACY_RATE_S 25
  9373. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9374. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9375. #define HTT_RX_IND_END_VALID_M 0x40000000
  9376. #define HTT_RX_IND_END_VALID_S 30
  9377. #define HTT_RX_IND_START_VALID_M 0x80000000
  9378. #define HTT_RX_IND_START_VALID_S 31
  9379. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9380. #define HTT_RX_IND_RSSI_PRI20_S 0
  9381. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9382. #define HTT_RX_IND_RSSI_EXT20_S 8
  9383. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9384. #define HTT_RX_IND_RSSI_EXT40_S 16
  9385. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9386. #define HTT_RX_IND_RSSI_EXT80_S 24
  9387. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9388. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9389. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9390. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9391. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9392. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9393. #define HTT_RX_IND_SERVICE_M 0xff000000
  9394. #define HTT_RX_IND_SERVICE_S 24
  9395. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9396. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9397. /* rx MSDU descriptor fields */
  9398. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9399. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9400. /* payload fields */
  9401. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9402. #define HTT_RX_IND_MPDU_COUNT_S 0
  9403. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9404. #define HTT_RX_IND_MPDU_STATUS_S 8
  9405. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9406. do { \
  9407. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9408. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9409. } while (0)
  9410. #define HTT_RX_IND_EXT_TID_GET(word) \
  9411. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9412. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9413. do { \
  9414. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9415. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9416. } while (0)
  9417. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9418. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9419. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9420. do { \
  9421. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9422. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9423. } while (0)
  9424. #define HTT_RX_IND_REL_VALID_GET(word) \
  9425. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9426. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9427. do { \
  9428. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9429. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9430. } while (0)
  9431. #define HTT_RX_IND_PEER_ID_GET(word) \
  9432. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9433. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9434. do { \
  9435. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9436. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9437. } while (0)
  9438. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9439. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9440. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9441. do { \
  9442. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9443. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9444. } while (0)
  9445. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9446. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9447. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9448. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9449. do { \
  9450. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9451. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9452. } while (0)
  9453. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9454. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9455. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9456. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9457. do { \
  9458. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9459. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9460. } while (0)
  9461. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9462. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9463. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9464. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9465. do { \
  9466. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9467. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9468. } while (0)
  9469. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9470. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9471. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9472. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9473. do { \
  9474. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9475. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9476. } while (0)
  9477. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9478. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9479. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9480. /* FW rx PPDU descriptor fields */
  9481. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9482. do { \
  9483. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9484. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9485. } while (0)
  9486. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9487. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9488. HTT_RX_IND_RSSI_CMB_S)
  9489. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9490. do { \
  9491. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9492. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9493. } while (0)
  9494. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9495. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9496. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9497. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9498. do { \
  9499. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9500. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9501. } while (0)
  9502. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9503. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9504. HTT_RX_IND_PHY_ERR_CODE_S)
  9505. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9506. do { \
  9507. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9508. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9509. } while (0)
  9510. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9511. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9512. HTT_RX_IND_PHY_ERR_S)
  9513. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9514. do { \
  9515. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9516. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9517. } while (0)
  9518. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9519. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9520. HTT_RX_IND_LEGACY_RATE_S)
  9521. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9522. do { \
  9523. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9524. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9525. } while (0)
  9526. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9527. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9528. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9529. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9530. do { \
  9531. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9532. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9533. } while (0)
  9534. #define HTT_RX_IND_END_VALID_GET(word) \
  9535. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9536. HTT_RX_IND_END_VALID_S)
  9537. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9538. do { \
  9539. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9540. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9541. } while (0)
  9542. #define HTT_RX_IND_START_VALID_GET(word) \
  9543. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9544. HTT_RX_IND_START_VALID_S)
  9545. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9546. do { \
  9547. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9548. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9549. } while (0)
  9550. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9551. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9552. HTT_RX_IND_RSSI_PRI20_S)
  9553. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9554. do { \
  9555. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9556. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9557. } while (0)
  9558. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9559. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9560. HTT_RX_IND_RSSI_EXT20_S)
  9561. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9562. do { \
  9563. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9564. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9565. } while (0)
  9566. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9567. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9568. HTT_RX_IND_RSSI_EXT40_S)
  9569. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9570. do { \
  9571. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9572. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9573. } while (0)
  9574. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9575. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9576. HTT_RX_IND_RSSI_EXT80_S)
  9577. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9578. do { \
  9579. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9580. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9581. } while (0)
  9582. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9583. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9584. HTT_RX_IND_VHT_SIG_A1_S)
  9585. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9586. do { \
  9587. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9588. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9589. } while (0)
  9590. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9591. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9592. HTT_RX_IND_VHT_SIG_A2_S)
  9593. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9594. do { \
  9595. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9596. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9597. } while (0)
  9598. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9599. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9600. HTT_RX_IND_PREAMBLE_TYPE_S)
  9601. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9602. do { \
  9603. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9604. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9605. } while (0)
  9606. #define HTT_RX_IND_SERVICE_GET(word) \
  9607. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9608. HTT_RX_IND_SERVICE_S)
  9609. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9610. do { \
  9611. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9612. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9613. } while (0)
  9614. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9615. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9616. HTT_RX_IND_SA_ANT_MATRIX_S)
  9617. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9618. do { \
  9619. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9620. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9621. } while (0)
  9622. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9623. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9624. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9625. do { \
  9626. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9627. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9628. } while (0)
  9629. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9630. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9631. #define HTT_RX_IND_HL_BYTES \
  9632. (HTT_RX_IND_HDR_BYTES + \
  9633. 4 /* single FW rx MSDU descriptor */ + \
  9634. 4 /* single MPDU range information element */)
  9635. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9636. /* Could we use one macro entry? */
  9637. #define HTT_WORD_SET(word, field, value) \
  9638. do { \
  9639. HTT_CHECK_SET_VAL(field, value); \
  9640. (word) |= ((value) << field ## _S); \
  9641. } while (0)
  9642. #define HTT_WORD_GET(word, field) \
  9643. (((word) & field ## _M) >> field ## _S)
  9644. PREPACK struct hl_htt_rx_ind_base {
  9645. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9646. } POSTPACK;
  9647. /*
  9648. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9649. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9650. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9651. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9652. * htt_rx_ind_hl_rx_desc_t.
  9653. */
  9654. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9655. struct htt_rx_ind_hl_rx_desc_t {
  9656. A_UINT8 ver;
  9657. A_UINT8 len;
  9658. struct {
  9659. A_UINT8
  9660. first_msdu: 1,
  9661. last_msdu: 1,
  9662. c3_failed: 1,
  9663. c4_failed: 1,
  9664. ipv6: 1,
  9665. tcp: 1,
  9666. udp: 1,
  9667. reserved: 1;
  9668. } flags;
  9669. /* NOTE: no reserved space - don't append any new fields here */
  9670. };
  9671. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9672. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9673. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9674. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9675. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9676. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9677. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9678. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9679. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9680. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9681. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9682. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9683. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9684. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9685. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9686. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9687. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9688. /* This structure is used in HL, the basic descriptor information
  9689. * used by host. the structure is translated by FW from HW desc
  9690. * or generated by FW. But in HL monitor mode, the host would use
  9691. * the same structure with LL.
  9692. */
  9693. PREPACK struct hl_htt_rx_desc_base {
  9694. A_UINT32
  9695. seq_num:12,
  9696. encrypted:1,
  9697. chan_info_present:1,
  9698. resv0:2,
  9699. mcast_bcast:1,
  9700. fragment:1,
  9701. key_id_oct:8,
  9702. resv1:6;
  9703. A_UINT32
  9704. pn_31_0;
  9705. union {
  9706. struct {
  9707. A_UINT16 pn_47_32;
  9708. A_UINT16 pn_63_48;
  9709. } pn16;
  9710. A_UINT32 pn_63_32;
  9711. } u0;
  9712. A_UINT32
  9713. pn_95_64;
  9714. A_UINT32
  9715. pn_127_96;
  9716. } POSTPACK;
  9717. /*
  9718. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9719. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9720. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9721. * Please see htt_chan_change_t for description of the fields.
  9722. */
  9723. PREPACK struct htt_chan_info_t
  9724. {
  9725. A_UINT32 primary_chan_center_freq_mhz: 16,
  9726. contig_chan1_center_freq_mhz: 16;
  9727. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9728. phy_mode: 8,
  9729. reserved: 8;
  9730. } POSTPACK;
  9731. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9732. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9733. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9734. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9735. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9736. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9737. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9738. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9739. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9740. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9741. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9742. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9743. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9744. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9745. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9746. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9747. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9748. /* Channel information */
  9749. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9750. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9751. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9752. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9753. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9754. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9755. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9756. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9757. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9758. do { \
  9759. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9760. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9761. } while (0)
  9762. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9763. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9764. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9765. do { \
  9766. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9767. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9768. } while (0)
  9769. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9770. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9771. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9772. do { \
  9773. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9774. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9775. } while (0)
  9776. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9777. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9778. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9779. do { \
  9780. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9781. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9782. } while (0)
  9783. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9784. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9785. /*
  9786. * @brief target -> host message definition for FW offloaded pkts
  9787. *
  9788. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9789. *
  9790. * @details
  9791. * The following field definitions describe the format of the firmware
  9792. * offload deliver message sent from the target to the host.
  9793. *
  9794. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9795. *
  9796. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9797. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9798. * | reserved_1 | msg type |
  9799. * |--------------------------------------------------------------------------|
  9800. * | phy_timestamp_l32 |
  9801. * |--------------------------------------------------------------------------|
  9802. * | WORD2 (see below) |
  9803. * |--------------------------------------------------------------------------|
  9804. * | seqno | framectrl |
  9805. * |--------------------------------------------------------------------------|
  9806. * | reserved_3 | vdev_id | tid_num|
  9807. * |--------------------------------------------------------------------------|
  9808. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9809. * |--------------------------------------------------------------------------|
  9810. *
  9811. * where:
  9812. * STAT = status
  9813. * F = format (802.3 vs. 802.11)
  9814. *
  9815. * definition for word 2
  9816. *
  9817. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9818. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9819. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9820. * |--------------------------------------------------------------------------|
  9821. *
  9822. * where:
  9823. * PR = preamble
  9824. * BF = beamformed
  9825. */
  9826. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9827. {
  9828. A_UINT32 /* word 0 */
  9829. msg_type:8, /* [ 7: 0] */
  9830. reserved_1:24; /* [31: 8] */
  9831. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9832. A_UINT32 /* word 2 */
  9833. /* preamble:
  9834. * 0-OFDM,
  9835. * 1-CCk,
  9836. * 2-HT,
  9837. * 3-VHT
  9838. */
  9839. preamble: 2, /* [1:0] */
  9840. /* mcs:
  9841. * In case of HT preamble interpret
  9842. * MCS along with NSS.
  9843. * Valid values for HT are 0 to 7.
  9844. * HT mcs 0 with NSS 2 is mcs 8.
  9845. * Valid values for VHT are 0 to 9.
  9846. */
  9847. mcs: 4, /* [5:2] */
  9848. /* rate:
  9849. * This is applicable only for
  9850. * CCK and OFDM preamble type
  9851. * rate 0: OFDM 48 Mbps,
  9852. * 1: OFDM 24 Mbps,
  9853. * 2: OFDM 12 Mbps
  9854. * 3: OFDM 6 Mbps
  9855. * 4: OFDM 54 Mbps
  9856. * 5: OFDM 36 Mbps
  9857. * 6: OFDM 18 Mbps
  9858. * 7: OFDM 9 Mbps
  9859. * rate 0: CCK 11 Mbps Long
  9860. * 1: CCK 5.5 Mbps Long
  9861. * 2: CCK 2 Mbps Long
  9862. * 3: CCK 1 Mbps Long
  9863. * 4: CCK 11 Mbps Short
  9864. * 5: CCK 5.5 Mbps Short
  9865. * 6: CCK 2 Mbps Short
  9866. */
  9867. rate : 3, /* [ 8: 6] */
  9868. rssi : 8, /* [16: 9] units=dBm */
  9869. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9870. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9871. stbc : 1, /* [22] */
  9872. sgi : 1, /* [23] */
  9873. ldpc : 1, /* [24] */
  9874. beamformed: 1, /* [25] */
  9875. reserved_2: 6; /* [31:26] */
  9876. A_UINT32 /* word 3 */
  9877. framectrl:16, /* [15: 0] */
  9878. seqno:16; /* [31:16] */
  9879. A_UINT32 /* word 4 */
  9880. tid_num:5, /* [ 4: 0] actual TID number */
  9881. vdev_id:8, /* [12: 5] */
  9882. reserved_3:19; /* [31:13] */
  9883. A_UINT32 /* word 5 */
  9884. /* status:
  9885. * 0: tx_ok
  9886. * 1: retry
  9887. * 2: drop
  9888. * 3: filtered
  9889. * 4: abort
  9890. * 5: tid delete
  9891. * 6: sw abort
  9892. * 7: dropped by peer migration
  9893. */
  9894. status:3, /* [2:0] */
  9895. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9896. tx_mpdu_bytes:16, /* [19:4] */
  9897. /* Indicates retry count of offloaded/local generated Data tx frames */
  9898. tx_retry_cnt:6, /* [25:20] */
  9899. reserved_4:6; /* [31:26] */
  9900. } POSTPACK;
  9901. /* FW offload deliver ind message header fields */
  9902. /* DWORD one */
  9903. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9904. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9905. /* DWORD two */
  9906. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9907. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9908. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9909. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9910. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9911. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9912. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9913. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9914. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9915. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9916. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9917. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9918. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9919. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9920. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9921. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9922. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9923. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9924. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9925. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9926. /* DWORD three*/
  9927. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9928. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9929. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9930. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9931. /* DWORD four */
  9932. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9933. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9934. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9935. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9936. /* DWORD five */
  9937. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9938. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9939. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9940. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9941. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9942. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9943. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9944. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9945. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9946. do { \
  9947. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9948. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9949. } while (0)
  9950. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9951. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9952. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9953. do { \
  9954. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9955. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9956. } while (0)
  9957. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9958. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9959. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9960. do { \
  9961. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9962. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9963. } while (0)
  9964. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9965. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9966. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9967. do { \
  9968. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9969. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9970. } while (0)
  9971. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9972. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9973. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9974. do { \
  9975. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9976. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9977. } while (0)
  9978. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9979. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9980. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9981. do { \
  9982. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9983. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9984. } while (0)
  9985. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9986. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9987. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9988. do { \
  9989. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9990. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9991. } while (0)
  9992. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9993. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9994. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9995. do { \
  9996. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9997. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9998. } while (0)
  9999. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10000. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10001. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10002. do { \
  10003. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10004. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10005. } while (0)
  10006. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10007. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10008. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10009. do { \
  10010. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10011. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10012. } while (0)
  10013. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10014. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10015. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10016. do { \
  10017. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10018. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10019. } while (0)
  10020. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10021. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10022. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10023. do { \
  10024. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10025. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10026. } while (0)
  10027. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10028. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10029. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10030. do { \
  10031. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10032. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10033. } while (0)
  10034. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10035. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10036. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10037. do { \
  10038. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10039. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10040. } while (0)
  10041. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10042. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10043. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10044. do { \
  10045. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10046. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10047. } while (0)
  10048. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10049. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10050. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10051. do { \
  10052. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10053. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10054. } while (0)
  10055. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10056. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10057. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10058. do { \
  10059. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10060. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10061. } while (0)
  10062. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10063. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10064. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10065. do { \
  10066. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10067. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10068. } while (0)
  10069. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10070. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10071. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10072. do { \
  10073. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10074. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10075. } while (0)
  10076. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10077. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10078. /*
  10079. * @brief target -> host rx reorder flush message definition
  10080. *
  10081. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10082. *
  10083. * @details
  10084. * The following field definitions describe the format of the rx flush
  10085. * message sent from the target to the host.
  10086. * The message consists of a 4-octet header, followed by one or more
  10087. * 4-octet payload information elements.
  10088. *
  10089. * |31 24|23 8|7 0|
  10090. * |--------------------------------------------------------------|
  10091. * | TID | peer ID | msg type |
  10092. * |--------------------------------------------------------------|
  10093. * | seq num end | seq num start | MPDU status | reserved |
  10094. * |--------------------------------------------------------------|
  10095. * First DWORD:
  10096. * - MSG_TYPE
  10097. * Bits 7:0
  10098. * Purpose: identifies this as an rx flush message
  10099. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10100. * - PEER_ID
  10101. * Bits 23:8 (only bits 18:8 actually used)
  10102. * Purpose: identify which peer's rx data is being flushed
  10103. * Value: (rx) peer ID
  10104. * - TID
  10105. * Bits 31:24 (only bits 27:24 actually used)
  10106. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10107. * Value: traffic identifier
  10108. * Second DWORD:
  10109. * - MPDU_STATUS
  10110. * Bits 15:8
  10111. * Purpose:
  10112. * Indicate whether the flushed MPDUs should be discarded or processed.
  10113. * Value:
  10114. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10115. * stages of rx processing
  10116. * other: discard the MPDUs
  10117. * It is anticipated that flush messages will always have
  10118. * MPDU status == 1, but the status flag is included for
  10119. * flexibility.
  10120. * - SEQ_NUM_START
  10121. * Bits 23:16
  10122. * Purpose:
  10123. * Indicate the start of a series of consecutive MPDUs being flushed.
  10124. * Not all MPDUs within this range are necessarily valid - the host
  10125. * must check each sequence number within this range to see if the
  10126. * corresponding MPDU is actually present.
  10127. * Value:
  10128. * The sequence number for the first MPDU in the sequence.
  10129. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10130. * - SEQ_NUM_END
  10131. * Bits 30:24
  10132. * Purpose:
  10133. * Indicate the end of a series of consecutive MPDUs being flushed.
  10134. * Value:
  10135. * The sequence number one larger than the sequence number of the
  10136. * last MPDU being flushed.
  10137. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10138. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10139. * are to be released for further rx processing.
  10140. * Not all MPDUs within this range are necessarily valid - the host
  10141. * must check each sequence number within this range to see if the
  10142. * corresponding MPDU is actually present.
  10143. */
  10144. /* first DWORD */
  10145. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10146. #define HTT_RX_FLUSH_PEER_ID_S 8
  10147. #define HTT_RX_FLUSH_TID_M 0xff000000
  10148. #define HTT_RX_FLUSH_TID_S 24
  10149. /* second DWORD */
  10150. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10151. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10152. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10153. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10154. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10155. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10156. #define HTT_RX_FLUSH_BYTES 8
  10157. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10158. do { \
  10159. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10160. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10161. } while (0)
  10162. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10163. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10164. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10165. do { \
  10166. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10167. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10168. } while (0)
  10169. #define HTT_RX_FLUSH_TID_GET(word) \
  10170. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10171. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10172. do { \
  10173. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10174. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10175. } while (0)
  10176. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10177. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10178. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10179. do { \
  10180. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10181. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10182. } while (0)
  10183. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10184. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10185. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10186. do { \
  10187. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10188. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10189. } while (0)
  10190. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10191. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10192. /*
  10193. * @brief target -> host rx pn check indication message
  10194. *
  10195. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10196. *
  10197. * @details
  10198. * The following field definitions describe the format of the Rx PN check
  10199. * indication message sent from the target to the host.
  10200. * The message consists of a 4-octet header, followed by the start and
  10201. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10202. * IE is one octet containing the sequence number that failed the PN
  10203. * check.
  10204. *
  10205. * |31 24|23 8|7 0|
  10206. * |--------------------------------------------------------------|
  10207. * | TID | peer ID | msg type |
  10208. * |--------------------------------------------------------------|
  10209. * | Reserved | PN IE count | seq num end | seq num start|
  10210. * |--------------------------------------------------------------|
  10211. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10212. * |--------------------------------------------------------------|
  10213. * First DWORD:
  10214. * - MSG_TYPE
  10215. * Bits 7:0
  10216. * Purpose: Identifies this as an rx pn check indication message
  10217. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10218. * - PEER_ID
  10219. * Bits 23:8 (only bits 18:8 actually used)
  10220. * Purpose: identify which peer
  10221. * Value: (rx) peer ID
  10222. * - TID
  10223. * Bits 31:24 (only bits 27:24 actually used)
  10224. * Purpose: identify traffic identifier
  10225. * Value: traffic identifier
  10226. * Second DWORD:
  10227. * - SEQ_NUM_START
  10228. * Bits 7:0
  10229. * Purpose:
  10230. * Indicates the starting sequence number of the MPDU in this
  10231. * series of MPDUs that went though PN check.
  10232. * Value:
  10233. * The sequence number for the first MPDU in the sequence.
  10234. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10235. * - SEQ_NUM_END
  10236. * Bits 15:8
  10237. * Purpose:
  10238. * Indicates the ending sequence number of the MPDU in this
  10239. * series of MPDUs that went though PN check.
  10240. * Value:
  10241. * The sequence number one larger then the sequence number of the last
  10242. * MPDU being flushed.
  10243. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10244. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10245. * for invalid PN numbers and are ready to be released for further processing.
  10246. * Not all MPDUs within this range are necessarily valid - the host
  10247. * must check each sequence number within this range to see if the
  10248. * corresponding MPDU is actually present.
  10249. * - PN_IE_COUNT
  10250. * Bits 23:16
  10251. * Purpose:
  10252. * Used to determine the variable number of PN information elements in this
  10253. * message
  10254. *
  10255. * PN information elements:
  10256. * - PN_IE_x-
  10257. * Purpose:
  10258. * Each PN information element contains the sequence number of the MPDU that
  10259. * has failed the target PN check.
  10260. * Value:
  10261. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10262. * that failed the PN check.
  10263. */
  10264. /* first DWORD */
  10265. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10266. #define HTT_RX_PN_IND_PEER_ID_S 8
  10267. #define HTT_RX_PN_IND_TID_M 0xff000000
  10268. #define HTT_RX_PN_IND_TID_S 24
  10269. /* second DWORD */
  10270. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10271. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10272. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10273. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10274. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10275. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10276. #define HTT_RX_PN_IND_BYTES 8
  10277. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10278. do { \
  10279. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10280. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10281. } while (0)
  10282. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10283. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10284. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10285. do { \
  10286. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10287. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10288. } while (0)
  10289. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10290. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10291. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10292. do { \
  10293. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10294. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10295. } while (0)
  10296. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10297. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10298. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10299. do { \
  10300. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10301. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10302. } while (0)
  10303. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10304. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10305. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10306. do { \
  10307. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10308. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10309. } while (0)
  10310. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10311. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10312. /*
  10313. * @brief target -> host rx offload deliver message for LL system
  10314. *
  10315. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10316. *
  10317. * @details
  10318. * In a low latency system this message is sent whenever the offload
  10319. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10320. * The DMA of the actual packets into host memory is done before sending out
  10321. * this message. This message indicates only how many MSDUs to reap. The
  10322. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10323. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10324. * DMA'd by the MAC directly into host memory these packets do not contain
  10325. * the MAC descriptors in the header portion of the packet. Instead they contain
  10326. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10327. * message, the packets are delivered directly to the NW stack without going
  10328. * through the regular reorder buffering and PN checking path since it has
  10329. * already been done in target.
  10330. *
  10331. * |31 24|23 16|15 8|7 0|
  10332. * |-----------------------------------------------------------------------|
  10333. * | Total MSDU count | reserved | msg type |
  10334. * |-----------------------------------------------------------------------|
  10335. *
  10336. * @brief target -> host rx offload deliver message for HL system
  10337. *
  10338. * @details
  10339. * In a high latency system this message is sent whenever the offload manager
  10340. * flushes out the packets it has coalesced in its coalescing buffer. The
  10341. * actual packets are also carried along with this message. When the host
  10342. * receives this message, it is expected to deliver these packets to the NW
  10343. * stack directly instead of routing them through the reorder buffering and
  10344. * PN checking path since it has already been done in target.
  10345. *
  10346. * |31 24|23 16|15 8|7 0|
  10347. * |-----------------------------------------------------------------------|
  10348. * | Total MSDU count | reserved | msg type |
  10349. * |-----------------------------------------------------------------------|
  10350. * | peer ID | MSDU length |
  10351. * |-----------------------------------------------------------------------|
  10352. * | MSDU payload | FW Desc | tid | vdev ID |
  10353. * |-----------------------------------------------------------------------|
  10354. * | MSDU payload contd. |
  10355. * |-----------------------------------------------------------------------|
  10356. * | peer ID | MSDU length |
  10357. * |-----------------------------------------------------------------------|
  10358. * | MSDU payload | FW Desc | tid | vdev ID |
  10359. * |-----------------------------------------------------------------------|
  10360. * | MSDU payload contd. |
  10361. * |-----------------------------------------------------------------------|
  10362. *
  10363. */
  10364. /* first DWORD */
  10365. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10366. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10367. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10368. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10369. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10370. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10371. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10372. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10373. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10374. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10375. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10376. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10377. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10378. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10379. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10380. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10381. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10382. do { \
  10383. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10384. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10385. } while (0)
  10386. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10387. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10388. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10389. do { \
  10390. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10391. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10392. } while (0)
  10393. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10394. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10395. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10396. do { \
  10397. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10398. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10399. } while (0)
  10400. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10401. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10402. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10403. do { \
  10404. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10405. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10406. } while (0)
  10407. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10408. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10409. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10410. do { \
  10411. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10412. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10413. } while (0)
  10414. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10415. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10416. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10417. do { \
  10418. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10419. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10420. } while (0)
  10421. /**
  10422. * @brief target -> host rx peer map/unmap message definition
  10423. *
  10424. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10425. *
  10426. * @details
  10427. * The following diagram shows the format of the rx peer map message sent
  10428. * from the target to the host. This layout assumes the target operates
  10429. * as little-endian.
  10430. *
  10431. * This message always contains a SW peer ID. The main purpose of the
  10432. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10433. * with, so that the host can use that peer ID to determine which peer
  10434. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10435. * other purposes, such as identifying during tx completions which peer
  10436. * the tx frames in question were transmitted to.
  10437. *
  10438. * In certain generations of chips, the peer map message also contains
  10439. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10440. * to identify which peer the frame needs to be forwarded to (i.e. the
  10441. * peer assocated with the Destination MAC Address within the packet),
  10442. * and particularly which vdev needs to transmit the frame (for cases
  10443. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10444. * meaning as AST_INDEX_0.
  10445. * This DA-based peer ID that is provided for certain rx frames
  10446. * (the rx frames that need to be re-transmitted as tx frames)
  10447. * is the ID that the HW uses for referring to the peer in question,
  10448. * rather than the peer ID that the SW+FW use to refer to the peer.
  10449. *
  10450. *
  10451. * |31 24|23 16|15 8|7 0|
  10452. * |-----------------------------------------------------------------------|
  10453. * | SW peer ID | VDEV ID | msg type |
  10454. * |-----------------------------------------------------------------------|
  10455. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10456. * |-----------------------------------------------------------------------|
  10457. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10458. * |-----------------------------------------------------------------------|
  10459. *
  10460. *
  10461. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10462. *
  10463. * The following diagram shows the format of the rx peer unmap message sent
  10464. * from the target to the host.
  10465. *
  10466. * |31 24|23 16|15 8|7 0|
  10467. * |-----------------------------------------------------------------------|
  10468. * | SW peer ID | VDEV ID | msg type |
  10469. * |-----------------------------------------------------------------------|
  10470. *
  10471. * The following field definitions describe the format of the rx peer map
  10472. * and peer unmap messages sent from the target to the host.
  10473. * - MSG_TYPE
  10474. * Bits 7:0
  10475. * Purpose: identifies this as an rx peer map or peer unmap message
  10476. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10477. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10478. * - VDEV_ID
  10479. * Bits 15:8
  10480. * Purpose: Indicates which virtual device the peer is associated
  10481. * with.
  10482. * Value: vdev ID (used in the host to look up the vdev object)
  10483. * - PEER_ID (a.k.a. SW_PEER_ID)
  10484. * Bits 31:16
  10485. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10486. * freeing (unmap)
  10487. * Value: (rx) peer ID
  10488. * - MAC_ADDR_L32 (peer map only)
  10489. * Bits 31:0
  10490. * Purpose: Identifies which peer node the peer ID is for.
  10491. * Value: lower 4 bytes of peer node's MAC address
  10492. * - MAC_ADDR_U16 (peer map only)
  10493. * Bits 15:0
  10494. * Purpose: Identifies which peer node the peer ID is for.
  10495. * Value: upper 2 bytes of peer node's MAC address
  10496. * - HW_PEER_ID
  10497. * Bits 31:16
  10498. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10499. * address, so for rx frames marked for rx --> tx forwarding, the
  10500. * host can determine from the HW peer ID provided as meta-data with
  10501. * the rx frame which peer the frame is supposed to be forwarded to.
  10502. * Value: ID used by the MAC HW to identify the peer
  10503. */
  10504. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10505. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10506. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10507. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10508. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10509. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10510. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10511. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10512. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10513. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10514. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10515. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10516. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10517. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10518. do { \
  10519. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10520. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10521. } while (0)
  10522. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10523. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10524. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10525. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10526. do { \
  10527. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10528. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10529. } while (0)
  10530. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10531. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10532. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10533. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10534. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10535. do { \
  10536. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10537. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10538. } while (0)
  10539. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10540. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10541. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10542. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10543. #define HTT_RX_PEER_MAP_BYTES 12
  10544. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10545. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10546. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10547. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10548. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10549. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10550. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10551. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10552. #define HTT_RX_PEER_UNMAP_BYTES 4
  10553. /**
  10554. * @brief target -> host rx peer map V2 message definition
  10555. *
  10556. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10557. *
  10558. * @details
  10559. * The following diagram shows the format of the rx peer map v2 message sent
  10560. * from the target to the host. This layout assumes the target operates
  10561. * as little-endian.
  10562. *
  10563. * This message always contains a SW peer ID. The main purpose of the
  10564. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10565. * with, so that the host can use that peer ID to determine which peer
  10566. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10567. * other purposes, such as identifying during tx completions which peer
  10568. * the tx frames in question were transmitted to.
  10569. *
  10570. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10571. * is used during rx --> tx frame forwarding to identify which peer the
  10572. * frame needs to be forwarded to (i.e. the peer assocated with the
  10573. * Destination MAC Address within the packet), and particularly which vdev
  10574. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10575. * This DA-based peer ID that is provided for certain rx frames
  10576. * (the rx frames that need to be re-transmitted as tx frames)
  10577. * is the ID that the HW uses for referring to the peer in question,
  10578. * rather than the peer ID that the SW+FW use to refer to the peer.
  10579. *
  10580. * The HW peer id here is the same meaning as AST_INDEX_0.
  10581. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10582. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10583. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10584. * AST is valid.
  10585. *
  10586. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10587. * |-------------------------------------------------------------------------|
  10588. * | SW peer ID | VDEV ID | msg type |
  10589. * |-------------------------------------------------------------------------|
  10590. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10591. * |-------------------------------------------------------------------------|
  10592. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10593. * |-------------------------------------------------------------------------|
  10594. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10595. * |-------------------------------------------------------------------------|
  10596. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10597. * |-------------------------------------------------------------------------|
  10598. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10599. * |-------------------------------------------------------------------------|
  10600. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10601. * |-------------------------------------------------------------------------|
  10602. * | Reserved_2 |
  10603. * |-------------------------------------------------------------------------|
  10604. * Where:
  10605. * NH = Next Hop
  10606. * ASTVM = AST valid mask
  10607. * OA = on-chip AST valid bit
  10608. * ASTFM = AST flow mask
  10609. *
  10610. * The following field definitions describe the format of the rx peer map v2
  10611. * messages sent from the target to the host.
  10612. * - MSG_TYPE
  10613. * Bits 7:0
  10614. * Purpose: identifies this as an rx peer map v2 message
  10615. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10616. * - VDEV_ID
  10617. * Bits 15:8
  10618. * Purpose: Indicates which virtual device the peer is associated with.
  10619. * Value: vdev ID (used in the host to look up the vdev object)
  10620. * - SW_PEER_ID
  10621. * Bits 31:16
  10622. * Purpose: The peer ID (index) that WAL is allocating
  10623. * Value: (rx) peer ID
  10624. * - MAC_ADDR_L32
  10625. * Bits 31:0
  10626. * Purpose: Identifies which peer node the peer ID is for.
  10627. * Value: lower 4 bytes of peer node's MAC address
  10628. * - MAC_ADDR_U16
  10629. * Bits 15:0
  10630. * Purpose: Identifies which peer node the peer ID is for.
  10631. * Value: upper 2 bytes of peer node's MAC address
  10632. * - HW_PEER_ID / AST_INDEX_0
  10633. * Bits 31:16
  10634. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10635. * address, so for rx frames marked for rx --> tx forwarding, the
  10636. * host can determine from the HW peer ID provided as meta-data with
  10637. * the rx frame which peer the frame is supposed to be forwarded to.
  10638. * Value: ID used by the MAC HW to identify the peer
  10639. * - AST_HASH_VALUE
  10640. * Bits 15:0
  10641. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10642. * override feature.
  10643. * - NEXT_HOP
  10644. * Bit 16
  10645. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10646. * (Wireless Distribution System).
  10647. * - AST_VALID_MASK
  10648. * Bits 19:17
  10649. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10650. * - ONCHIP_AST_VALID_FLAG
  10651. * Bit 20
  10652. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10653. * is valid.
  10654. * - AST_INDEX_1
  10655. * Bits 15:0
  10656. * Purpose: indicate the second AST index for this peer
  10657. * - AST_0_FLOW_MASK
  10658. * Bits 19:16
  10659. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10660. * - AST_1_FLOW_MASK
  10661. * Bits 23:20
  10662. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10663. * - AST_2_FLOW_MASK
  10664. * Bits 27:24
  10665. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10666. * - AST_3_FLOW_MASK
  10667. * Bits 31:28
  10668. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10669. * - AST_INDEX_2
  10670. * Bits 15:0
  10671. * Purpose: indicate the third AST index for this peer
  10672. * - TID_VALID_HI_PRI
  10673. * Bits 23:16
  10674. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10675. * - TID_VALID_LOW_PRI
  10676. * Bits 31:24
  10677. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10678. * - AST_INDEX_3
  10679. * Bits 15:0
  10680. * Purpose: indicate the fourth AST index for this peer
  10681. * - ONCHIP_AST_IDX / RESERVED
  10682. * Bits 31:16
  10683. * Purpose: This field is valid only when split AST feature is enabled.
  10684. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10685. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10686. * address, this ast_idx is used for LMAC modules for RXPCU.
  10687. * Value: ID used by the LMAC HW to identify the peer
  10688. */
  10689. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10690. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10691. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10692. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10693. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10694. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10695. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10696. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10697. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10698. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10699. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10700. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10701. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10702. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10703. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10704. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10705. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10706. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10707. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10708. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10709. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10710. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10711. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10712. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10713. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10714. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10715. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10716. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10717. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10718. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10719. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10720. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10721. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10722. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10723. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10724. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10725. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10726. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10727. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10728. do { \
  10729. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10730. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10731. } while (0)
  10732. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10733. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10734. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10735. do { \
  10736. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10737. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10738. } while (0)
  10739. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10740. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10741. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10742. do { \
  10743. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10744. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10745. } while (0)
  10746. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10747. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10748. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10749. do { \
  10750. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10751. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10752. } while (0)
  10753. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10754. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10755. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10756. do { \
  10757. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10758. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10759. } while (0)
  10760. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10761. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10762. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10763. do { \
  10764. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10765. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10766. } while (0)
  10767. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10768. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10769. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10770. do { \
  10771. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10772. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10773. } while (0)
  10774. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10775. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10776. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10777. do { \
  10778. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10779. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10780. } while (0)
  10781. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10782. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10783. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10784. do { \
  10785. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10786. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10787. } while (0)
  10788. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10789. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10790. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10791. do { \
  10792. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10793. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10794. } while (0)
  10795. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10796. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10797. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10798. do { \
  10799. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10800. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10801. } while (0)
  10802. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10803. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10804. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10805. do { \
  10806. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10807. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10808. } while (0)
  10809. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10810. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10811. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10812. do { \
  10813. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10814. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10815. } while (0)
  10816. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10817. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10818. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10819. do { \
  10820. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10821. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10822. } while (0)
  10823. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10824. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10825. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10826. do { \
  10827. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10828. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10829. } while (0)
  10830. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10831. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10832. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10833. do { \
  10834. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10835. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10836. } while (0)
  10837. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10838. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10839. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10840. do { \
  10841. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10842. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10843. } while (0)
  10844. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10845. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10846. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10847. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10848. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10849. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10850. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10851. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10852. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10853. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10854. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10855. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10856. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10857. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10858. /**
  10859. * @brief target -> host rx peer map V3 message definition
  10860. *
  10861. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10862. *
  10863. * @details
  10864. * The following diagram shows the format of the rx peer map v3 message sent
  10865. * from the target to the host.
  10866. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10867. * This layout assumes the target operates as little-endian.
  10868. *
  10869. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10870. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10871. * | SW peer ID | VDEV ID | msg type |
  10872. * |-----------------+--------------------+-----------------+-----------------|
  10873. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10874. * |-----------------+--------------------+-----------------+-----------------|
  10875. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10876. * |-----------------+--------+-----------+-----------------+-----------------|
  10877. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10878. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10879. * | (8bits) | | (4bits) | |
  10880. * |-----------------+--------+--+--+--+--------------------------------------|
  10881. * | RESERVED |E |O | | |
  10882. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10883. * | |V |V | | |
  10884. * |-----------------+--------------------+-----------------------------------|
  10885. * | HTT_MSDU_IDX_ | RESERVED | |
  10886. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10887. * | (8bits) | | |
  10888. * |-----------------+--------------------+-----------------------------------|
  10889. * | Reserved_2 |
  10890. * |--------------------------------------------------------------------------|
  10891. * | Reserved_3 |
  10892. * |--------------------------------------------------------------------------|
  10893. *
  10894. * Where:
  10895. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10896. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10897. * NH = Next Hop
  10898. * The following field definitions describe the format of the rx peer map v3
  10899. * messages sent from the target to the host.
  10900. * - MSG_TYPE
  10901. * Bits 7:0
  10902. * Purpose: identifies this as a peer map v3 message
  10903. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10904. * - VDEV_ID
  10905. * Bits 15:8
  10906. * Purpose: Indicates which virtual device the peer is associated with.
  10907. * - SW_PEER_ID
  10908. * Bits 31:16
  10909. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10910. * - MAC_ADDR_L32
  10911. * Bits 31:0
  10912. * Purpose: Identifies which peer node the peer ID is for.
  10913. * Value: lower 4 bytes of peer node's MAC address
  10914. * - MAC_ADDR_U16
  10915. * Bits 15:0
  10916. * Purpose: Identifies which peer node the peer ID is for.
  10917. * Value: upper 2 bytes of peer node's MAC address
  10918. * - MULTICAST_SW_PEER_ID
  10919. * Bits 31:16
  10920. * Purpose: The multicast peer ID (index)
  10921. * Value: set to HTT_INVALID_PEER if not valid
  10922. * - HW_PEER_ID / AST_INDEX
  10923. * Bits 15:0
  10924. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10925. * address, so for rx frames marked for rx --> tx forwarding, the
  10926. * host can determine from the HW peer ID provided as meta-data with
  10927. * the rx frame which peer the frame is supposed to be forwarded to.
  10928. * - CACHE_SET_NUM
  10929. * Bits 19:16
  10930. * Purpose: Cache Set Number for AST_INDEX
  10931. * Cache set number that should be used to cache the index based
  10932. * search results, for address and flow search.
  10933. * This value should be equal to LSB 4 bits of the hash value
  10934. * of match data, in case of search index points to an entry which
  10935. * may be used in content based search also. The value can be
  10936. * anything when the entry pointed by search index will not be
  10937. * used for content based search.
  10938. * - HTT_MSDU_IDX_VALID_MASK
  10939. * Bits 31:24
  10940. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10941. * - ONCHIP_AST_IDX / RESERVED
  10942. * Bits 15:0
  10943. * Purpose: This field is valid only when split AST feature is enabled.
  10944. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10945. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10946. * address, this ast_idx is used for LMAC modules for RXPCU.
  10947. * - NEXT_HOP
  10948. * Bits 16
  10949. * Purpose: Flag indicates next_hop AST entry used for WDS
  10950. * (Wireless Distribution System).
  10951. * - ONCHIP_AST_VALID
  10952. * Bits 17
  10953. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10954. * - EXT_AST_VALID
  10955. * Bits 18
  10956. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10957. * - EXT_AST_INDEX
  10958. * Bits 15:0
  10959. * Purpose: This field describes Extended AST index
  10960. * Valid if EXT_AST_VALID flag set
  10961. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10962. * Bits 31:24
  10963. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10964. */
  10965. /* dword 0 */
  10966. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10967. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10968. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10969. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10970. /* dword 1 */
  10971. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10972. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10973. /* dword 2 */
  10974. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10975. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10976. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10977. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10978. /* dword 3 */
  10979. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10980. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10981. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10982. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10983. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10984. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10985. /* dword 4 */
  10986. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10987. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10988. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10989. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10990. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10991. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10992. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10993. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10994. /* dword 5 */
  10995. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10996. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10997. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10998. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10999. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11000. do { \
  11001. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11002. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11003. } while (0)
  11004. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11005. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11006. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11007. do { \
  11008. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11009. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11010. } while (0)
  11011. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11012. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11013. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11014. do { \
  11015. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11016. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11017. } while (0)
  11018. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11019. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11020. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11021. do { \
  11022. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11023. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11024. } while (0)
  11025. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11026. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11027. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11028. do { \
  11029. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11030. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11031. } while (0)
  11032. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11033. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11034. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11035. do { \
  11036. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11037. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11038. } while (0)
  11039. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11040. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11041. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11042. do { \
  11043. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11044. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11045. } while (0)
  11046. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11047. (((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)
  11048. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11049. do { \
  11050. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11051. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11052. } while (0)
  11053. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11054. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11055. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11056. do { \
  11057. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11058. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11059. } while (0)
  11060. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11061. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11062. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11063. do { \
  11064. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11065. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11066. } while (0)
  11067. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11068. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11069. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11070. do { \
  11071. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11072. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11073. } while (0)
  11074. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11075. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11076. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11077. do { \
  11078. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11079. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11080. } while (0)
  11081. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11082. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11083. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11084. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11085. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11086. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11087. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11088. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11089. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11090. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11091. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11092. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11093. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11094. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11095. /**
  11096. * @brief target -> host rx peer unmap V2 message definition
  11097. *
  11098. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11099. *
  11100. * The following diagram shows the format of the rx peer unmap message sent
  11101. * from the target to the host.
  11102. *
  11103. * |31 24|23 16|15 8|7 0|
  11104. * |-----------------------------------------------------------------------|
  11105. * | SW peer ID | VDEV ID | msg type |
  11106. * |-----------------------------------------------------------------------|
  11107. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11108. * |-----------------------------------------------------------------------|
  11109. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11110. * |-----------------------------------------------------------------------|
  11111. * | Peer Delete Duration |
  11112. * |-----------------------------------------------------------------------|
  11113. * | Reserved_0 | WDS Free Count |
  11114. * |-----------------------------------------------------------------------|
  11115. * | Reserved_1 |
  11116. * |-----------------------------------------------------------------------|
  11117. * | Reserved_2 |
  11118. * |-----------------------------------------------------------------------|
  11119. *
  11120. *
  11121. * The following field definitions describe the format of the rx peer unmap
  11122. * messages sent from the target to the host.
  11123. * - MSG_TYPE
  11124. * Bits 7:0
  11125. * Purpose: identifies this as an rx peer unmap v2 message
  11126. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11127. * - VDEV_ID
  11128. * Bits 15:8
  11129. * Purpose: Indicates which virtual device the peer is associated
  11130. * with.
  11131. * Value: vdev ID (used in the host to look up the vdev object)
  11132. * - SW_PEER_ID
  11133. * Bits 31:16
  11134. * Purpose: The peer ID (index) that WAL is freeing
  11135. * Value: (rx) peer ID
  11136. * - MAC_ADDR_L32
  11137. * Bits 31:0
  11138. * Purpose: Identifies which peer node the peer ID is for.
  11139. * Value: lower 4 bytes of peer node's MAC address
  11140. * - MAC_ADDR_U16
  11141. * Bits 15:0
  11142. * Purpose: Identifies which peer node the peer ID is for.
  11143. * Value: upper 2 bytes of peer node's MAC address
  11144. * - NEXT_HOP
  11145. * Bits 16
  11146. * Purpose: Bit indicates next_hop AST entry used for WDS
  11147. * (Wireless Distribution System).
  11148. * - PEER_DELETE_DURATION
  11149. * Bits 31:0
  11150. * Purpose: Time taken to delete peer, in msec,
  11151. * Used for monitoring / debugging PEER delete response delay
  11152. * - PEER_WDS_FREE_COUNT
  11153. * Bits 15:0
  11154. * Purpose: Count of WDS entries deleted associated to peer deleted
  11155. */
  11156. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11157. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11158. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11159. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11160. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11161. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11162. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11163. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11164. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11165. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11166. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11167. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11168. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11169. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11170. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11171. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11172. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11173. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11174. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11175. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11176. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11177. do { \
  11178. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11179. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11180. } while (0)
  11181. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11182. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11183. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11184. do { \
  11185. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11186. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11187. } while (0)
  11188. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11189. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11190. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11191. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11192. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11193. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11194. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11195. /**
  11196. * @brief target -> host rx peer mlo map message definition
  11197. *
  11198. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11199. *
  11200. * @details
  11201. * The following diagram shows the format of the rx mlo peer map message sent
  11202. * from the target to the host. This layout assumes the target operates
  11203. * as little-endian.
  11204. *
  11205. * MCC:
  11206. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11207. *
  11208. * WIN:
  11209. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11210. * It will be sent on the Assoc Link.
  11211. *
  11212. * This message always contains a MLO peer ID. The main purpose of the
  11213. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11214. * with, so that the host can use that MLO peer ID to determine which peer
  11215. * transmitted the rx frame.
  11216. *
  11217. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11218. * |-------------------------------------------------------------------------|
  11219. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11220. * |-------------------------------------------------------------------------|
  11221. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11222. * |-------------------------------------------------------------------------|
  11223. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11224. * |-------------------------------------------------------------------------|
  11225. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11226. * |-------------------------------------------------------------------------|
  11227. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11228. * |-------------------------------------------------------------------------|
  11229. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11230. * |-------------------------------------------------------------------------|
  11231. * |RSVD |
  11232. * |-------------------------------------------------------------------------|
  11233. * |RSVD |
  11234. * |-------------------------------------------------------------------------|
  11235. * | htt_tlv_hdr_t |
  11236. * |-------------------------------------------------------------------------|
  11237. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11238. * |-------------------------------------------------------------------------|
  11239. * | htt_tlv_hdr_t |
  11240. * |-------------------------------------------------------------------------|
  11241. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11242. * |-------------------------------------------------------------------------|
  11243. * | htt_tlv_hdr_t |
  11244. * |-------------------------------------------------------------------------|
  11245. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11246. * |-------------------------------------------------------------------------|
  11247. *
  11248. * Where:
  11249. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11250. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11251. * V (valid) - 1 Bit Bit17
  11252. * CHIPID - 3 Bits
  11253. * TIDMASK - 8 Bits
  11254. * CACHE_SET_NUM - 8 Bits
  11255. *
  11256. * The following field definitions describe the format of the rx MLO peer map
  11257. * messages sent from the target to the host.
  11258. * - MSG_TYPE
  11259. * Bits 7:0
  11260. * Purpose: identifies this as an rx mlo peer map message
  11261. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11262. *
  11263. * - MLO_PEER_ID
  11264. * Bits 23:8
  11265. * Purpose: The MLO peer ID (index).
  11266. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11267. * Value: MLO peer ID
  11268. *
  11269. * - NUMLINK
  11270. * Bits: 26:24 (3Bits)
  11271. * Purpose: Indicate the max number of logical links supported per client.
  11272. * Value: number of logical links
  11273. *
  11274. * - PRC
  11275. * Bits: 29:27 (3Bits)
  11276. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11277. * if there is migration of the primary chip.
  11278. * Value: Primary REO CHIPID
  11279. *
  11280. * - MAC_ADDR_L32
  11281. * Bits 31:0
  11282. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11283. * Value: lower 4 bytes of peer node's MAC address
  11284. *
  11285. * - MAC_ADDR_U16
  11286. * Bits 15:0
  11287. * Purpose: Identifies which peer node the peer ID is for.
  11288. * Value: upper 2 bytes of peer node's MAC address
  11289. *
  11290. * - PRIMARY_TCL_AST_IDX
  11291. * Bits 15:0
  11292. * Purpose: Primary TCL AST index for this peer.
  11293. *
  11294. * - V
  11295. * 1 Bit Position 16
  11296. * Purpose: If the ast idx is valid.
  11297. *
  11298. * - CHIPID
  11299. * Bits 19:17
  11300. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11301. *
  11302. * - TIDMASK
  11303. * Bits 27:20
  11304. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11305. *
  11306. * - CACHE_SET_NUM
  11307. * Bits 31:28
  11308. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11309. * Cache set number that should be used to cache the index based
  11310. * search results, for address and flow search.
  11311. * This value should be equal to LSB four bits of the hash value
  11312. * of match data, in case of search index points to an entry which
  11313. * may be used in content based search also. The value can be
  11314. * anything when the entry pointed by search index will not be
  11315. * used for content based search.
  11316. *
  11317. * - htt_tlv_hdr_t
  11318. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11319. *
  11320. * Bits 11:0
  11321. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11322. *
  11323. * Bits 23:12
  11324. * Purpose: Length, Length of the value that follows the header
  11325. *
  11326. * Bits 31:28
  11327. * Purpose: Reserved.
  11328. *
  11329. *
  11330. * - SW_PEER_ID
  11331. * Bits 15:0
  11332. * Purpose: The peer ID (index) that WAL is allocating
  11333. * Value: (rx) peer ID
  11334. *
  11335. * - VDEV_ID
  11336. * Bits 23:16
  11337. * Purpose: Indicates which virtual device the peer is associated with.
  11338. * Value: vdev ID (used in the host to look up the vdev object)
  11339. *
  11340. * - CHIPID
  11341. * Bits 26:24
  11342. * Purpose: Indicates which Chip id the peer is associated with.
  11343. * Value: chip ID (Provided by Host as part of QMI exchange)
  11344. */
  11345. typedef enum {
  11346. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11347. } MLO_PEER_MAP_TLV_TAG_ID;
  11348. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11349. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11350. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11351. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11352. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11353. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11354. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11355. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11356. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11357. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11358. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11359. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11360. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11361. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11362. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11363. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11364. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11365. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11366. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11367. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11368. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11369. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11370. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11371. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11372. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11373. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11374. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11375. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11376. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11377. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11378. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11379. do { \
  11380. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11381. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11382. } while (0)
  11383. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11384. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11385. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11386. do { \
  11387. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11388. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11389. } while (0)
  11390. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11391. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11392. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11393. do { \
  11394. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11395. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11396. } while (0)
  11397. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11398. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11399. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11400. do { \
  11401. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11402. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11403. } while (0)
  11404. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11405. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11406. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11407. do { \
  11408. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11409. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11410. } while (0)
  11411. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11412. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11413. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11414. do { \
  11415. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11416. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11417. } while (0)
  11418. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11419. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11420. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11421. do { \
  11422. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11423. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11424. } while (0)
  11425. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11426. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11427. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11428. do { \
  11429. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11430. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11431. } while (0)
  11432. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11433. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11434. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11435. do { \
  11436. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11437. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11438. } while (0)
  11439. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11440. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11441. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11442. do { \
  11443. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11444. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11445. } while (0)
  11446. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11447. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11448. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11449. do { \
  11450. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11451. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11452. } while (0)
  11453. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11454. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11455. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11456. do { \
  11457. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11458. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11459. } while (0)
  11460. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11461. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11462. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11463. do { \
  11464. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11465. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11466. } while (0)
  11467. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11468. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11469. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11470. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11471. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11472. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11473. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11474. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11475. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11476. *
  11477. * The following diagram shows the format of the rx mlo peer unmap message sent
  11478. * from the target to the host.
  11479. *
  11480. * |31 24|23 16|15 8|7 0|
  11481. * |-----------------------------------------------------------------------|
  11482. * | RSVD_24_31 | MLO peer ID | msg type |
  11483. * |-----------------------------------------------------------------------|
  11484. */
  11485. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11486. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11487. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11488. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11489. /**
  11490. * @brief target -> host message specifying security parameters
  11491. *
  11492. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11493. *
  11494. * @details
  11495. * The following diagram shows the format of the security specification
  11496. * message sent from the target to the host.
  11497. * This security specification message tells the host whether a PN check is
  11498. * necessary on rx data frames, and if so, how large the PN counter is.
  11499. * This message also tells the host about the security processing to apply
  11500. * to defragmented rx frames - specifically, whether a Message Integrity
  11501. * Check is required, and the Michael key to use.
  11502. *
  11503. * |31 24|23 16|15|14 8|7 0|
  11504. * |-----------------------------------------------------------------------|
  11505. * | peer ID | U| security type | msg type |
  11506. * |-----------------------------------------------------------------------|
  11507. * | Michael Key K0 |
  11508. * |-----------------------------------------------------------------------|
  11509. * | Michael Key K1 |
  11510. * |-----------------------------------------------------------------------|
  11511. * | WAPI RSC Low0 |
  11512. * |-----------------------------------------------------------------------|
  11513. * | WAPI RSC Low1 |
  11514. * |-----------------------------------------------------------------------|
  11515. * | WAPI RSC Hi0 |
  11516. * |-----------------------------------------------------------------------|
  11517. * | WAPI RSC Hi1 |
  11518. * |-----------------------------------------------------------------------|
  11519. *
  11520. * The following field definitions describe the format of the security
  11521. * indication message sent from the target to the host.
  11522. * - MSG_TYPE
  11523. * Bits 7:0
  11524. * Purpose: identifies this as a security specification message
  11525. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11526. * - SEC_TYPE
  11527. * Bits 14:8
  11528. * Purpose: specifies which type of security applies to the peer
  11529. * Value: htt_sec_type enum value
  11530. * - UNICAST
  11531. * Bit 15
  11532. * Purpose: whether this security is applied to unicast or multicast data
  11533. * Value: 1 -> unicast, 0 -> multicast
  11534. * - PEER_ID
  11535. * Bits 31:16
  11536. * Purpose: The ID number for the peer the security specification is for
  11537. * Value: peer ID
  11538. * - MICHAEL_KEY_K0
  11539. * Bits 31:0
  11540. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11541. * Value: Michael Key K0 (if security type is TKIP)
  11542. * - MICHAEL_KEY_K1
  11543. * Bits 31:0
  11544. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11545. * Value: Michael Key K1 (if security type is TKIP)
  11546. * - WAPI_RSC_LOW0
  11547. * Bits 31:0
  11548. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11549. * Value: WAPI RSC Low0 (if security type is WAPI)
  11550. * - WAPI_RSC_LOW1
  11551. * Bits 31:0
  11552. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11553. * Value: WAPI RSC Low1 (if security type is WAPI)
  11554. * - WAPI_RSC_HI0
  11555. * Bits 31:0
  11556. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11557. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11558. * - WAPI_RSC_HI1
  11559. * Bits 31:0
  11560. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11561. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11562. */
  11563. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11564. #define HTT_SEC_IND_SEC_TYPE_S 8
  11565. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11566. #define HTT_SEC_IND_UNICAST_S 15
  11567. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11568. #define HTT_SEC_IND_PEER_ID_S 16
  11569. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11570. do { \
  11571. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11572. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11573. } while (0)
  11574. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11575. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11576. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11577. do { \
  11578. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11579. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11580. } while (0)
  11581. #define HTT_SEC_IND_UNICAST_GET(word) \
  11582. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11583. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11584. do { \
  11585. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11586. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11587. } while (0)
  11588. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11589. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11590. #define HTT_SEC_IND_BYTES 28
  11591. /**
  11592. * @brief target -> host rx ADDBA / DELBA message definitions
  11593. *
  11594. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11595. *
  11596. * @details
  11597. * The following diagram shows the format of the rx ADDBA message sent
  11598. * from the target to the host:
  11599. *
  11600. * |31 20|19 16|15 8|7 0|
  11601. * |---------------------------------------------------------------------|
  11602. * | peer ID | TID | window size | msg type |
  11603. * |---------------------------------------------------------------------|
  11604. *
  11605. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11606. *
  11607. * The following diagram shows the format of the rx DELBA message sent
  11608. * from the target to the host:
  11609. *
  11610. * |31 20|19 16|15 10|9 8|7 0|
  11611. * |---------------------------------------------------------------------|
  11612. * | peer ID | TID | window size | IR| msg type |
  11613. * |---------------------------------------------------------------------|
  11614. *
  11615. * The following field definitions describe the format of the rx ADDBA
  11616. * and DELBA messages sent from the target to the host.
  11617. * - MSG_TYPE
  11618. * Bits 7:0
  11619. * Purpose: identifies this as an rx ADDBA or DELBA message
  11620. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11621. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11622. * - IR (initiator / recipient)
  11623. * Bits 9:8 (DELBA only)
  11624. * Purpose: specify whether the DELBA handshake was initiated by the
  11625. * local STA/AP, or by the peer STA/AP
  11626. * Value:
  11627. * 0 - unspecified
  11628. * 1 - initiator (a.k.a. originator)
  11629. * 2 - recipient (a.k.a. responder)
  11630. * 3 - unused / reserved
  11631. * - WIN_SIZE
  11632. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11633. * Purpose: Specifies the length of the block ack window (max = 64).
  11634. * Value:
  11635. * block ack window length specified by the received ADDBA/DELBA
  11636. * management message.
  11637. * - TID
  11638. * Bits 19:16
  11639. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11640. * Value:
  11641. * TID specified by the received ADDBA or DELBA management message.
  11642. * - PEER_ID
  11643. * Bits 31:20
  11644. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11645. * Value:
  11646. * ID (hash value) used by the host for fast, direct lookup of
  11647. * host SW peer info, including rx reorder states.
  11648. */
  11649. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11650. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11651. #define HTT_RX_ADDBA_TID_M 0xf0000
  11652. #define HTT_RX_ADDBA_TID_S 16
  11653. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11654. #define HTT_RX_ADDBA_PEER_ID_S 20
  11655. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11656. do { \
  11657. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11658. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11659. } while (0)
  11660. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11661. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11662. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11663. do { \
  11664. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11665. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11666. } while (0)
  11667. #define HTT_RX_ADDBA_TID_GET(word) \
  11668. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11669. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11670. do { \
  11671. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11672. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11673. } while (0)
  11674. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11675. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11676. #define HTT_RX_ADDBA_BYTES 4
  11677. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11678. #define HTT_RX_DELBA_INITIATOR_S 8
  11679. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11680. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11681. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11682. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11683. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11684. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11685. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11686. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11687. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11688. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11689. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11690. do { \
  11691. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11692. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11693. } while (0)
  11694. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11695. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11696. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11697. do { \
  11698. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11699. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11700. } while (0)
  11701. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11702. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11703. #define HTT_RX_DELBA_BYTES 4
  11704. /**
  11705. * @brief tx queue group information element definition
  11706. *
  11707. * @details
  11708. * The following diagram shows the format of the tx queue group
  11709. * information element, which can be included in target --> host
  11710. * messages to specify the number of tx "credits" (tx descriptors
  11711. * for LL, or tx buffers for HL) available to a particular group
  11712. * of host-side tx queues, and which host-side tx queues belong to
  11713. * the group.
  11714. *
  11715. * |31|30 24|23 16|15|14|13 0|
  11716. * |------------------------------------------------------------------------|
  11717. * | X| reserved | tx queue grp ID | A| S| credit count |
  11718. * |------------------------------------------------------------------------|
  11719. * | vdev ID mask | AC mask |
  11720. * |------------------------------------------------------------------------|
  11721. *
  11722. * The following definitions describe the fields within the tx queue group
  11723. * information element:
  11724. * - credit_count
  11725. * Bits 13:1
  11726. * Purpose: specify how many tx credits are available to the tx queue group
  11727. * Value: An absolute or relative, positive or negative credit value
  11728. * The 'A' bit specifies whether the value is absolute or relative.
  11729. * The 'S' bit specifies whether the value is positive or negative.
  11730. * A negative value can only be relative, not absolute.
  11731. * An absolute value replaces any prior credit value the host has for
  11732. * the tx queue group in question.
  11733. * A relative value is added to the prior credit value the host has for
  11734. * the tx queue group in question.
  11735. * - sign
  11736. * Bit 14
  11737. * Purpose: specify whether the credit count is positive or negative
  11738. * Value: 0 -> positive, 1 -> negative
  11739. * - absolute
  11740. * Bit 15
  11741. * Purpose: specify whether the credit count is absolute or relative
  11742. * Value: 0 -> relative, 1 -> absolute
  11743. * - txq_group_id
  11744. * Bits 23:16
  11745. * Purpose: indicate which tx queue group's credit and/or membership are
  11746. * being specified
  11747. * Value: 0 to max_tx_queue_groups-1
  11748. * - reserved
  11749. * Bits 30:16
  11750. * Value: 0x0
  11751. * - eXtension
  11752. * Bit 31
  11753. * Purpose: specify whether another tx queue group info element follows
  11754. * Value: 0 -> no more tx queue group information elements
  11755. * 1 -> another tx queue group information element immediately follows
  11756. * - ac_mask
  11757. * Bits 15:0
  11758. * Purpose: specify which Access Categories belong to the tx queue group
  11759. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11760. * the tx queue group.
  11761. * The AC bit-mask values are obtained by left-shifting by the
  11762. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11763. * - vdev_id_mask
  11764. * Bits 31:16
  11765. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11766. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11767. * belong to the tx queue group.
  11768. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11769. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11770. */
  11771. PREPACK struct htt_txq_group {
  11772. A_UINT32
  11773. credit_count: 14,
  11774. sign: 1,
  11775. absolute: 1,
  11776. tx_queue_group_id: 8,
  11777. reserved0: 7,
  11778. extension: 1;
  11779. A_UINT32
  11780. ac_mask: 16,
  11781. vdev_id_mask: 16;
  11782. } POSTPACK;
  11783. /* first word */
  11784. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11785. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11786. #define HTT_TXQ_GROUP_SIGN_S 14
  11787. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11788. #define HTT_TXQ_GROUP_ABS_S 15
  11789. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11790. #define HTT_TXQ_GROUP_ID_S 16
  11791. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11792. #define HTT_TXQ_GROUP_EXT_S 31
  11793. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11794. /* second word */
  11795. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11796. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11797. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11798. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11799. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11800. do { \
  11801. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11802. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11803. } while (0)
  11804. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11805. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11806. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11807. do { \
  11808. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11809. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11810. } while (0)
  11811. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11812. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11813. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11814. do { \
  11815. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11816. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11817. } while (0)
  11818. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11819. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11820. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11821. do { \
  11822. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11823. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11824. } while (0)
  11825. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11826. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11827. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11828. do { \
  11829. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11830. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11831. } while (0)
  11832. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11833. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11834. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11835. do { \
  11836. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11837. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11838. } while (0)
  11839. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11840. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11841. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11842. do { \
  11843. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11844. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11845. } while (0)
  11846. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11847. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11848. /**
  11849. * @brief target -> host TX completion indication message definition
  11850. *
  11851. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11852. *
  11853. * @details
  11854. * The following diagram shows the format of the TX completion indication sent
  11855. * from the target to the host
  11856. *
  11857. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11858. * |-------------------------------------------------------------------|
  11859. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11860. * |-------------------------------------------------------------------|
  11861. * payload:| MSDU1 ID | MSDU0 ID |
  11862. * |-------------------------------------------------------------------|
  11863. * : MSDU3 ID | MSDU2 ID :
  11864. * |-------------------------------------------------------------------|
  11865. * | struct htt_tx_compl_ind_append_retries |
  11866. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11867. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11868. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11869. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11870. * |-------------------------------------------------------------------|
  11871. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11872. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11873. * | MSDU0 tx_tsf64_low |
  11874. * |-------------------------------------------------------------------|
  11875. * | MSDU0 tx_tsf64_high |
  11876. * |-------------------------------------------------------------------|
  11877. * | MSDU1 tx_tsf64_low |
  11878. * |-------------------------------------------------------------------|
  11879. * | MSDU1 tx_tsf64_high |
  11880. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11881. * | phy_timestamp |
  11882. * |-------------------------------------------------------------------|
  11883. * | rate specs (see below) |
  11884. * |-------------------------------------------------------------------|
  11885. * | seqctrl | framectrl |
  11886. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11887. * Where:
  11888. * A0 = append (a.k.a. append0)
  11889. * A1 = append1
  11890. * TP = MSDU tx power presence
  11891. * A2 = append2
  11892. * A3 = append3
  11893. * A4 = append4
  11894. *
  11895. * The following field definitions describe the format of the TX completion
  11896. * indication sent from the target to the host
  11897. * Header fields:
  11898. * - msg_type
  11899. * Bits 7:0
  11900. * Purpose: identifies this as HTT TX completion indication
  11901. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11902. * - status
  11903. * Bits 10:8
  11904. * Purpose: the TX completion status of payload fragmentations descriptors
  11905. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11906. * - tid
  11907. * Bits 14:11
  11908. * Purpose: the tid associated with those fragmentation descriptors. It is
  11909. * valid or not, depending on the tid_invalid bit.
  11910. * Value: 0 to 15
  11911. * - tid_invalid
  11912. * Bits 15:15
  11913. * Purpose: this bit indicates whether the tid field is valid or not
  11914. * Value: 0 indicates valid; 1 indicates invalid
  11915. * - num
  11916. * Bits 23:16
  11917. * Purpose: the number of payload in this indication
  11918. * Value: 1 to 255
  11919. * - append (a.k.a. append0)
  11920. * Bits 24:24
  11921. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11922. * the number of tx retries for one MSDU at the end of this message
  11923. * Value: 0 indicates no appending; 1 indicates appending
  11924. * - append1
  11925. * Bits 25:25
  11926. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11927. * contains the timestamp info for each TX msdu id in payload.
  11928. * The order of the timestamps matches the order of the MSDU IDs.
  11929. * Note that a big-endian host needs to account for the reordering
  11930. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11931. * conversion) when determining which tx timestamp corresponds to
  11932. * which MSDU ID.
  11933. * Value: 0 indicates no appending; 1 indicates appending
  11934. * - msdu_tx_power_presence
  11935. * Bits 26:26
  11936. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11937. * for each MSDU referenced by the TX_COMPL_IND message.
  11938. * The tx power is reported in 0.5 dBm units.
  11939. * The order of the per-MSDU tx power reports matches the order
  11940. * of the MSDU IDs.
  11941. * Note that a big-endian host needs to account for the reordering
  11942. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11943. * conversion) when determining which Tx Power corresponds to
  11944. * which MSDU ID.
  11945. * Value: 0 indicates MSDU tx power reports are not appended,
  11946. * 1 indicates MSDU tx power reports are appended
  11947. * - append2
  11948. * Bits 27:27
  11949. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11950. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11951. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11952. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11953. * for each MSDU, for convenience.
  11954. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11955. * this append2 bit is set).
  11956. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11957. * dB above the noise floor.
  11958. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11959. * 1 indicates MSDU ACK RSSI values are appended.
  11960. * - append3
  11961. * Bits 28:28
  11962. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11963. * contains the tx tsf info based on wlan global TSF for
  11964. * each TX msdu id in payload.
  11965. * The order of the tx tsf matches the order of the MSDU IDs.
  11966. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11967. * values to indicate the the lower 32 bits and higher 32 bits of
  11968. * the tx tsf.
  11969. * The tx_tsf64 here represents the time MSDU was acked and the
  11970. * tx_tsf64 has microseconds units.
  11971. * Value: 0 indicates no appending; 1 indicates appending
  11972. * - append4
  11973. * Bits 29:29
  11974. * Purpose: Indicate whether data frame control fields and fields required
  11975. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11976. * message. The order of the this message matches the order of
  11977. * the MSDU IDs.
  11978. * Value: 0 indicates frame control fields and fields required for
  11979. * radio tap header values are not appended,
  11980. * 1 indicates frame control fields and fields required for
  11981. * radio tap header values are appended.
  11982. * Payload fields:
  11983. * - hmsdu_id
  11984. * Bits 15:0
  11985. * Purpose: this ID is used to track the Tx buffer in host
  11986. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11987. */
  11988. PREPACK struct htt_tx_data_hdr_information {
  11989. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11990. A_UINT32 /* word 1 */
  11991. /* preamble:
  11992. * 0-OFDM,
  11993. * 1-CCk,
  11994. * 2-HT,
  11995. * 3-VHT
  11996. */
  11997. preamble: 2, /* [1:0] */
  11998. /* mcs:
  11999. * In case of HT preamble interpret
  12000. * MCS along with NSS.
  12001. * Valid values for HT are 0 to 7.
  12002. * HT mcs 0 with NSS 2 is mcs 8.
  12003. * Valid values for VHT are 0 to 9.
  12004. */
  12005. mcs: 4, /* [5:2] */
  12006. /* rate:
  12007. * This is applicable only for
  12008. * CCK and OFDM preamble type
  12009. * rate 0: OFDM 48 Mbps,
  12010. * 1: OFDM 24 Mbps,
  12011. * 2: OFDM 12 Mbps
  12012. * 3: OFDM 6 Mbps
  12013. * 4: OFDM 54 Mbps
  12014. * 5: OFDM 36 Mbps
  12015. * 6: OFDM 18 Mbps
  12016. * 7: OFDM 9 Mbps
  12017. * rate 0: CCK 11 Mbps Long
  12018. * 1: CCK 5.5 Mbps Long
  12019. * 2: CCK 2 Mbps Long
  12020. * 3: CCK 1 Mbps Long
  12021. * 4: CCK 11 Mbps Short
  12022. * 5: CCK 5.5 Mbps Short
  12023. * 6: CCK 2 Mbps Short
  12024. */
  12025. rate : 3, /* [ 8: 6] */
  12026. rssi : 8, /* [16: 9] units=dBm */
  12027. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12028. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12029. stbc : 1, /* [22] */
  12030. sgi : 1, /* [23] */
  12031. ldpc : 1, /* [24] */
  12032. beamformed: 1, /* [25] */
  12033. /* tx_retry_cnt:
  12034. * Indicates retry count of data tx frames provided by the host.
  12035. */
  12036. tx_retry_cnt: 6; /* [31:26] */
  12037. A_UINT32 /* word 2 */
  12038. framectrl:16, /* [15: 0] */
  12039. seqno:16; /* [31:16] */
  12040. } POSTPACK;
  12041. #define HTT_TX_COMPL_IND_STATUS_S 8
  12042. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12043. #define HTT_TX_COMPL_IND_TID_S 11
  12044. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12045. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12046. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12047. #define HTT_TX_COMPL_IND_NUM_S 16
  12048. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12049. #define HTT_TX_COMPL_IND_APPEND_S 24
  12050. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12051. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12052. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12053. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12054. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12055. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12056. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12057. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12058. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12059. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12060. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12061. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12062. do { \
  12063. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12064. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12065. } while (0)
  12066. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12067. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12068. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12069. do { \
  12070. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12071. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12072. } while (0)
  12073. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12074. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12075. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12076. do { \
  12077. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12078. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12079. } while (0)
  12080. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12081. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12082. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12083. do { \
  12084. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12085. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12086. } while (0)
  12087. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12088. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12089. HTT_TX_COMPL_IND_TID_INV_S)
  12090. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12093. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12094. } while (0)
  12095. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12096. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12097. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12098. do { \
  12099. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12100. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12101. } while (0)
  12102. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12103. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12104. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12105. do { \
  12106. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12107. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12108. } while (0)
  12109. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12110. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12111. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12112. do { \
  12113. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12114. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12115. } while (0)
  12116. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12117. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12118. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12119. do { \
  12120. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12121. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12122. } while (0)
  12123. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12124. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12125. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12126. do { \
  12127. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12128. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12129. } while (0)
  12130. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12131. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12132. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12133. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12134. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12135. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12136. #define HTT_TX_COMPL_IND_STAT_OK 0
  12137. /* DISCARD:
  12138. * current meaning:
  12139. * MSDUs were queued for transmission but filtered by HW or SW
  12140. * without any over the air attempts
  12141. * legacy meaning (HL Rome):
  12142. * MSDUs were discarded by the target FW without any over the air
  12143. * attempts due to lack of space
  12144. */
  12145. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12146. /* NO_ACK:
  12147. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12148. */
  12149. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12150. /* POSTPONE:
  12151. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12152. * be downloaded again later (in the appropriate order), when they are
  12153. * deliverable.
  12154. */
  12155. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12156. /*
  12157. * The PEER_DEL tx completion status is used for HL cases
  12158. * where the peer the frame is for has been deleted.
  12159. * The host has already discarded its copy of the frame, but
  12160. * it still needs the tx completion to restore its credit.
  12161. */
  12162. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12163. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12164. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12165. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12166. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12167. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12168. PREPACK struct htt_tx_compl_ind_base {
  12169. A_UINT32 hdr;
  12170. A_UINT16 payload[1/*or more*/];
  12171. } POSTPACK;
  12172. PREPACK struct htt_tx_compl_ind_append_retries {
  12173. A_UINT16 msdu_id;
  12174. A_UINT8 tx_retries;
  12175. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12176. 0: this is the last append_retries struct */
  12177. } POSTPACK;
  12178. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12179. A_UINT32 timestamp[1/*or more*/];
  12180. } POSTPACK;
  12181. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12182. A_UINT32 tx_tsf64_low;
  12183. A_UINT32 tx_tsf64_high;
  12184. } POSTPACK;
  12185. /* htt_tx_data_hdr_information payload extension fields: */
  12186. /* DWORD zero */
  12187. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12188. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12189. /* DWORD one */
  12190. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12191. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12192. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12193. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12194. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12195. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12196. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12197. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12198. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12199. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12200. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12201. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12202. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12203. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12204. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12205. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12206. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12207. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12208. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12209. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12210. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12211. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12212. /* DWORD two */
  12213. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12214. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12215. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12216. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12217. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12218. do { \
  12219. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12220. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12221. } while (0)
  12222. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12223. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12224. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12225. do { \
  12226. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12227. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12228. } while (0)
  12229. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12230. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12231. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12232. do { \
  12233. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12234. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12235. } while (0)
  12236. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12237. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12238. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12239. do { \
  12240. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12241. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12242. } while (0)
  12243. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12244. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12245. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12246. do { \
  12247. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12248. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12249. } while (0)
  12250. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12251. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12252. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12253. do { \
  12254. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12255. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12256. } while (0)
  12257. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12258. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12259. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12260. do { \
  12261. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12262. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12263. } while (0)
  12264. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12265. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12266. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12267. do { \
  12268. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12269. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12270. } while (0)
  12271. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12272. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12273. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12274. do { \
  12275. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12276. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12277. } while (0)
  12278. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12279. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12280. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12281. do { \
  12282. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12283. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12284. } while (0)
  12285. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12286. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12287. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12288. do { \
  12289. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12290. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12291. } while (0)
  12292. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12293. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12294. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12295. do { \
  12296. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12297. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12298. } while (0)
  12299. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12300. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12301. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12302. do { \
  12303. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12304. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12305. } while (0)
  12306. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12307. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12308. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12309. do { \
  12310. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12311. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12312. } while (0)
  12313. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12314. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12315. /**
  12316. * @brief target -> host rate-control update indication message
  12317. *
  12318. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12319. *
  12320. * @details
  12321. * The following diagram shows the format of the RC Update message
  12322. * sent from the target to the host, while processing the tx-completion
  12323. * of a transmitted PPDU.
  12324. *
  12325. * |31 24|23 16|15 8|7 0|
  12326. * |-------------------------------------------------------------|
  12327. * | peer ID | vdev ID | msg_type |
  12328. * |-------------------------------------------------------------|
  12329. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12330. * |-------------------------------------------------------------|
  12331. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12332. * |-------------------------------------------------------------|
  12333. * | : |
  12334. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12335. * | : |
  12336. * |-------------------------------------------------------------|
  12337. * | : |
  12338. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12339. * | : |
  12340. * |-------------------------------------------------------------|
  12341. * : :
  12342. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12343. *
  12344. */
  12345. typedef struct {
  12346. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12347. A_UINT32 rate_code_flags;
  12348. A_UINT32 flags; /* Encodes information such as excessive
  12349. retransmission, aggregate, some info
  12350. from .11 frame control,
  12351. STBC, LDPC, (SGI and Tx Chain Mask
  12352. are encoded in ptx_rc->flags field),
  12353. AMPDU truncation (BT/time based etc.),
  12354. RTS/CTS attempt */
  12355. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12356. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12357. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12358. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12359. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12360. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12361. } HTT_RC_TX_DONE_PARAMS;
  12362. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12363. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12364. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12365. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12366. #define HTT_RC_UPDATE_VDEVID_S 8
  12367. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12368. #define HTT_RC_UPDATE_PEERID_S 16
  12369. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12370. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12371. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12372. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12373. do { \
  12374. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12375. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12376. } while (0)
  12377. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12378. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12379. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12380. do { \
  12381. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12382. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12383. } while (0)
  12384. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12385. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12386. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12387. do { \
  12388. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12389. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12390. } while (0)
  12391. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12392. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12393. /**
  12394. * @brief target -> host rx fragment indication message definition
  12395. *
  12396. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12397. *
  12398. * @details
  12399. * The following field definitions describe the format of the rx fragment
  12400. * indication message sent from the target to the host.
  12401. * The rx fragment indication message shares the format of the
  12402. * rx indication message, but not all fields from the rx indication message
  12403. * are relevant to the rx fragment indication message.
  12404. *
  12405. *
  12406. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12407. * |-----------+-------------------+---------------------+-------------|
  12408. * | peer ID | |FV| ext TID | msg type |
  12409. * |-------------------------------------------------------------------|
  12410. * | | flush | flush |
  12411. * | | end | start |
  12412. * | | seq num | seq num |
  12413. * |-------------------------------------------------------------------|
  12414. * | reserved | FW rx desc bytes |
  12415. * |-------------------------------------------------------------------|
  12416. * | | FW MSDU Rx |
  12417. * | | desc B0 |
  12418. * |-------------------------------------------------------------------|
  12419. * Header fields:
  12420. * - MSG_TYPE
  12421. * Bits 7:0
  12422. * Purpose: identifies this as an rx fragment indication message
  12423. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12424. * - EXT_TID
  12425. * Bits 12:8
  12426. * Purpose: identify the traffic ID of the rx data, including
  12427. * special "extended" TID values for multicast, broadcast, and
  12428. * non-QoS data frames
  12429. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12430. * - FLUSH_VALID (FV)
  12431. * Bit 13
  12432. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12433. * is valid
  12434. * Value:
  12435. * 1 -> flush IE is valid and needs to be processed
  12436. * 0 -> flush IE is not valid and should be ignored
  12437. * - PEER_ID
  12438. * Bits 31:16
  12439. * Purpose: Identify, by ID, which peer sent the rx data
  12440. * Value: ID of the peer who sent the rx data
  12441. * - FLUSH_SEQ_NUM_START
  12442. * Bits 5:0
  12443. * Purpose: Indicate the start of a series of MPDUs to flush
  12444. * Not all MPDUs within this series are necessarily valid - the host
  12445. * must check each sequence number within this range to see if the
  12446. * corresponding MPDU is actually present.
  12447. * This field is only valid if the FV bit is set.
  12448. * Value:
  12449. * The sequence number for the first MPDUs to check to flush.
  12450. * The sequence number is masked by 0x3f.
  12451. * - FLUSH_SEQ_NUM_END
  12452. * Bits 11:6
  12453. * Purpose: Indicate the end of a series of MPDUs to flush
  12454. * Value:
  12455. * The sequence number one larger than the sequence number of the
  12456. * last MPDU to check to flush.
  12457. * The sequence number is masked by 0x3f.
  12458. * Not all MPDUs within this series are necessarily valid - the host
  12459. * must check each sequence number within this range to see if the
  12460. * corresponding MPDU is actually present.
  12461. * This field is only valid if the FV bit is set.
  12462. * Rx descriptor fields:
  12463. * - FW_RX_DESC_BYTES
  12464. * Bits 15:0
  12465. * Purpose: Indicate how many bytes in the Rx indication are used for
  12466. * FW Rx descriptors
  12467. * Value: 1
  12468. */
  12469. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12470. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12471. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12472. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12473. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12474. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12475. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12476. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12477. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12478. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12479. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12480. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12481. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12482. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12483. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12484. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12485. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12486. #define HTT_RX_FRAG_IND_BYTES \
  12487. (4 /* msg hdr */ + \
  12488. 4 /* flush spec */ + \
  12489. 4 /* (unused) FW rx desc bytes spec */ + \
  12490. 4 /* FW rx desc */)
  12491. /**
  12492. * @brief target -> host test message definition
  12493. *
  12494. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12495. *
  12496. * @details
  12497. * The following field definitions describe the format of the test
  12498. * message sent from the target to the host.
  12499. * The message consists of a 4-octet header, followed by a variable
  12500. * number of 32-bit integer values, followed by a variable number
  12501. * of 8-bit character values.
  12502. *
  12503. * |31 16|15 8|7 0|
  12504. * |-----------------------------------------------------------|
  12505. * | num chars | num ints | msg type |
  12506. * |-----------------------------------------------------------|
  12507. * | int 0 |
  12508. * |-----------------------------------------------------------|
  12509. * | int 1 |
  12510. * |-----------------------------------------------------------|
  12511. * | ... |
  12512. * |-----------------------------------------------------------|
  12513. * | char 3 | char 2 | char 1 | char 0 |
  12514. * |-----------------------------------------------------------|
  12515. * | | | ... | char 4 |
  12516. * |-----------------------------------------------------------|
  12517. * - MSG_TYPE
  12518. * Bits 7:0
  12519. * Purpose: identifies this as a test message
  12520. * Value: HTT_MSG_TYPE_TEST
  12521. * - NUM_INTS
  12522. * Bits 15:8
  12523. * Purpose: indicate how many 32-bit integers follow the message header
  12524. * - NUM_CHARS
  12525. * Bits 31:16
  12526. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12527. */
  12528. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12529. #define HTT_RX_TEST_NUM_INTS_S 8
  12530. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12531. #define HTT_RX_TEST_NUM_CHARS_S 16
  12532. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12533. do { \
  12534. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12535. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12536. } while (0)
  12537. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12538. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12539. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12540. do { \
  12541. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12542. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12543. } while (0)
  12544. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12545. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12546. /**
  12547. * @brief target -> host packet log message
  12548. *
  12549. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12550. *
  12551. * @details
  12552. * The following field definitions describe the format of the packet log
  12553. * message sent from the target to the host.
  12554. * The message consists of a 4-octet header,followed by a variable number
  12555. * of 32-bit character values.
  12556. *
  12557. * |31 16|15 12|11 10|9 8|7 0|
  12558. * |------------------------------------------------------------------|
  12559. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12560. * |------------------------------------------------------------------|
  12561. * | payload |
  12562. * |------------------------------------------------------------------|
  12563. * - MSG_TYPE
  12564. * Bits 7:0
  12565. * Purpose: identifies this as a pktlog message
  12566. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12567. * - mac_id
  12568. * Bits 9:8
  12569. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12570. * Value: 0-3
  12571. * - pdev_id
  12572. * Bits 11:10
  12573. * Purpose: pdev_id
  12574. * Value: 0-3
  12575. * 0 (for rings at SOC level),
  12576. * 1/2/3 PDEV -> 0/1/2
  12577. * - payload_size
  12578. * Bits 31:16
  12579. * Purpose: explicitly specify the payload size
  12580. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12581. */
  12582. PREPACK struct htt_pktlog_msg {
  12583. A_UINT32 header;
  12584. A_UINT32 payload[1/* or more */];
  12585. } POSTPACK;
  12586. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12587. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12588. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12589. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12590. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12591. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12592. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12593. do { \
  12594. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12595. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12596. } while (0)
  12597. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12598. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12599. HTT_T2H_PKTLOG_MAC_ID_S)
  12600. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12601. do { \
  12602. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12603. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12604. } while (0)
  12605. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12606. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12607. HTT_T2H_PKTLOG_PDEV_ID_S)
  12608. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12609. do { \
  12610. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12611. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12612. } while (0)
  12613. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12614. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12615. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12616. /*
  12617. * Rx reorder statistics
  12618. * NB: all the fields must be defined in 4 octets size.
  12619. */
  12620. struct rx_reorder_stats {
  12621. /* Non QoS MPDUs received */
  12622. A_UINT32 deliver_non_qos;
  12623. /* MPDUs received in-order */
  12624. A_UINT32 deliver_in_order;
  12625. /* Flush due to reorder timer expired */
  12626. A_UINT32 deliver_flush_timeout;
  12627. /* Flush due to move out of window */
  12628. A_UINT32 deliver_flush_oow;
  12629. /* Flush due to DELBA */
  12630. A_UINT32 deliver_flush_delba;
  12631. /* MPDUs dropped due to FCS error */
  12632. A_UINT32 fcs_error;
  12633. /* MPDUs dropped due to monitor mode non-data packet */
  12634. A_UINT32 mgmt_ctrl;
  12635. /* Unicast-data MPDUs dropped due to invalid peer */
  12636. A_UINT32 invalid_peer;
  12637. /* MPDUs dropped due to duplication (non aggregation) */
  12638. A_UINT32 dup_non_aggr;
  12639. /* MPDUs dropped due to processed before */
  12640. A_UINT32 dup_past;
  12641. /* MPDUs dropped due to duplicate in reorder queue */
  12642. A_UINT32 dup_in_reorder;
  12643. /* Reorder timeout happened */
  12644. A_UINT32 reorder_timeout;
  12645. /* invalid bar ssn */
  12646. A_UINT32 invalid_bar_ssn;
  12647. /* reorder reset due to bar ssn */
  12648. A_UINT32 ssn_reset;
  12649. /* Flush due to delete peer */
  12650. A_UINT32 deliver_flush_delpeer;
  12651. /* Flush due to offload*/
  12652. A_UINT32 deliver_flush_offload;
  12653. /* Flush due to out of buffer*/
  12654. A_UINT32 deliver_flush_oob;
  12655. /* MPDUs dropped due to PN check fail */
  12656. A_UINT32 pn_fail;
  12657. /* MPDUs dropped due to unable to allocate memory */
  12658. A_UINT32 store_fail;
  12659. /* Number of times the tid pool alloc succeeded */
  12660. A_UINT32 tid_pool_alloc_succ;
  12661. /* Number of times the MPDU pool alloc succeeded */
  12662. A_UINT32 mpdu_pool_alloc_succ;
  12663. /* Number of times the MSDU pool alloc succeeded */
  12664. A_UINT32 msdu_pool_alloc_succ;
  12665. /* Number of times the tid pool alloc failed */
  12666. A_UINT32 tid_pool_alloc_fail;
  12667. /* Number of times the MPDU pool alloc failed */
  12668. A_UINT32 mpdu_pool_alloc_fail;
  12669. /* Number of times the MSDU pool alloc failed */
  12670. A_UINT32 msdu_pool_alloc_fail;
  12671. /* Number of times the tid pool freed */
  12672. A_UINT32 tid_pool_free;
  12673. /* Number of times the MPDU pool freed */
  12674. A_UINT32 mpdu_pool_free;
  12675. /* Number of times the MSDU pool freed */
  12676. A_UINT32 msdu_pool_free;
  12677. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12678. A_UINT32 msdu_queued;
  12679. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12680. A_UINT32 msdu_recycled;
  12681. /* Number of MPDUs with invalid peer but A2 found in AST */
  12682. A_UINT32 invalid_peer_a2_in_ast;
  12683. /* Number of MPDUs with invalid peer but A3 found in AST */
  12684. A_UINT32 invalid_peer_a3_in_ast;
  12685. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12686. A_UINT32 invalid_peer_bmc_mpdus;
  12687. /* Number of MSDUs with err attention word */
  12688. A_UINT32 rxdesc_err_att;
  12689. /* Number of MSDUs with flag of peer_idx_invalid */
  12690. A_UINT32 rxdesc_err_peer_idx_inv;
  12691. /* Number of MSDUs with flag of peer_idx_timeout */
  12692. A_UINT32 rxdesc_err_peer_idx_to;
  12693. /* Number of MSDUs with flag of overflow */
  12694. A_UINT32 rxdesc_err_ov;
  12695. /* Number of MSDUs with flag of msdu_length_err */
  12696. A_UINT32 rxdesc_err_msdu_len;
  12697. /* Number of MSDUs with flag of mpdu_length_err */
  12698. A_UINT32 rxdesc_err_mpdu_len;
  12699. /* Number of MSDUs with flag of tkip_mic_err */
  12700. A_UINT32 rxdesc_err_tkip_mic;
  12701. /* Number of MSDUs with flag of decrypt_err */
  12702. A_UINT32 rxdesc_err_decrypt;
  12703. /* Number of MSDUs with flag of fcs_err */
  12704. A_UINT32 rxdesc_err_fcs;
  12705. /* Number of Unicast (bc_mc bit is not set in attention word)
  12706. * frames with invalid peer handler
  12707. */
  12708. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12709. /* Number of unicast frame directly (direct bit is set in attention word)
  12710. * to DUT with invalid peer handler
  12711. */
  12712. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12713. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12714. * frames with invalid peer handler
  12715. */
  12716. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12717. /* Number of MSDUs dropped due to no first MSDU flag */
  12718. A_UINT32 rxdesc_no_1st_msdu;
  12719. /* Number of MSDUs droped due to ring overflow */
  12720. A_UINT32 msdu_drop_ring_ov;
  12721. /* Number of MSDUs dropped due to FC mismatch */
  12722. A_UINT32 msdu_drop_fc_mismatch;
  12723. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12724. A_UINT32 msdu_drop_mgmt_remote_ring;
  12725. /* Number of MSDUs dropped due to errors not reported in attention word */
  12726. A_UINT32 msdu_drop_misc;
  12727. /* Number of MSDUs go to offload before reorder */
  12728. A_UINT32 offload_msdu_wal;
  12729. /* Number of data frame dropped by offload after reorder */
  12730. A_UINT32 offload_msdu_reorder;
  12731. /* Number of MPDUs with sequence number in the past and within the BA window */
  12732. A_UINT32 dup_past_within_window;
  12733. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12734. A_UINT32 dup_past_outside_window;
  12735. /* Number of MSDUs with decrypt/MIC error */
  12736. A_UINT32 rxdesc_err_decrypt_mic;
  12737. /* Number of data MSDUs received on both local and remote rings */
  12738. A_UINT32 data_msdus_on_both_rings;
  12739. /* MPDUs never filled */
  12740. A_UINT32 holes_not_filled;
  12741. };
  12742. /*
  12743. * Rx Remote buffer statistics
  12744. * NB: all the fields must be defined in 4 octets size.
  12745. */
  12746. struct rx_remote_buffer_mgmt_stats {
  12747. /* Total number of MSDUs reaped for Rx processing */
  12748. A_UINT32 remote_reaped;
  12749. /* MSDUs recycled within firmware */
  12750. A_UINT32 remote_recycled;
  12751. /* MSDUs stored by Data Rx */
  12752. A_UINT32 data_rx_msdus_stored;
  12753. /* Number of HTT indications from WAL Rx MSDU */
  12754. A_UINT32 wal_rx_ind;
  12755. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12756. A_UINT32 wal_rx_ind_unconsumed;
  12757. /* Number of HTT indications from Data Rx MSDU */
  12758. A_UINT32 data_rx_ind;
  12759. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12760. A_UINT32 data_rx_ind_unconsumed;
  12761. /* Number of HTT indications from ATHBUF */
  12762. A_UINT32 athbuf_rx_ind;
  12763. /* Number of remote buffers requested for refill */
  12764. A_UINT32 refill_buf_req;
  12765. /* Number of remote buffers filled by the host */
  12766. A_UINT32 refill_buf_rsp;
  12767. /* Number of times MAC hw_index = f/w write_index */
  12768. A_INT32 mac_no_bufs;
  12769. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12770. A_INT32 fw_indices_equal;
  12771. /* Number of times f/w finds no buffers to post */
  12772. A_INT32 host_no_bufs;
  12773. };
  12774. /*
  12775. * TXBF MU/SU packets and NDPA statistics
  12776. * NB: all the fields must be defined in 4 octets size.
  12777. */
  12778. struct rx_txbf_musu_ndpa_pkts_stats {
  12779. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12780. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12781. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12782. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12783. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12784. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12785. };
  12786. /*
  12787. * htt_dbg_stats_status -
  12788. * present - The requested stats have been delivered in full.
  12789. * This indicates that either the stats information was contained
  12790. * in its entirety within this message, or else this message
  12791. * completes the delivery of the requested stats info that was
  12792. * partially delivered through earlier STATS_CONF messages.
  12793. * partial - The requested stats have been delivered in part.
  12794. * One or more subsequent STATS_CONF messages with the same
  12795. * cookie value will be sent to deliver the remainder of the
  12796. * information.
  12797. * error - The requested stats could not be delivered, for example due
  12798. * to a shortage of memory to construct a message holding the
  12799. * requested stats.
  12800. * invalid - The requested stat type is either not recognized, or the
  12801. * target is configured to not gather the stats type in question.
  12802. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12803. * series_done - This special value indicates that no further stats info
  12804. * elements are present within a series of stats info elems
  12805. * (within a stats upload confirmation message).
  12806. */
  12807. enum htt_dbg_stats_status {
  12808. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12809. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12810. HTT_DBG_STATS_STATUS_ERROR = 2,
  12811. HTT_DBG_STATS_STATUS_INVALID = 3,
  12812. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12813. };
  12814. /**
  12815. * @brief target -> host statistics upload
  12816. *
  12817. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12818. *
  12819. * @details
  12820. * The following field definitions describe the format of the HTT target
  12821. * to host stats upload confirmation message.
  12822. * The message contains a cookie echoed from the HTT host->target stats
  12823. * upload request, which identifies which request the confirmation is
  12824. * for, and a series of tag-length-value stats information elements.
  12825. * The tag-length header for each stats info element also includes a
  12826. * status field, to indicate whether the request for the stat type in
  12827. * question was fully met, partially met, unable to be met, or invalid
  12828. * (if the stat type in question is disabled in the target).
  12829. * A special value of all 1's in this status field is used to indicate
  12830. * the end of the series of stats info elements.
  12831. *
  12832. *
  12833. * |31 16|15 8|7 5|4 0|
  12834. * |------------------------------------------------------------|
  12835. * | reserved | msg type |
  12836. * |------------------------------------------------------------|
  12837. * | cookie LSBs |
  12838. * |------------------------------------------------------------|
  12839. * | cookie MSBs |
  12840. * |------------------------------------------------------------|
  12841. * | stats entry length | reserved | S |stat type|
  12842. * |------------------------------------------------------------|
  12843. * | |
  12844. * | type-specific stats info |
  12845. * | |
  12846. * |------------------------------------------------------------|
  12847. * | stats entry length | reserved | S |stat type|
  12848. * |------------------------------------------------------------|
  12849. * | |
  12850. * | type-specific stats info |
  12851. * | |
  12852. * |------------------------------------------------------------|
  12853. * | n/a | reserved | 111 | n/a |
  12854. * |------------------------------------------------------------|
  12855. * Header fields:
  12856. * - MSG_TYPE
  12857. * Bits 7:0
  12858. * Purpose: identifies this is a statistics upload confirmation message
  12859. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12860. * - COOKIE_LSBS
  12861. * Bits 31:0
  12862. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12863. * message with its preceding host->target stats request message.
  12864. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12865. * - COOKIE_MSBS
  12866. * Bits 31:0
  12867. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12868. * message with its preceding host->target stats request message.
  12869. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12870. *
  12871. * Stats Information Element tag-length header fields:
  12872. * - STAT_TYPE
  12873. * Bits 4:0
  12874. * Purpose: identifies the type of statistics info held in the
  12875. * following information element
  12876. * Value: htt_dbg_stats_type
  12877. * - STATUS
  12878. * Bits 7:5
  12879. * Purpose: indicate whether the requested stats are present
  12880. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12881. * the completion of the stats entry series
  12882. * - LENGTH
  12883. * Bits 31:16
  12884. * Purpose: indicate the stats information size
  12885. * Value: This field specifies the number of bytes of stats information
  12886. * that follows the element tag-length header.
  12887. * It is expected but not required that this length is a multiple of
  12888. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12889. * subsequent stats entry header will begin on a 4-byte aligned
  12890. * boundary.
  12891. */
  12892. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12893. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12894. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12895. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12896. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12897. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12898. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12899. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12900. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12901. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12902. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12903. do { \
  12904. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12905. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12906. } while (0)
  12907. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12908. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12909. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12910. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12911. do { \
  12912. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12913. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12914. } while (0)
  12915. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12916. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12917. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12918. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12919. do { \
  12920. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12921. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12922. } while (0)
  12923. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12924. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12925. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12926. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12927. #define HTT_MAX_AGGR 64
  12928. #define HTT_HL_MAX_AGGR 18
  12929. /**
  12930. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12931. *
  12932. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12933. *
  12934. * @details
  12935. * The following field definitions describe the format of the HTT host
  12936. * to target frag_desc/msdu_ext bank configuration message.
  12937. * The message contains the based address and the min and max id of the
  12938. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12939. * MSDU_EXT/FRAG_DESC.
  12940. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12941. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12942. * the hardware does the mapping/translation.
  12943. *
  12944. * Total banks that can be configured is configured to 16.
  12945. *
  12946. * This should be called before any TX has be initiated by the HTT
  12947. *
  12948. * |31 16|15 8|7 5|4 0|
  12949. * |------------------------------------------------------------|
  12950. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12951. * |------------------------------------------------------------|
  12952. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12953. #if HTT_PADDR64
  12954. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12955. #endif
  12956. * |------------------------------------------------------------|
  12957. * | ... |
  12958. * |------------------------------------------------------------|
  12959. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12960. #if HTT_PADDR64
  12961. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12962. #endif
  12963. * |------------------------------------------------------------|
  12964. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12965. * |------------------------------------------------------------|
  12966. * | ... |
  12967. * |------------------------------------------------------------|
  12968. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12969. * |------------------------------------------------------------|
  12970. * Header fields:
  12971. * - MSG_TYPE
  12972. * Bits 7:0
  12973. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12974. * for systems with 64-bit format for bus addresses:
  12975. * - BANKx_BASE_ADDRESS_LO
  12976. * Bits 31:0
  12977. * Purpose: Provide a mechanism to specify the base address of the
  12978. * MSDU_EXT bank physical/bus address.
  12979. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12980. * - BANKx_BASE_ADDRESS_HI
  12981. * Bits 31:0
  12982. * Purpose: Provide a mechanism to specify the base address of the
  12983. * MSDU_EXT bank physical/bus address.
  12984. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12985. * for systems with 32-bit format for bus addresses:
  12986. * - BANKx_BASE_ADDRESS
  12987. * Bits 31:0
  12988. * Purpose: Provide a mechanism to specify the base address of the
  12989. * MSDU_EXT bank physical/bus address.
  12990. * Value: MSDU_EXT bank physical / bus address
  12991. * - BANKx_MIN_ID
  12992. * Bits 15:0
  12993. * Purpose: Provide a mechanism to specify the min index that needs to
  12994. * mapped.
  12995. * - BANKx_MAX_ID
  12996. * Bits 31:16
  12997. * Purpose: Provide a mechanism to specify the max index that needs to
  12998. * mapped.
  12999. *
  13000. */
  13001. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13002. * safe value.
  13003. * @note MAX supported banks is 16.
  13004. */
  13005. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13006. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13007. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13008. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13009. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13010. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13011. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13012. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13013. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13014. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13015. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13016. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13017. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13018. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13019. do { \
  13020. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13021. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13022. } while (0)
  13023. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13024. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13025. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13026. do { \
  13027. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13028. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13029. } while (0)
  13030. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13031. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13032. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13033. do { \
  13034. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13035. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13036. } while (0)
  13037. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13038. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13039. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13040. do { \
  13041. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13042. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13043. } while (0)
  13044. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13045. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13046. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13047. do { \
  13048. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13049. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13050. } while (0)
  13051. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13052. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13053. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13054. do { \
  13055. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13056. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13057. } while (0)
  13058. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13059. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13060. /*
  13061. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13062. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13063. * addresses are stored in a XXX-bit field.
  13064. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13065. * htt_tx_frag_desc64_bank_cfg_t structs.
  13066. */
  13067. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13068. _paddr_bits_, \
  13069. _paddr__bank_base_address_) \
  13070. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13071. /** word 0 \
  13072. * msg_type: 8, \
  13073. * pdev_id: 2, \
  13074. * swap: 1, \
  13075. * reserved0: 5, \
  13076. * num_banks: 8, \
  13077. * desc_size: 8; \
  13078. */ \
  13079. A_UINT32 word0; \
  13080. /* \
  13081. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13082. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13083. * the second A_UINT32). \
  13084. */ \
  13085. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13086. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13087. } POSTPACK
  13088. /* define htt_tx_frag_desc32_bank_cfg_t */
  13089. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13090. /* define htt_tx_frag_desc64_bank_cfg_t */
  13091. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13092. /*
  13093. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13094. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13095. */
  13096. #if HTT_PADDR64
  13097. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13098. #else
  13099. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13100. #endif
  13101. /**
  13102. * @brief target -> host HTT TX Credit total count update message definition
  13103. *
  13104. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13105. *
  13106. *|31 16|15|14 9| 8 |7 0 |
  13107. *|---------------------+--+----------+-------+----------|
  13108. *|cur htt credit delta | Q| reserved | sign | msg type |
  13109. *|------------------------------------------------------|
  13110. *
  13111. * Header fields:
  13112. * - MSG_TYPE
  13113. * Bits 7:0
  13114. * Purpose: identifies this as a htt tx credit delta update message
  13115. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13116. * - SIGN
  13117. * Bits 8
  13118. * identifies whether credit delta is positive or negative
  13119. * Value:
  13120. * - 0x0: credit delta is positive, rebalance in some buffers
  13121. * - 0x1: credit delta is negative, rebalance out some buffers
  13122. * - reserved
  13123. * Bits 14:9
  13124. * Value: 0x0
  13125. * - TXQ_GRP
  13126. * Bit 15
  13127. * Purpose: indicates whether any tx queue group information elements
  13128. * are appended to the tx credit update message
  13129. * Value: 0 -> no tx queue group information element is present
  13130. * 1 -> a tx queue group information element immediately follows
  13131. * - DELTA_COUNT
  13132. * Bits 31:16
  13133. * Purpose: Specify current htt credit delta absolute count
  13134. */
  13135. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13136. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13137. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13138. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13139. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13140. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13141. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13142. do { \
  13143. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13144. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13145. } while (0)
  13146. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13147. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13148. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13149. do { \
  13150. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13151. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13152. } while (0)
  13153. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13154. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13155. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13156. do { \
  13157. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13158. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13159. } while (0)
  13160. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13161. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13162. #define HTT_TX_CREDIT_MSG_BYTES 4
  13163. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13164. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13165. /**
  13166. * @brief HTT WDI_IPA Operation Response Message
  13167. *
  13168. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13169. *
  13170. * @details
  13171. * HTT WDI_IPA Operation Response message is sent by target
  13172. * to host confirming suspend or resume operation.
  13173. * |31 24|23 16|15 8|7 0|
  13174. * |----------------+----------------+----------------+----------------|
  13175. * | op_code | Rsvd | msg_type |
  13176. * |-------------------------------------------------------------------|
  13177. * | Rsvd | Response len |
  13178. * |-------------------------------------------------------------------|
  13179. * | |
  13180. * | Response-type specific info |
  13181. * | |
  13182. * | |
  13183. * |-------------------------------------------------------------------|
  13184. * Header fields:
  13185. * - MSG_TYPE
  13186. * Bits 7:0
  13187. * Purpose: Identifies this as WDI_IPA Operation Response message
  13188. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13189. * - OP_CODE
  13190. * Bits 31:16
  13191. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13192. * value: = enum htt_wdi_ipa_op_code
  13193. * - RSP_LEN
  13194. * Bits 16:0
  13195. * Purpose: length for the response-type specific info
  13196. * value: = length in bytes for response-type specific info
  13197. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13198. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13199. */
  13200. PREPACK struct htt_wdi_ipa_op_response_t
  13201. {
  13202. /* DWORD 0: flags and meta-data */
  13203. A_UINT32
  13204. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13205. reserved1: 8,
  13206. op_code: 16;
  13207. A_UINT32
  13208. rsp_len: 16,
  13209. reserved2: 16;
  13210. } POSTPACK;
  13211. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13212. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13213. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13214. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13215. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13216. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13217. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13218. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13219. do { \
  13220. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13221. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13222. } while (0)
  13223. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13224. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13225. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13226. do { \
  13227. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13228. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13229. } while (0)
  13230. enum htt_phy_mode {
  13231. htt_phy_mode_11a = 0,
  13232. htt_phy_mode_11g = 1,
  13233. htt_phy_mode_11b = 2,
  13234. htt_phy_mode_11g_only = 3,
  13235. htt_phy_mode_11na_ht20 = 4,
  13236. htt_phy_mode_11ng_ht20 = 5,
  13237. htt_phy_mode_11na_ht40 = 6,
  13238. htt_phy_mode_11ng_ht40 = 7,
  13239. htt_phy_mode_11ac_vht20 = 8,
  13240. htt_phy_mode_11ac_vht40 = 9,
  13241. htt_phy_mode_11ac_vht80 = 10,
  13242. htt_phy_mode_11ac_vht20_2g = 11,
  13243. htt_phy_mode_11ac_vht40_2g = 12,
  13244. htt_phy_mode_11ac_vht80_2g = 13,
  13245. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13246. htt_phy_mode_11ac_vht160 = 15,
  13247. htt_phy_mode_max,
  13248. };
  13249. /**
  13250. * @brief target -> host HTT channel change indication
  13251. *
  13252. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13253. *
  13254. * @details
  13255. * Specify when a channel change occurs.
  13256. * This allows the host to precisely determine which rx frames arrived
  13257. * on the old channel and which rx frames arrived on the new channel.
  13258. *
  13259. *|31 |7 0 |
  13260. *|-------------------------------------------+----------|
  13261. *| reserved | msg type |
  13262. *|------------------------------------------------------|
  13263. *| primary_chan_center_freq_mhz |
  13264. *|------------------------------------------------------|
  13265. *| contiguous_chan1_center_freq_mhz |
  13266. *|------------------------------------------------------|
  13267. *| contiguous_chan2_center_freq_mhz |
  13268. *|------------------------------------------------------|
  13269. *| phy_mode |
  13270. *|------------------------------------------------------|
  13271. *
  13272. * Header fields:
  13273. * - MSG_TYPE
  13274. * Bits 7:0
  13275. * Purpose: identifies this as a htt channel change indication message
  13276. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13277. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13278. * Bits 31:0
  13279. * Purpose: identify the (center of the) new 20 MHz primary channel
  13280. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13281. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13282. * Bits 31:0
  13283. * Purpose: identify the (center of the) contiguous frequency range
  13284. * comprising the new channel.
  13285. * For example, if the new channel is a 80 MHz channel extending
  13286. * 60 MHz beyond the primary channel, this field would be 30 larger
  13287. * than the primary channel center frequency field.
  13288. * Value: center frequency of the contiguous frequency range comprising
  13289. * the full channel in MHz units
  13290. * (80+80 channels also use the CONTIG_CHAN2 field)
  13291. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13292. * Bits 31:0
  13293. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13294. * within a VHT 80+80 channel.
  13295. * This field is only relevant for VHT 80+80 channels.
  13296. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13297. * channel (arbitrary value for cases besides VHT 80+80)
  13298. * - PHY_MODE
  13299. * Bits 31:0
  13300. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13301. * and band
  13302. * Value: htt_phy_mode enum value
  13303. */
  13304. PREPACK struct htt_chan_change_t
  13305. {
  13306. /* DWORD 0: flags and meta-data */
  13307. A_UINT32
  13308. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13309. reserved1: 24;
  13310. A_UINT32 primary_chan_center_freq_mhz;
  13311. A_UINT32 contig_chan1_center_freq_mhz;
  13312. A_UINT32 contig_chan2_center_freq_mhz;
  13313. A_UINT32 phy_mode;
  13314. } POSTPACK;
  13315. /*
  13316. * Due to historical / backwards-compatibility reasons, maintain the
  13317. * below htt_chan_change_msg struct definition, which needs to be
  13318. * consistent with the above htt_chan_change_t struct definition
  13319. * (aside from the htt_chan_change_t definition including the msg_type
  13320. * dword within the message, and the htt_chan_change_msg only containing
  13321. * the payload of the message that follows the msg_type dword).
  13322. */
  13323. PREPACK struct htt_chan_change_msg {
  13324. A_UINT32 chan_mhz; /* frequency in mhz */
  13325. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13326. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13327. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13328. } POSTPACK;
  13329. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13330. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13331. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13332. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13333. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13334. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13335. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13336. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13337. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13338. do { \
  13339. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13340. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13341. } while (0)
  13342. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13343. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13344. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13345. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13346. do { \
  13347. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13348. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13349. } while (0)
  13350. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13351. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13352. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13353. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13354. do { \
  13355. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13356. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13357. } while (0)
  13358. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13359. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13360. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13361. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13362. do { \
  13363. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13364. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13365. } while (0)
  13366. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13367. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13368. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13369. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13370. /**
  13371. * @brief rx offload packet error message
  13372. *
  13373. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13374. *
  13375. * @details
  13376. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13377. * of target payload like mic err.
  13378. *
  13379. * |31 24|23 16|15 8|7 0|
  13380. * |----------------+----------------+----------------+----------------|
  13381. * | tid | vdev_id | msg_sub_type | msg_type |
  13382. * |-------------------------------------------------------------------|
  13383. * : (sub-type dependent content) :
  13384. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13385. * Header fields:
  13386. * - msg_type
  13387. * Bits 7:0
  13388. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13389. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13390. * - msg_sub_type
  13391. * Bits 15:8
  13392. * Purpose: Identifies which type of rx error is reported by this message
  13393. * value: htt_rx_ofld_pkt_err_type
  13394. * - vdev_id
  13395. * Bits 23:16
  13396. * Purpose: Identifies which vdev received the erroneous rx frame
  13397. * value:
  13398. * - tid
  13399. * Bits 31:24
  13400. * Purpose: Identifies the traffic type of the rx frame
  13401. * value:
  13402. *
  13403. * - The payload fields used if the sub-type == MIC error are shown below.
  13404. * Note - MIC err is per MSDU, while PN is per MPDU.
  13405. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13406. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13407. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13408. * instead of sending separate HTT messages for each wrong MSDU within
  13409. * the MPDU.
  13410. *
  13411. * |31 24|23 16|15 8|7 0|
  13412. * |----------------+----------------+----------------+----------------|
  13413. * | Rsvd | key_id | peer_id |
  13414. * |-------------------------------------------------------------------|
  13415. * | receiver MAC addr 31:0 |
  13416. * |-------------------------------------------------------------------|
  13417. * | Rsvd | receiver MAC addr 47:32 |
  13418. * |-------------------------------------------------------------------|
  13419. * | transmitter MAC addr 31:0 |
  13420. * |-------------------------------------------------------------------|
  13421. * | Rsvd | transmitter MAC addr 47:32 |
  13422. * |-------------------------------------------------------------------|
  13423. * | PN 31:0 |
  13424. * |-------------------------------------------------------------------|
  13425. * | Rsvd | PN 47:32 |
  13426. * |-------------------------------------------------------------------|
  13427. * - peer_id
  13428. * Bits 15:0
  13429. * Purpose: identifies which peer is frame is from
  13430. * value:
  13431. * - key_id
  13432. * Bits 23:16
  13433. * Purpose: identifies key_id of rx frame
  13434. * value:
  13435. * - RA_31_0 (receiver MAC addr 31:0)
  13436. * Bits 31:0
  13437. * Purpose: identifies by MAC address which vdev received the frame
  13438. * value: MAC address lower 4 bytes
  13439. * - RA_47_32 (receiver MAC addr 47:32)
  13440. * Bits 15:0
  13441. * Purpose: identifies by MAC address which vdev received the frame
  13442. * value: MAC address upper 2 bytes
  13443. * - TA_31_0 (transmitter MAC addr 31:0)
  13444. * Bits 31:0
  13445. * Purpose: identifies by MAC address which peer transmitted the frame
  13446. * value: MAC address lower 4 bytes
  13447. * - TA_47_32 (transmitter MAC addr 47:32)
  13448. * Bits 15:0
  13449. * Purpose: identifies by MAC address which peer transmitted the frame
  13450. * value: MAC address upper 2 bytes
  13451. * - PN_31_0
  13452. * Bits 31:0
  13453. * Purpose: Identifies pn of rx frame
  13454. * value: PN lower 4 bytes
  13455. * - PN_47_32
  13456. * Bits 15:0
  13457. * Purpose: Identifies pn of rx frame
  13458. * value:
  13459. * TKIP or CCMP: PN upper 2 bytes
  13460. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13461. */
  13462. enum htt_rx_ofld_pkt_err_type {
  13463. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13464. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13465. };
  13466. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13467. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13468. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13469. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13470. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13471. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13472. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13473. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13474. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13475. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13476. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13477. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13478. do { \
  13479. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13480. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13481. } while (0)
  13482. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13483. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13484. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13485. do { \
  13486. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13487. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13488. } while (0)
  13489. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13490. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13491. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13492. do { \
  13493. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13494. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13495. } while (0)
  13496. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13497. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13498. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13499. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13500. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13501. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13502. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13504. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13505. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13506. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13507. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13509. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13510. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13512. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13513. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13514. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13515. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13516. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13517. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13518. do { \
  13519. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13520. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13521. } while (0)
  13522. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13523. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13524. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13525. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13526. do { \
  13527. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13528. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13529. } while (0)
  13530. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13531. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13532. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13533. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13534. do { \
  13535. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13536. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13537. } while (0)
  13538. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13539. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13540. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13541. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13542. do { \
  13543. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13544. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13545. } while (0)
  13546. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13547. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13548. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13549. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13550. do { \
  13551. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13552. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13553. } while (0)
  13554. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13555. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13556. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13557. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13558. do { \
  13559. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13560. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13561. } while (0)
  13562. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13563. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13564. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13565. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13566. do { \
  13567. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13568. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13569. } while (0)
  13570. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13571. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13572. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13573. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13574. do { \
  13575. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13576. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13577. } while (0)
  13578. /**
  13579. * @brief target -> host peer rate report message
  13580. *
  13581. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13582. *
  13583. * @details
  13584. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13585. * justified rate of all the peers.
  13586. *
  13587. * |31 24|23 16|15 8|7 0|
  13588. * |----------------+----------------+----------------+----------------|
  13589. * | peer_count | | msg_type |
  13590. * |-------------------------------------------------------------------|
  13591. * : Payload (variant number of peer rate report) :
  13592. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13593. * Header fields:
  13594. * - msg_type
  13595. * Bits 7:0
  13596. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13597. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13598. * - reserved
  13599. * Bits 15:8
  13600. * Purpose:
  13601. * value:
  13602. * - peer_count
  13603. * Bits 31:16
  13604. * Purpose: Specify how many peer rate report elements are present in the payload.
  13605. * value:
  13606. *
  13607. * Payload:
  13608. * There are variant number of peer rate report follow the first 32 bits.
  13609. * The peer rate report is defined as follows.
  13610. *
  13611. * |31 20|19 16|15 0|
  13612. * |-----------------------+---------+---------------------------------|-
  13613. * | reserved | phy | peer_id | \
  13614. * |-------------------------------------------------------------------| -> report #0
  13615. * | rate | /
  13616. * |-----------------------+---------+---------------------------------|-
  13617. * | reserved | phy | peer_id | \
  13618. * |-------------------------------------------------------------------| -> report #1
  13619. * | rate | /
  13620. * |-----------------------+---------+---------------------------------|-
  13621. * | reserved | phy | peer_id | \
  13622. * |-------------------------------------------------------------------| -> report #2
  13623. * | rate | /
  13624. * |-------------------------------------------------------------------|-
  13625. * : :
  13626. * : :
  13627. * : :
  13628. * :-------------------------------------------------------------------:
  13629. *
  13630. * - peer_id
  13631. * Bits 15:0
  13632. * Purpose: identify the peer
  13633. * value:
  13634. * - phy
  13635. * Bits 19:16
  13636. * Purpose: identify which phy is in use
  13637. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13638. * Please see enum htt_peer_report_phy_type for detail.
  13639. * - reserved
  13640. * Bits 31:20
  13641. * Purpose:
  13642. * value:
  13643. * - rate
  13644. * Bits 31:0
  13645. * Purpose: represent the justified rate of the peer specified by peer_id
  13646. * value:
  13647. */
  13648. enum htt_peer_rate_report_phy_type {
  13649. HTT_PEER_RATE_REPORT_11B = 0,
  13650. HTT_PEER_RATE_REPORT_11A_G,
  13651. HTT_PEER_RATE_REPORT_11N,
  13652. HTT_PEER_RATE_REPORT_11AC,
  13653. };
  13654. #define HTT_PEER_RATE_REPORT_SIZE 8
  13655. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13656. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13657. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13658. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13659. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13660. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13661. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13662. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13663. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13664. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13665. do { \
  13666. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13667. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13668. } while (0)
  13669. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13670. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13671. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13672. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13673. do { \
  13674. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13675. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13676. } while (0)
  13677. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13678. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13679. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13680. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13681. do { \
  13682. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13683. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13684. } while (0)
  13685. /**
  13686. * @brief target -> host flow pool map message
  13687. *
  13688. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13689. *
  13690. * @details
  13691. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13692. * a flow of descriptors.
  13693. *
  13694. * This message is in TLV format and indicates the parameters to be setup a
  13695. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13696. * receive descriptors from a specified pool.
  13697. *
  13698. * The message would appear as follows:
  13699. *
  13700. * |31 24|23 16|15 8|7 0|
  13701. * |----------------+----------------+----------------+----------------|
  13702. * header | reserved | num_flows | msg_type |
  13703. * |-------------------------------------------------------------------|
  13704. * | |
  13705. * : payload :
  13706. * | |
  13707. * |-------------------------------------------------------------------|
  13708. *
  13709. * The header field is one DWORD long and is interpreted as follows:
  13710. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13711. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13712. * this message
  13713. * b'16-31 - reserved: These bits are reserved for future use
  13714. *
  13715. * Payload:
  13716. * The payload would contain multiple objects of the following structure. Each
  13717. * object represents a flow.
  13718. *
  13719. * |31 24|23 16|15 8|7 0|
  13720. * |----------------+----------------+----------------+----------------|
  13721. * header | reserved | num_flows | msg_type |
  13722. * |-------------------------------------------------------------------|
  13723. * payload0| flow_type |
  13724. * |-------------------------------------------------------------------|
  13725. * | flow_id |
  13726. * |-------------------------------------------------------------------|
  13727. * | reserved0 | flow_pool_id |
  13728. * |-------------------------------------------------------------------|
  13729. * | reserved1 | flow_pool_size |
  13730. * |-------------------------------------------------------------------|
  13731. * | reserved2 |
  13732. * |-------------------------------------------------------------------|
  13733. * payload1| flow_type |
  13734. * |-------------------------------------------------------------------|
  13735. * | flow_id |
  13736. * |-------------------------------------------------------------------|
  13737. * | reserved0 | flow_pool_id |
  13738. * |-------------------------------------------------------------------|
  13739. * | reserved1 | flow_pool_size |
  13740. * |-------------------------------------------------------------------|
  13741. * | reserved2 |
  13742. * |-------------------------------------------------------------------|
  13743. * | . |
  13744. * | . |
  13745. * | . |
  13746. * |-------------------------------------------------------------------|
  13747. *
  13748. * Each payload is 5 DWORDS long and is interpreted as follows:
  13749. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13750. * this flow is associated. It can be VDEV, peer,
  13751. * or tid (AC). Based on enum htt_flow_type.
  13752. *
  13753. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13754. * object. For flow_type vdev it is set to the
  13755. * vdevid, for peer it is peerid and for tid, it is
  13756. * tid_num.
  13757. *
  13758. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13759. * in the host for this flow
  13760. * b'16:31 - reserved0: This field in reserved for the future. In case
  13761. * we have a hierarchical implementation (HCM) of
  13762. * pools, it can be used to indicate the ID of the
  13763. * parent-pool.
  13764. *
  13765. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13766. * Descriptors for this flow will be
  13767. * allocated from this pool in the host.
  13768. * b'16:31 - reserved1: This field in reserved for the future. In case
  13769. * we have a hierarchical implementation of pools,
  13770. * it can be used to indicate the max number of
  13771. * descriptors in the pool. The b'0:15 can be used
  13772. * to indicate min number of descriptors in the
  13773. * HCM scheme.
  13774. *
  13775. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13776. * we have a hierarchical implementation of pools,
  13777. * b'0:15 can be used to indicate the
  13778. * priority-based borrowing (PBB) threshold of
  13779. * the flow's pool. The b'16:31 are still left
  13780. * reserved.
  13781. */
  13782. enum htt_flow_type {
  13783. FLOW_TYPE_VDEV = 0,
  13784. /* Insert new flow types above this line */
  13785. };
  13786. PREPACK struct htt_flow_pool_map_payload_t {
  13787. A_UINT32 flow_type;
  13788. A_UINT32 flow_id;
  13789. A_UINT32 flow_pool_id:16,
  13790. reserved0:16;
  13791. A_UINT32 flow_pool_size:16,
  13792. reserved1:16;
  13793. A_UINT32 reserved2;
  13794. } POSTPACK;
  13795. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13796. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13797. (sizeof(struct htt_flow_pool_map_payload_t))
  13798. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13799. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13800. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13801. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13802. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13803. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13804. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13805. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13806. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13807. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13808. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13809. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13810. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13811. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13812. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13813. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13814. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13815. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13816. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13817. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13818. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13819. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13820. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13821. do { \
  13822. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13823. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13824. } while (0)
  13825. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13826. do { \
  13827. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13828. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13829. } while (0)
  13830. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13831. do { \
  13832. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13833. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13834. } while (0)
  13835. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13836. do { \
  13837. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13838. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13839. } while (0)
  13840. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13841. do { \
  13842. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13843. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13844. } while (0)
  13845. /**
  13846. * @brief target -> host flow pool unmap message
  13847. *
  13848. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13849. *
  13850. * @details
  13851. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13852. * down a flow of descriptors.
  13853. * This message indicates that for the flow (whose ID is provided) is wanting
  13854. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13855. * pool of descriptors from where descriptors are being allocated for this
  13856. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13857. * be unmapped by the host.
  13858. *
  13859. * The message would appear as follows:
  13860. *
  13861. * |31 24|23 16|15 8|7 0|
  13862. * |----------------+----------------+----------------+----------------|
  13863. * | reserved0 | msg_type |
  13864. * |-------------------------------------------------------------------|
  13865. * | flow_type |
  13866. * |-------------------------------------------------------------------|
  13867. * | flow_id |
  13868. * |-------------------------------------------------------------------|
  13869. * | reserved1 | flow_pool_id |
  13870. * |-------------------------------------------------------------------|
  13871. *
  13872. * The message is interpreted as follows:
  13873. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13874. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13875. * b'8:31 - reserved0: Reserved for future use
  13876. *
  13877. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13878. * this flow is associated. It can be VDEV, peer,
  13879. * or tid (AC). Based on enum htt_flow_type.
  13880. *
  13881. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13882. * object. For flow_type vdev it is set to the
  13883. * vdevid, for peer it is peerid and for tid, it is
  13884. * tid_num.
  13885. *
  13886. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13887. * used in the host for this flow
  13888. * b'16:31 - reserved0: This field in reserved for the future.
  13889. *
  13890. */
  13891. PREPACK struct htt_flow_pool_unmap_t {
  13892. A_UINT32 msg_type:8,
  13893. reserved0:24;
  13894. A_UINT32 flow_type;
  13895. A_UINT32 flow_id;
  13896. A_UINT32 flow_pool_id:16,
  13897. reserved1:16;
  13898. } POSTPACK;
  13899. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13900. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13901. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13902. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13903. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13904. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13905. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13906. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13907. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13908. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13909. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13910. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13911. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13912. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13913. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13914. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13915. do { \
  13916. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13917. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13918. } while (0)
  13919. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13920. do { \
  13921. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13922. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13923. } while (0)
  13924. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13925. do { \
  13926. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13927. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13928. } while (0)
  13929. /**
  13930. * @brief target -> host SRING setup done message
  13931. *
  13932. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13933. *
  13934. * @details
  13935. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13936. * SRNG ring setup is done
  13937. *
  13938. * This message indicates whether the last setup operation is successful.
  13939. * It will be sent to host when host set respose_required bit in
  13940. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13941. * The message would appear as follows:
  13942. *
  13943. * |31 24|23 16|15 8|7 0|
  13944. * |--------------- +----------------+----------------+----------------|
  13945. * | setup_status | ring_id | pdev_id | msg_type |
  13946. * |-------------------------------------------------------------------|
  13947. *
  13948. * The message is interpreted as follows:
  13949. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13950. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13951. * b'8:15 - pdev_id:
  13952. * 0 (for rings at SOC/UMAC level),
  13953. * 1/2/3 mac id (for rings at LMAC level)
  13954. * b'16:23 - ring_id: Identify the ring which is set up
  13955. * More details can be got from enum htt_srng_ring_id
  13956. * b'24:31 - setup_status: Indicate status of setup operation
  13957. * Refer to htt_ring_setup_status
  13958. */
  13959. PREPACK struct htt_sring_setup_done_t {
  13960. A_UINT32 msg_type: 8,
  13961. pdev_id: 8,
  13962. ring_id: 8,
  13963. setup_status: 8;
  13964. } POSTPACK;
  13965. enum htt_ring_setup_status {
  13966. htt_ring_setup_status_ok = 0,
  13967. htt_ring_setup_status_error,
  13968. };
  13969. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13970. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13971. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13972. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13973. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13974. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13975. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13976. do { \
  13977. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13978. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13979. } while (0)
  13980. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13981. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13982. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13983. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13984. HTT_SRING_SETUP_DONE_RING_ID_S)
  13985. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13986. do { \
  13987. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13988. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13989. } while (0)
  13990. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13991. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13992. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13993. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13994. HTT_SRING_SETUP_DONE_STATUS_S)
  13995. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13996. do { \
  13997. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13998. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13999. } while (0)
  14000. /**
  14001. * @brief target -> flow map flow info
  14002. *
  14003. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14004. *
  14005. * @details
  14006. * HTT TX map flow entry with tqm flow pointer
  14007. * Sent from firmware to host to add tqm flow pointer in corresponding
  14008. * flow search entry. Flow metadata is replayed back to host as part of this
  14009. * struct to enable host to find the specific flow search entry
  14010. *
  14011. * The message would appear as follows:
  14012. *
  14013. * |31 28|27 18|17 14|13 8|7 0|
  14014. * |-------+------------------------------------------+----------------|
  14015. * | rsvd0 | fse_hsh_idx | msg_type |
  14016. * |-------------------------------------------------------------------|
  14017. * | rsvd1 | tid | peer_id |
  14018. * |-------------------------------------------------------------------|
  14019. * | tqm_flow_pntr_lo |
  14020. * |-------------------------------------------------------------------|
  14021. * | tqm_flow_pntr_hi |
  14022. * |-------------------------------------------------------------------|
  14023. * | fse_meta_data |
  14024. * |-------------------------------------------------------------------|
  14025. *
  14026. * The message is interpreted as follows:
  14027. *
  14028. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14029. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14030. *
  14031. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14032. * for this flow entry
  14033. *
  14034. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14035. *
  14036. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14037. *
  14038. * dword1 - b'14:17 - tid
  14039. *
  14040. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14041. *
  14042. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14043. *
  14044. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14045. *
  14046. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14047. * given by host
  14048. */
  14049. PREPACK struct htt_tx_map_flow_info {
  14050. A_UINT32
  14051. msg_type: 8,
  14052. fse_hsh_idx: 20,
  14053. rsvd0: 4;
  14054. A_UINT32
  14055. peer_id: 14,
  14056. tid: 4,
  14057. rsvd1: 14;
  14058. A_UINT32 tqm_flow_pntr_lo;
  14059. A_UINT32 tqm_flow_pntr_hi;
  14060. struct htt_tx_flow_metadata fse_meta_data;
  14061. } POSTPACK;
  14062. /* DWORD 0 */
  14063. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14064. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14065. /* DWORD 1 */
  14066. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14067. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14068. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14069. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14070. /* DWORD 0 */
  14071. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14072. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14073. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14074. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14075. do { \
  14076. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14077. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14078. } while (0)
  14079. /* DWORD 1 */
  14080. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14081. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14082. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14083. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14084. do { \
  14085. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14086. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14087. } while (0)
  14088. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14089. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14090. HTT_TX_MAP_FLOW_INFO_TID_S)
  14091. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14092. do { \
  14093. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14094. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14095. } while (0)
  14096. /*
  14097. * htt_dbg_ext_stats_status -
  14098. * present - The requested stats have been delivered in full.
  14099. * This indicates that either the stats information was contained
  14100. * in its entirety within this message, or else this message
  14101. * completes the delivery of the requested stats info that was
  14102. * partially delivered through earlier STATS_CONF messages.
  14103. * partial - The requested stats have been delivered in part.
  14104. * One or more subsequent STATS_CONF messages with the same
  14105. * cookie value will be sent to deliver the remainder of the
  14106. * information.
  14107. * error - The requested stats could not be delivered, for example due
  14108. * to a shortage of memory to construct a message holding the
  14109. * requested stats.
  14110. * invalid - The requested stat type is either not recognized, or the
  14111. * target is configured to not gather the stats type in question.
  14112. */
  14113. enum htt_dbg_ext_stats_status {
  14114. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14115. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14116. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14117. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14118. };
  14119. /**
  14120. * @brief target -> host ppdu stats upload
  14121. *
  14122. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14123. *
  14124. * @details
  14125. * The following field definitions describe the format of the HTT target
  14126. * to host ppdu stats indication message.
  14127. *
  14128. *
  14129. * |31 16|15 12|11 10|9 8|7 0 |
  14130. * |----------------------------------------------------------------------|
  14131. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14132. * |----------------------------------------------------------------------|
  14133. * | ppdu_id |
  14134. * |----------------------------------------------------------------------|
  14135. * | Timestamp in us |
  14136. * |----------------------------------------------------------------------|
  14137. * | reserved |
  14138. * |----------------------------------------------------------------------|
  14139. * | type-specific stats info |
  14140. * | (see htt_ppdu_stats.h) |
  14141. * |----------------------------------------------------------------------|
  14142. * Header fields:
  14143. * - MSG_TYPE
  14144. * Bits 7:0
  14145. * Purpose: Identifies this is a PPDU STATS indication
  14146. * message.
  14147. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14148. * - mac_id
  14149. * Bits 9:8
  14150. * Purpose: mac_id of this ppdu_id
  14151. * Value: 0-3
  14152. * - pdev_id
  14153. * Bits 11:10
  14154. * Purpose: pdev_id of this ppdu_id
  14155. * Value: 0-3
  14156. * 0 (for rings at SOC level),
  14157. * 1/2/3 PDEV -> 0/1/2
  14158. * - payload_size
  14159. * Bits 31:16
  14160. * Purpose: total tlv size
  14161. * Value: payload_size in bytes
  14162. */
  14163. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14164. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14165. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14166. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14167. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14168. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14169. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14170. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14171. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14172. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14173. do { \
  14174. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14175. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14176. } while (0)
  14177. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14178. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14179. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14180. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14181. do { \
  14182. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14183. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14184. } while (0)
  14185. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14186. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14187. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14188. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14189. do { \
  14190. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14191. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14192. } while (0)
  14193. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14194. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14195. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14196. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14197. do { \
  14198. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14199. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14200. } while (0)
  14201. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14202. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14203. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14204. /* htt_t2h_ppdu_stats_ind_hdr_t
  14205. * This struct contains the fields within the header of the
  14206. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14207. * stats info.
  14208. * This struct assumes little-endian layout, and thus is only
  14209. * suitable for use within processors known to be little-endian
  14210. * (such as the target).
  14211. * In contrast, the above macros provide endian-portable methods
  14212. * to get and set the bitfields within this PPDU_STATS_IND header.
  14213. */
  14214. typedef struct {
  14215. A_UINT32 msg_type: 8, /* bits 7:0 */
  14216. mac_id: 2, /* bits 9:8 */
  14217. pdev_id: 2, /* bits 11:10 */
  14218. reserved1: 4, /* bits 15:12 */
  14219. payload_size: 16; /* bits 31:16 */
  14220. A_UINT32 ppdu_id;
  14221. A_UINT32 timestamp_us;
  14222. A_UINT32 reserved2;
  14223. } htt_t2h_ppdu_stats_ind_hdr_t;
  14224. /**
  14225. * @brief target -> host extended statistics upload
  14226. *
  14227. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14228. *
  14229. * @details
  14230. * The following field definitions describe the format of the HTT target
  14231. * to host stats upload confirmation message.
  14232. * The message contains a cookie echoed from the HTT host->target stats
  14233. * upload request, which identifies which request the confirmation is
  14234. * for, and a single stats can span over multiple HTT stats indication
  14235. * due to the HTT message size limitation so every HTT ext stats indication
  14236. * will have tag-length-value stats information elements.
  14237. * The tag-length header for each HTT stats IND message also includes a
  14238. * status field, to indicate whether the request for the stat type in
  14239. * question was fully met, partially met, unable to be met, or invalid
  14240. * (if the stat type in question is disabled in the target).
  14241. * A Done bit 1's indicate the end of the of stats info elements.
  14242. *
  14243. *
  14244. * |31 16|15 12|11|10 8|7 5|4 0|
  14245. * |--------------------------------------------------------------|
  14246. * | reserved | msg type |
  14247. * |--------------------------------------------------------------|
  14248. * | cookie LSBs |
  14249. * |--------------------------------------------------------------|
  14250. * | cookie MSBs |
  14251. * |--------------------------------------------------------------|
  14252. * | stats entry length | rsvd | D| S | stat type |
  14253. * |--------------------------------------------------------------|
  14254. * | type-specific stats info |
  14255. * | (see htt_stats.h) |
  14256. * |--------------------------------------------------------------|
  14257. * Header fields:
  14258. * - MSG_TYPE
  14259. * Bits 7:0
  14260. * Purpose: Identifies this is a extended statistics upload confirmation
  14261. * message.
  14262. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14263. * - COOKIE_LSBS
  14264. * Bits 31:0
  14265. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14266. * message with its preceding host->target stats request message.
  14267. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14268. * - COOKIE_MSBS
  14269. * Bits 31:0
  14270. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14271. * message with its preceding host->target stats request message.
  14272. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14273. *
  14274. * Stats Information Element tag-length header fields:
  14275. * - STAT_TYPE
  14276. * Bits 7:0
  14277. * Purpose: identifies the type of statistics info held in the
  14278. * following information element
  14279. * Value: htt_dbg_ext_stats_type
  14280. * - STATUS
  14281. * Bits 10:8
  14282. * Purpose: indicate whether the requested stats are present
  14283. * Value: htt_dbg_ext_stats_status
  14284. * - DONE
  14285. * Bits 11
  14286. * Purpose:
  14287. * Indicates the completion of the stats entry, this will be the last
  14288. * stats conf HTT segment for the requested stats type.
  14289. * Value:
  14290. * 0 -> the stats retrieval is ongoing
  14291. * 1 -> the stats retrieval is complete
  14292. * - LENGTH
  14293. * Bits 31:16
  14294. * Purpose: indicate the stats information size
  14295. * Value: This field specifies the number of bytes of stats information
  14296. * that follows the element tag-length header.
  14297. * It is expected but not required that this length is a multiple of
  14298. * 4 bytes.
  14299. */
  14300. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14301. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14302. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14303. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14304. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14305. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14306. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14307. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14308. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14309. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14310. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14311. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14312. do { \
  14313. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14314. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14315. } while (0)
  14316. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14317. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14318. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14319. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14320. do { \
  14321. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14322. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14323. } while (0)
  14324. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14325. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14326. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14327. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14328. do { \
  14329. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14330. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14331. } while (0)
  14332. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14333. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14334. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14335. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14336. do { \
  14337. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14338. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14339. } while (0)
  14340. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14341. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14342. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14343. typedef enum {
  14344. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14345. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14346. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14347. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14348. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14349. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14350. /* Reserved from 128 - 255 for target internal use.*/
  14351. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14352. } HTT_PEER_TYPE;
  14353. /** macro to convert MAC address from char array to HTT word format */
  14354. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14355. (phtt_mac_addr)->mac_addr31to0 = \
  14356. (((c_macaddr)[0] << 0) | \
  14357. ((c_macaddr)[1] << 8) | \
  14358. ((c_macaddr)[2] << 16) | \
  14359. ((c_macaddr)[3] << 24)); \
  14360. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14361. } while (0)
  14362. /**
  14363. * @brief target -> host monitor mac header indication message
  14364. *
  14365. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14366. *
  14367. * @details
  14368. * The following diagram shows the format of the monitor mac header message
  14369. * sent from the target to the host.
  14370. * This message is primarily sent when promiscuous rx mode is enabled.
  14371. * One message is sent per rx PPDU.
  14372. *
  14373. * |31 24|23 16|15 8|7 0|
  14374. * |-------------------------------------------------------------|
  14375. * | peer_id | reserved0 | msg_type |
  14376. * |-------------------------------------------------------------|
  14377. * | reserved1 | num_mpdu |
  14378. * |-------------------------------------------------------------|
  14379. * | struct hw_rx_desc |
  14380. * | (see wal_rx_desc.h) |
  14381. * |-------------------------------------------------------------|
  14382. * | struct ieee80211_frame_addr4 |
  14383. * | (see ieee80211_defs.h) |
  14384. * |-------------------------------------------------------------|
  14385. * | struct ieee80211_frame_addr4 |
  14386. * | (see ieee80211_defs.h) |
  14387. * |-------------------------------------------------------------|
  14388. * | ...... |
  14389. * |-------------------------------------------------------------|
  14390. *
  14391. * Header fields:
  14392. * - msg_type
  14393. * Bits 7:0
  14394. * Purpose: Identifies this is a monitor mac header indication message.
  14395. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14396. * - peer_id
  14397. * Bits 31:16
  14398. * Purpose: Software peer id given by host during association,
  14399. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14400. * for rx PPDUs received from unassociated peers.
  14401. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14402. * - num_mpdu
  14403. * Bits 15:0
  14404. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14405. * delivered within the message.
  14406. * Value: 1 to 32
  14407. * num_mpdu is limited to a maximum value of 32, due to buffer
  14408. * size limits. For PPDUs with more than 32 MPDUs, only the
  14409. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14410. * the PPDU will be provided.
  14411. */
  14412. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14413. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14414. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14415. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14416. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14417. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14418. do { \
  14419. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14420. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14421. } while (0)
  14422. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14423. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14424. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14425. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14426. do { \
  14427. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14428. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14429. } while (0)
  14430. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14431. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14432. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14433. /**
  14434. * @brief target -> host flow pool resize Message
  14435. *
  14436. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14437. *
  14438. * @details
  14439. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14440. * the flow pool associated with the specified ID is resized
  14441. *
  14442. * The message would appear as follows:
  14443. *
  14444. * |31 16|15 8|7 0|
  14445. * |---------------------------------+----------------+----------------|
  14446. * | reserved0 | Msg type |
  14447. * |-------------------------------------------------------------------|
  14448. * | flow pool new size | flow pool ID |
  14449. * |-------------------------------------------------------------------|
  14450. *
  14451. * The message is interpreted as follows:
  14452. * b'0:7 - msg_type: This will be set to 0x21
  14453. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14454. *
  14455. * b'0:15 - flow pool ID: Existing flow pool ID
  14456. *
  14457. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14458. *
  14459. */
  14460. PREPACK struct htt_flow_pool_resize_t {
  14461. A_UINT32 msg_type:8,
  14462. reserved0:24;
  14463. A_UINT32 flow_pool_id:16,
  14464. flow_pool_new_size:16;
  14465. } POSTPACK;
  14466. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14467. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14468. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14469. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14470. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14471. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14472. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14473. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14474. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14475. do { \
  14476. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14477. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14478. } while (0)
  14479. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14480. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14481. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14482. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14483. do { \
  14484. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14485. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14486. } while (0)
  14487. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14488. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14489. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14490. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14491. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14492. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14493. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14494. /*
  14495. * The read and write indices point to the data within the host buffer.
  14496. * Because the first 4 bytes of the host buffer is used for the read index and
  14497. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14498. * The read index and write index are the byte offsets from the base of the
  14499. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14500. * Refer the ASCII text picture below.
  14501. */
  14502. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14503. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14504. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14505. /*
  14506. ***************************************************************************
  14507. *
  14508. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14509. *
  14510. ***************************************************************************
  14511. *
  14512. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14513. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14514. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14515. * written into the Host memory region mentioned below.
  14516. *
  14517. * Read index is updated by the Host. At any point of time, the read index will
  14518. * indicate the index that will next be read by the Host. The read index is
  14519. * in units of bytes offset from the base of the meta-data buffer.
  14520. *
  14521. * Write index is updated by the FW. At any point of time, the write index will
  14522. * indicate from where the FW can start writing any new data. The write index is
  14523. * in units of bytes offset from the base of the meta-data buffer.
  14524. *
  14525. * If the Host is not fast enough in reading the CFR data, any new capture data
  14526. * would be dropped if there is no space left to write the new captures.
  14527. *
  14528. * The last 4 bytes of the memory region will have the magic pattern
  14529. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14530. * not overrun the host buffer.
  14531. *
  14532. * ,--------------------. read and write indices store the
  14533. * | | byte offset from the base of the
  14534. * | ,--------+--------. meta-data buffer to the next
  14535. * | | | | location within the data buffer
  14536. * | | v v that will be read / written
  14537. * ************************************************************************
  14538. * * Read * Write * * Magic *
  14539. * * index * index * CFR data1 ...... CFR data N * pattern *
  14540. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14541. * ************************************************************************
  14542. * |<---------- data buffer ---------->|
  14543. *
  14544. * |<----------------- meta-data buffer allocated in Host ----------------|
  14545. *
  14546. * Note:
  14547. * - Considering the 4 bytes needed to store the Read index (R) and the
  14548. * Write index (W), the initial value is as follows:
  14549. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14550. * - Buffer empty condition:
  14551. * R = W
  14552. *
  14553. * Regarding CFR data format:
  14554. * --------------------------
  14555. *
  14556. * Each CFR tone is stored in HW as 16-bits with the following format:
  14557. * {bits[15:12], bits[11:6], bits[5:0]} =
  14558. * {unsigned exponent (4 bits),
  14559. * signed mantissa_real (6 bits),
  14560. * signed mantissa_imag (6 bits)}
  14561. *
  14562. * CFR_real = mantissa_real * 2^(exponent-5)
  14563. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14564. *
  14565. *
  14566. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14567. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14568. *
  14569. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14570. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14571. * .
  14572. * .
  14573. * .
  14574. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14575. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14576. */
  14577. /* Bandwidth of peer CFR captures */
  14578. typedef enum {
  14579. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14580. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14581. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14582. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14583. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14584. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14585. } HTT_PEER_CFR_CAPTURE_BW;
  14586. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14587. * was captured
  14588. */
  14589. typedef enum {
  14590. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14591. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14592. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14593. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14594. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14595. } HTT_PEER_CFR_CAPTURE_MODE;
  14596. typedef enum {
  14597. /* This message type is currently used for the below purpose:
  14598. *
  14599. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14600. * wmi_peer_cfr_capture_cmd.
  14601. * If payload_present bit is set to 0 then the associated memory region
  14602. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14603. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14604. * message; the CFR dump will be present at the end of the message,
  14605. * after the chan_phy_mode.
  14606. */
  14607. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14608. /* Always keep this last */
  14609. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14610. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14611. /**
  14612. * @brief target -> host CFR dump completion indication message definition
  14613. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14614. *
  14615. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14616. *
  14617. * @details
  14618. * The following diagram shows the format of the Channel Frequency Response
  14619. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14620. * the channel capture of a peer is copied by Firmware into the Host memory
  14621. *
  14622. * **************************************************************************
  14623. *
  14624. * Message format when the CFR capture message type is
  14625. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14626. *
  14627. * **************************************************************************
  14628. *
  14629. * |31 16|15 |8|7 0|
  14630. * |----------------------------------------------------------------|
  14631. * header: | reserved |P| msg_type |
  14632. * word 0 | | | |
  14633. * |----------------------------------------------------------------|
  14634. * payload: | cfr_capture_msg_type |
  14635. * word 1 | |
  14636. * |----------------------------------------------------------------|
  14637. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14638. * word 2 | | | | | | | | |
  14639. * |----------------------------------------------------------------|
  14640. * | mac_addr31to0 |
  14641. * word 3 | |
  14642. * |----------------------------------------------------------------|
  14643. * | unused / reserved | mac_addr47to32 |
  14644. * word 4 | | |
  14645. * |----------------------------------------------------------------|
  14646. * | index |
  14647. * word 5 | |
  14648. * |----------------------------------------------------------------|
  14649. * | length |
  14650. * word 6 | |
  14651. * |----------------------------------------------------------------|
  14652. * | timestamp |
  14653. * word 7 | |
  14654. * |----------------------------------------------------------------|
  14655. * | counter |
  14656. * word 8 | |
  14657. * |----------------------------------------------------------------|
  14658. * | chan_mhz |
  14659. * word 9 | |
  14660. * |----------------------------------------------------------------|
  14661. * | band_center_freq1 |
  14662. * word 10 | |
  14663. * |----------------------------------------------------------------|
  14664. * | band_center_freq2 |
  14665. * word 11 | |
  14666. * |----------------------------------------------------------------|
  14667. * | chan_phy_mode |
  14668. * word 12 | |
  14669. * |----------------------------------------------------------------|
  14670. * where,
  14671. * P - payload present bit (payload_present explained below)
  14672. * req_id - memory request id (mem_req_id explained below)
  14673. * S - status field (status explained below)
  14674. * capbw - capture bandwidth (capture_bw explained below)
  14675. * mode - mode of capture (mode explained below)
  14676. * sts - space time streams (sts_count explained below)
  14677. * chbw - channel bandwidth (channel_bw explained below)
  14678. * captype - capture type (cap_type explained below)
  14679. *
  14680. * The following field definitions describe the format of the CFR dump
  14681. * completion indication sent from the target to the host
  14682. *
  14683. * Header fields:
  14684. *
  14685. * Word 0
  14686. * - msg_type
  14687. * Bits 7:0
  14688. * Purpose: Identifies this as CFR TX completion indication
  14689. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14690. * - payload_present
  14691. * Bit 8
  14692. * Purpose: Identifies how CFR data is sent to host
  14693. * Value: 0 - If CFR Payload is written to host memory
  14694. * 1 - If CFR Payload is sent as part of HTT message
  14695. * (This is the requirement for SDIO/USB where it is
  14696. * not possible to write CFR data to host memory)
  14697. * - reserved
  14698. * Bits 31:9
  14699. * Purpose: Reserved
  14700. * Value: 0
  14701. *
  14702. * Payload fields:
  14703. *
  14704. * Word 1
  14705. * - cfr_capture_msg_type
  14706. * Bits 31:0
  14707. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14708. * to specify the format used for the remainder of the message
  14709. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14710. * (currently only MSG_TYPE_1 is defined)
  14711. *
  14712. * Word 2
  14713. * - mem_req_id
  14714. * Bits 6:0
  14715. * Purpose: Contain the mem request id of the region where the CFR capture
  14716. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14717. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14718. this value is invalid)
  14719. * - status
  14720. * Bit 7
  14721. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14722. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14723. * - capture_bw
  14724. * Bits 10:8
  14725. * Purpose: Carry the bandwidth of the CFR capture
  14726. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14727. * - mode
  14728. * Bits 13:11
  14729. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14730. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14731. * - sts_count
  14732. * Bits 16:14
  14733. * Purpose: Carry the number of space time streams
  14734. * Value: Number of space time streams
  14735. * - channel_bw
  14736. * Bits 19:17
  14737. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14738. * measurement
  14739. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14740. * - cap_type
  14741. * Bits 23:20
  14742. * Purpose: Carry the type of the capture
  14743. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14744. * - vdev_id
  14745. * Bits 31:24
  14746. * Purpose: Carry the virtual device id
  14747. * Value: vdev ID
  14748. *
  14749. * Word 3
  14750. * - mac_addr31to0
  14751. * Bits 31:0
  14752. * Purpose: Contain the bits 31:0 of the peer MAC address
  14753. * Value: Bits 31:0 of the peer MAC address
  14754. *
  14755. * Word 4
  14756. * - mac_addr47to32
  14757. * Bits 15:0
  14758. * Purpose: Contain the bits 47:32 of the peer MAC address
  14759. * Value: Bits 47:32 of the peer MAC address
  14760. *
  14761. * Word 5
  14762. * - index
  14763. * Bits 31:0
  14764. * Purpose: Contain the index at which this CFR dump was written in the Host
  14765. * allocated memory. This index is the number of bytes from the base address.
  14766. * Value: Index position
  14767. *
  14768. * Word 6
  14769. * - length
  14770. * Bits 31:0
  14771. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14772. * Value: Length of the CFR capture of the peer
  14773. *
  14774. * Word 7
  14775. * - timestamp
  14776. * Bits 31:0
  14777. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14778. * clock used for this timestamp is private to the target and not visible to
  14779. * the host i.e., Host can interpret only the relative timestamp deltas from
  14780. * one message to the next, but can't interpret the absolute timestamp from a
  14781. * single message.
  14782. * Value: Timestamp in microseconds
  14783. *
  14784. * Word 8
  14785. * - counter
  14786. * Bits 31:0
  14787. * Purpose: Carry the count of the current CFR capture from FW. This is
  14788. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14789. * in host memory)
  14790. * Value: Count of the current CFR capture
  14791. *
  14792. * Word 9
  14793. * - chan_mhz
  14794. * Bits 31:0
  14795. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14796. * Value: Primary 20 channel frequency
  14797. *
  14798. * Word 10
  14799. * - band_center_freq1
  14800. * Bits 31:0
  14801. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14802. * Value: Center frequency 1 in MHz
  14803. *
  14804. * Word 11
  14805. * - band_center_freq2
  14806. * Bits 31:0
  14807. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14808. * the VDEV
  14809. * 80plus80 mode
  14810. * Value: Center frequency 2 in MHz
  14811. *
  14812. * Word 12
  14813. * - chan_phy_mode
  14814. * Bits 31:0
  14815. * Purpose: Carry the phy mode of the channel, of the VDEV
  14816. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14817. */
  14818. PREPACK struct htt_cfr_dump_ind_type_1 {
  14819. A_UINT32 mem_req_id:7,
  14820. status:1,
  14821. capture_bw:3,
  14822. mode:3,
  14823. sts_count:3,
  14824. channel_bw:3,
  14825. cap_type:4,
  14826. vdev_id:8;
  14827. htt_mac_addr addr;
  14828. A_UINT32 index;
  14829. A_UINT32 length;
  14830. A_UINT32 timestamp;
  14831. A_UINT32 counter;
  14832. struct htt_chan_change_msg chan;
  14833. } POSTPACK;
  14834. PREPACK struct htt_cfr_dump_compl_ind {
  14835. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14836. union {
  14837. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14838. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14839. /* If there is a need to change the memory layout and its associated
  14840. * HTT indication format, a new CFR capture message type can be
  14841. * introduced and added into this union.
  14842. */
  14843. };
  14844. } POSTPACK;
  14845. /*
  14846. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14847. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14848. */
  14849. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14850. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14851. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14852. do { \
  14853. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14854. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14855. } while(0)
  14856. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14857. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14858. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14859. /*
  14860. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14861. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14862. */
  14863. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14864. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14865. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14866. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14867. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14868. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14869. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14870. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14871. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14872. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14873. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14874. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14875. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14876. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14877. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14878. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14879. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14880. do { \
  14881. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14882. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14883. } while (0)
  14884. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14885. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14886. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14887. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14888. do { \
  14889. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14890. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14891. } while (0)
  14892. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14893. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14894. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14895. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14896. do { \
  14897. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14898. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14899. } while (0)
  14900. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14901. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14902. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14903. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14904. do { \
  14905. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14906. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14907. } while (0)
  14908. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14909. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14910. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14911. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14912. do { \
  14913. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14914. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14915. } while (0)
  14916. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14917. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14918. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14919. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14920. do { \
  14921. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14922. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14923. } while (0)
  14924. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14925. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14926. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14927. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14928. do { \
  14929. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14930. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14931. } while (0)
  14932. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14933. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14934. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14935. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14936. do { \
  14937. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14938. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14939. } while (0)
  14940. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14941. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14942. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14943. /**
  14944. * @brief target -> host peer (PPDU) stats message
  14945. *
  14946. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14947. *
  14948. * @details
  14949. * This message is generated by FW when FW is sending stats to host
  14950. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14951. * This message is sent autonomously by the target rather than upon request
  14952. * by the host.
  14953. * The following field definitions describe the format of the HTT target
  14954. * to host peer stats indication message.
  14955. *
  14956. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14957. * or more PPDU stats records.
  14958. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14959. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14960. * then the message would start with the
  14961. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14962. * below.
  14963. *
  14964. * |31 16|15|14|13 11|10 9|8|7 0|
  14965. * |-------------------------------------------------------------|
  14966. * | reserved |MSG_TYPE |
  14967. * |-------------------------------------------------------------|
  14968. * rec 0 | TLV header |
  14969. * rec 0 |-------------------------------------------------------------|
  14970. * rec 0 | ppdu successful bytes |
  14971. * rec 0 |-------------------------------------------------------------|
  14972. * rec 0 | ppdu retry bytes |
  14973. * rec 0 |-------------------------------------------------------------|
  14974. * rec 0 | ppdu failed bytes |
  14975. * rec 0 |-------------------------------------------------------------|
  14976. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14977. * rec 0 |-------------------------------------------------------------|
  14978. * rec 0 | retried MSDUs | successful MSDUs |
  14979. * rec 0 |-------------------------------------------------------------|
  14980. * rec 0 | TX duration | failed MSDUs |
  14981. * rec 0 |-------------------------------------------------------------|
  14982. * ...
  14983. * |-------------------------------------------------------------|
  14984. * rec N | TLV header |
  14985. * rec N |-------------------------------------------------------------|
  14986. * rec N | ppdu successful bytes |
  14987. * rec N |-------------------------------------------------------------|
  14988. * rec N | ppdu retry bytes |
  14989. * rec N |-------------------------------------------------------------|
  14990. * rec N | ppdu failed bytes |
  14991. * rec N |-------------------------------------------------------------|
  14992. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14993. * rec N |-------------------------------------------------------------|
  14994. * rec N | retried MSDUs | successful MSDUs |
  14995. * rec N |-------------------------------------------------------------|
  14996. * rec N | TX duration | failed MSDUs |
  14997. * rec N |-------------------------------------------------------------|
  14998. *
  14999. * where:
  15000. * A = is A-MPDU flag
  15001. * BA = block-ack failure flags
  15002. * BW = bandwidth spec
  15003. * SG = SGI enabled spec
  15004. * S = skipped rate ctrl
  15005. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15006. *
  15007. * Header
  15008. * ------
  15009. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15010. * dword0 - b'8:31 - reserved : Reserved for future use
  15011. *
  15012. * payload include below peer_stats information
  15013. * --------------------------------------------
  15014. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15015. * @tx_success_bytes : total successful bytes in the PPDU.
  15016. * @tx_retry_bytes : total retried bytes in the PPDU.
  15017. * @tx_failed_bytes : total failed bytes in the PPDU.
  15018. * @tx_ratecode : rate code used for the PPDU.
  15019. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15020. * @ba_ack_failed : BA/ACK failed for this PPDU
  15021. * b00 -> BA received
  15022. * b01 -> BA failed once
  15023. * b10 -> BA failed twice, when HW retry is enabled.
  15024. * @bw : BW
  15025. * b00 -> 20 MHz
  15026. * b01 -> 40 MHz
  15027. * b10 -> 80 MHz
  15028. * b11 -> 160 MHz (or 80+80)
  15029. * @sg : SGI enabled
  15030. * @s : skipped ratectrl
  15031. * @peer_id : peer id
  15032. * @tx_success_msdus : successful MSDUs
  15033. * @tx_retry_msdus : retried MSDUs
  15034. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15035. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15036. */
  15037. /**
  15038. * @brief target -> host backpressure event
  15039. *
  15040. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15041. *
  15042. * @details
  15043. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15044. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15045. * This message will only be sent if the backpressure condition has existed
  15046. * continuously for an initial period (100 ms).
  15047. * Repeat messages with updated information will be sent after each
  15048. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15049. * This message indicates the ring id along with current head and tail index
  15050. * locations (i.e. write and read indices).
  15051. * The backpressure time indicates the time in ms for which continous
  15052. * backpressure has been observed in the ring.
  15053. *
  15054. * The message format is as follows:
  15055. *
  15056. * |31 24|23 16|15 8|7 0|
  15057. * |----------------+----------------+----------------+----------------|
  15058. * | ring_id | ring_type | pdev_id | msg_type |
  15059. * |-------------------------------------------------------------------|
  15060. * | tail_idx | head_idx |
  15061. * |-------------------------------------------------------------------|
  15062. * | backpressure_time_ms |
  15063. * |-------------------------------------------------------------------|
  15064. *
  15065. * The message is interpreted as follows:
  15066. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15067. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15068. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15069. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15070. the msg is for LMAC ring.
  15071. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15072. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15073. * htt_backpressure_lmac_ring_id. This represents
  15074. * the ring id for which continous backpressure is seen
  15075. *
  15076. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15077. * the ring indicated by the ring_id
  15078. *
  15079. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15080. * the ring indicated by the ring id
  15081. *
  15082. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15083. * backpressure has been seen in the ring
  15084. * indicated by the ring_id.
  15085. * Units = milliseconds
  15086. */
  15087. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15088. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15089. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15090. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15091. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15092. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15093. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15094. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15095. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15096. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15097. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15098. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15099. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15100. do { \
  15101. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15102. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15103. } while (0)
  15104. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15105. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15106. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15107. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15108. do { \
  15109. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15110. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15111. } while (0)
  15112. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15113. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15114. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15115. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15116. do { \
  15117. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15118. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15119. } while (0)
  15120. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15121. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15122. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15123. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15124. do { \
  15125. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15126. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15127. } while (0)
  15128. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15129. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15130. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15131. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15132. do { \
  15133. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15134. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15135. } while (0)
  15136. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15137. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15138. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15139. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15140. do { \
  15141. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15142. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15143. } while (0)
  15144. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15145. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15146. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15147. enum htt_backpressure_ring_type {
  15148. HTT_SW_RING_TYPE_UMAC,
  15149. HTT_SW_RING_TYPE_LMAC,
  15150. HTT_SW_RING_TYPE_MAX,
  15151. };
  15152. /* Ring id for which the message is sent to host */
  15153. enum htt_backpressure_umac_ringid {
  15154. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15155. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15156. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15157. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15158. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15159. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15160. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15161. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15162. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15163. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15164. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15165. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15166. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15167. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15168. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15169. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15170. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15171. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15172. HTT_SW_UMAC_RING_IDX_MAX,
  15173. };
  15174. enum htt_backpressure_lmac_ringid {
  15175. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15176. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15177. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15178. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15179. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15180. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15181. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15182. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15183. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15184. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15185. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15186. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15187. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15188. HTT_SW_LMAC_RING_IDX_MAX,
  15189. };
  15190. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15191. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15192. pdev_id: 8,
  15193. ring_type: 8, /* htt_backpressure_ring_type */
  15194. /*
  15195. * ring_id holds an enum value from either
  15196. * htt_backpressure_umac_ringid or
  15197. * htt_backpressure_lmac_ringid, based on
  15198. * the ring_type setting.
  15199. */
  15200. ring_id: 8;
  15201. A_UINT16 head_idx;
  15202. A_UINT16 tail_idx;
  15203. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15204. } POSTPACK;
  15205. /*
  15206. * Defines two 32 bit words that can be used by the target to indicate a per
  15207. * user RU allocation and rate information.
  15208. *
  15209. * This information is currently provided in the "sw_response_reference_ptr"
  15210. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15211. * "rx_ppdu_end_user_stats" TLV.
  15212. *
  15213. * VALID:
  15214. * The consumer of these words must explicitly check the valid bit,
  15215. * and only attempt interpretation of any of the remaining fields if
  15216. * the valid bit is set to 1.
  15217. *
  15218. * VERSION:
  15219. * The consumer of these words must also explicitly check the version bit,
  15220. * and only use the V0 definition if the VERSION field is set to 0.
  15221. *
  15222. * Version 1 is currently undefined, with the exception of the VALID and
  15223. * VERSION fields.
  15224. *
  15225. * Version 0:
  15226. *
  15227. * The fields below are duplicated per BW.
  15228. *
  15229. * The consumer must determine which BW field to use, based on the UL OFDMA
  15230. * PPDU BW indicated by HW.
  15231. *
  15232. * RU_START: RU26 start index for the user.
  15233. * Note that this is always using the RU26 index, regardless
  15234. * of the actual RU assigned to the user
  15235. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15236. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15237. *
  15238. * For example, 20MHz (the value in the top row is RU_START)
  15239. *
  15240. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15241. * RU Size 1 (52): | | | | | |
  15242. * RU Size 2 (106): | | | |
  15243. * RU Size 3 (242): | |
  15244. *
  15245. * RU_SIZE: Indicates the RU size, as defined by enum
  15246. * htt_ul_ofdma_user_info_ru_size.
  15247. *
  15248. * LDPC: LDPC enabled (if 0, BCC is used)
  15249. *
  15250. * DCM: DCM enabled
  15251. *
  15252. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15253. * |---------------------------------+--------------------------------|
  15254. * |Ver|Valid| FW internal |
  15255. * |---------------------------------+--------------------------------|
  15256. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15257. * |---------------------------------+--------------------------------|
  15258. */
  15259. enum htt_ul_ofdma_user_info_ru_size {
  15260. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15261. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15262. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15263. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15264. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15265. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15266. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15267. };
  15268. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15269. struct htt_ul_ofdma_user_info_v0 {
  15270. A_UINT32 word0;
  15271. A_UINT32 word1;
  15272. };
  15273. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15274. A_UINT32 w0_fw_rsvd:30; \
  15275. A_UINT32 w0_valid:1; \
  15276. A_UINT32 w0_version:1;
  15277. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15278. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15279. };
  15280. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15281. A_UINT32 w1_nss:3; \
  15282. A_UINT32 w1_mcs:4; \
  15283. A_UINT32 w1_ldpc:1; \
  15284. A_UINT32 w1_dcm:1; \
  15285. A_UINT32 w1_ru_start:7; \
  15286. A_UINT32 w1_ru_size:3; \
  15287. A_UINT32 w1_trig_type:4; \
  15288. A_UINT32 w1_unused:9;
  15289. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15290. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15291. };
  15292. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15293. A_UINT32 w0_fw_rsvd:27; \
  15294. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15295. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15296. 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) */
  15297. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15298. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15299. };
  15300. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15301. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15302. A_UINT32 w1_trig_type:4; \
  15303. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15304. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15305. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15306. };
  15307. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15308. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15309. union {
  15310. A_UINT32 word0;
  15311. struct {
  15312. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15313. };
  15314. };
  15315. union {
  15316. A_UINT32 word1;
  15317. struct {
  15318. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15319. };
  15320. };
  15321. } POSTPACK;
  15322. /*
  15323. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15324. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15325. * this should be picked.
  15326. */
  15327. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15328. union {
  15329. A_UINT32 word0;
  15330. struct {
  15331. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15332. };
  15333. };
  15334. union {
  15335. A_UINT32 word1;
  15336. struct {
  15337. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15338. };
  15339. };
  15340. } POSTPACK;
  15341. enum HTT_UL_OFDMA_TRIG_TYPE {
  15342. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15343. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15344. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15345. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15346. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15347. };
  15348. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15349. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15350. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15351. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15352. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15353. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15354. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15355. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15356. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15357. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15358. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15359. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15360. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15361. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15362. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15363. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15364. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15365. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15366. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15367. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15368. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15369. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15370. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15371. /*--- word 0 ---*/
  15372. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15373. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15374. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15375. do { \
  15376. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15377. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15378. } while (0)
  15379. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15380. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15381. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15382. do { \
  15383. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15384. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15385. } while (0)
  15386. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15387. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15388. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15389. do { \
  15390. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15391. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15392. } while (0)
  15393. /*--- word 1 ---*/
  15394. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15395. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15396. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15397. do { \
  15398. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15399. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15400. } while (0)
  15401. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15402. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15403. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15404. do { \
  15405. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15406. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15407. } while (0)
  15408. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15409. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15410. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15411. do { \
  15412. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15413. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15414. } while (0)
  15415. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15416. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15417. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15418. do { \
  15419. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15420. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15421. } while (0)
  15422. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15423. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15424. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15425. do { \
  15426. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15427. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15428. } while (0)
  15429. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15430. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15431. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15432. do { \
  15433. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15434. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15435. } while (0)
  15436. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15437. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15438. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15439. do { \
  15440. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15441. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15442. } while (0)
  15443. /**
  15444. * @brief target -> host channel calibration data message
  15445. *
  15446. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15447. *
  15448. * @brief host -> target channel calibration data message
  15449. *
  15450. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15451. *
  15452. * @details
  15453. * The following field definitions describe the format of the channel
  15454. * calibration data message sent from the target to the host when
  15455. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15456. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15457. * The message is defined as htt_chan_caldata_msg followed by a variable
  15458. * number of 32-bit character values.
  15459. *
  15460. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15461. * |------------------------------------------------------------------|
  15462. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15463. * |------------------------------------------------------------------|
  15464. * | payload size | mhz |
  15465. * |------------------------------------------------------------------|
  15466. * | center frequency 2 | center frequency 1 |
  15467. * |------------------------------------------------------------------|
  15468. * | check sum |
  15469. * |------------------------------------------------------------------|
  15470. * | payload |
  15471. * |------------------------------------------------------------------|
  15472. * message info field:
  15473. * - MSG_TYPE
  15474. * Bits 7:0
  15475. * Purpose: identifies this as a channel calibration data message
  15476. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15477. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15478. * - SUB_TYPE
  15479. * Bits 11:8
  15480. * Purpose: T2H: indicates whether target is providing chan cal data
  15481. * to the host to store, or requesting that the host
  15482. * download previously-stored data.
  15483. * H2T: indicates whether the host is providing the requested
  15484. * channel cal data, or if it is rejecting the data
  15485. * request because it does not have the requested data.
  15486. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15487. * - CHKSUM_VALID
  15488. * Bit 12
  15489. * Purpose: indicates if the checksum field is valid
  15490. * value:
  15491. * - FRAG
  15492. * Bit 19:16
  15493. * Purpose: indicates the fragment index for message
  15494. * value: 0 for first fragment, 1 for second fragment, ...
  15495. * - APPEND
  15496. * Bit 20
  15497. * Purpose: indicates if this is the last fragment
  15498. * value: 0 = final fragment, 1 = more fragments will be appended
  15499. *
  15500. * channel and payload size field
  15501. * - MHZ
  15502. * Bits 15:0
  15503. * Purpose: indicates the channel primary frequency
  15504. * Value:
  15505. * - PAYLOAD_SIZE
  15506. * Bits 31:16
  15507. * Purpose: indicates the bytes of calibration data in payload
  15508. * Value:
  15509. *
  15510. * center frequency field
  15511. * - CENTER FREQUENCY 1
  15512. * Bits 15:0
  15513. * Purpose: indicates the channel center frequency
  15514. * Value: channel center frequency, in MHz units
  15515. * - CENTER FREQUENCY 2
  15516. * Bits 31:16
  15517. * Purpose: indicates the secondary channel center frequency,
  15518. * only for 11acvht 80plus80 mode
  15519. * Value: secondary channel center frequeny, in MHz units, if applicable
  15520. *
  15521. * checksum field
  15522. * - CHECK_SUM
  15523. * Bits 31:0
  15524. * Purpose: check the payload data, it is just for this fragment.
  15525. * This is intended for the target to check that the channel
  15526. * calibration data returned by the host is the unmodified data
  15527. * that was previously provided to the host by the target.
  15528. * value: checksum of fragment payload
  15529. */
  15530. PREPACK struct htt_chan_caldata_msg {
  15531. /* DWORD 0: message info */
  15532. A_UINT32
  15533. msg_type: 8,
  15534. sub_type: 4 ,
  15535. chksum_valid: 1, /** 1:valid, 0:invalid */
  15536. reserved1: 3,
  15537. frag_idx: 4, /** fragment index for calibration data */
  15538. appending: 1, /** 0: no fragment appending,
  15539. * 1: extra fragment appending */
  15540. reserved2: 11;
  15541. /* DWORD 1: channel and payload size */
  15542. A_UINT32
  15543. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15544. payload_size: 16; /** unit: bytes */
  15545. /* DWORD 2: center frequency */
  15546. A_UINT32
  15547. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15548. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15549. * valid only for 11acvht 80plus80 mode */
  15550. /* DWORD 3: check sum */
  15551. A_UINT32 chksum;
  15552. /* variable length for calibration data */
  15553. A_UINT32 payload[1/* or more */];
  15554. } POSTPACK;
  15555. /* T2H SUBTYPE */
  15556. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15557. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15558. /* H2T SUBTYPE */
  15559. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15560. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15561. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15562. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15563. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15564. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15565. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15566. do { \
  15567. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15568. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15569. } while (0)
  15570. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15571. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15572. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15573. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15574. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15575. do { \
  15576. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15577. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15578. } while (0)
  15579. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15580. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15581. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15582. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15583. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15584. do { \
  15585. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15586. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15587. } while (0)
  15588. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15589. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15590. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15591. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15592. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15593. do { \
  15594. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15595. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15596. } while (0)
  15597. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15598. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15599. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15600. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15601. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15602. do { \
  15603. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15604. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15605. } while (0)
  15606. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15607. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15608. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15609. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15610. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15611. do { \
  15612. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15613. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15614. } while (0)
  15615. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15616. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15617. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15618. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15619. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15620. do { \
  15621. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15622. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15623. } while (0)
  15624. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15625. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15626. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15627. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15628. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15629. do { \
  15630. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15631. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15632. } while (0)
  15633. /**
  15634. * @brief target -> host FSE CMEM based send
  15635. *
  15636. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15637. *
  15638. * @details
  15639. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15640. * FSE placement in CMEM is enabled.
  15641. *
  15642. * This message sends the non-secure CMEM base address.
  15643. * It will be sent to host in response to message
  15644. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15645. * The message would appear as follows:
  15646. *
  15647. * |31 24|23 16|15 8|7 0|
  15648. * |----------------+----------------+----------------+----------------|
  15649. * | reserved | num_entries | msg_type |
  15650. * |----------------+----------------+----------------+----------------|
  15651. * | base_address_lo |
  15652. * |----------------+----------------+----------------+----------------|
  15653. * | base_address_hi |
  15654. * |-------------------------------------------------------------------|
  15655. *
  15656. * The message is interpreted as follows:
  15657. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15658. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15659. * b'8:15 - number_entries: Indicated the number of entries
  15660. * programmed.
  15661. * b'16:31 - reserved.
  15662. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15663. * CMEM base address
  15664. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15665. * CMEM base address
  15666. */
  15667. PREPACK struct htt_cmem_base_send_t {
  15668. A_UINT32 msg_type: 8,
  15669. num_entries: 8,
  15670. reserved: 16;
  15671. A_UINT32 base_address_lo;
  15672. A_UINT32 base_address_hi;
  15673. } POSTPACK;
  15674. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15675. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15676. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15677. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15678. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15679. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15680. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15681. do { \
  15682. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15683. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15684. } while (0)
  15685. /**
  15686. * @brief - HTT PPDU ID format
  15687. *
  15688. * @details
  15689. * The following field definitions describe the format of the PPDU ID.
  15690. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15691. *
  15692. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15693. * +--------------------------------------------------------------------------
  15694. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15695. * +--------------------------------------------------------------------------
  15696. *
  15697. * sch id :Schedule command id
  15698. * Bits [11 : 0] : monotonically increasing counter to track the
  15699. * PPDU posted to a specific transmit queue.
  15700. *
  15701. * hwq_id: Hardware Queue ID.
  15702. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15703. *
  15704. * mac_id: MAC ID
  15705. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15706. *
  15707. * seq_idx: Sequence index.
  15708. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15709. * a particular TXOP.
  15710. *
  15711. * tqm_cmd: HWSCH/TQM flag.
  15712. * Bit [23] : Always set to 0.
  15713. *
  15714. * seq_cmd_type: Sequence command type.
  15715. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15716. * Refer to enum HTT_STATS_FTYPE for values.
  15717. */
  15718. PREPACK struct htt_ppdu_id {
  15719. A_UINT32
  15720. sch_id: 12,
  15721. hwq_id: 5,
  15722. mac_id: 2,
  15723. seq_idx: 2,
  15724. reserved1: 2,
  15725. tqm_cmd: 1,
  15726. seq_cmd_type: 6,
  15727. reserved2: 2;
  15728. } POSTPACK;
  15729. #define HTT_PPDU_ID_SCH_ID_S 0
  15730. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15731. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15732. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15733. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15734. do { \
  15735. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15736. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15737. } while (0)
  15738. #define HTT_PPDU_ID_HWQ_ID_S 12
  15739. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15740. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15741. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15742. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15743. do { \
  15744. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15745. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15746. } while (0)
  15747. #define HTT_PPDU_ID_MAC_ID_S 17
  15748. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15749. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15750. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15751. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15752. do { \
  15753. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15754. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15755. } while (0)
  15756. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15757. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15758. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15759. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15760. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15761. do { \
  15762. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15763. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15764. } while (0)
  15765. #define HTT_PPDU_ID_TQM_CMD_S 23
  15766. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15767. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15768. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15769. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15770. do { \
  15771. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15772. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15773. } while (0)
  15774. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15775. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15776. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15777. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15778. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15779. do { \
  15780. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15781. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15782. } while (0)
  15783. /**
  15784. * @brief target -> RX PEER METADATA V0 format
  15785. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15786. * message from target, and will confirm to the target which peer metadata
  15787. * version to use in the wmi_init message.
  15788. *
  15789. * The following diagram shows the format of the RX PEER METADATA.
  15790. *
  15791. * |31 24|23 16|15 8|7 0|
  15792. * |-----------------------------------------------------------------------|
  15793. * | Reserved | VDEV ID | PEER ID |
  15794. * |-----------------------------------------------------------------------|
  15795. */
  15796. PREPACK struct htt_rx_peer_metadata_v0 {
  15797. A_UINT32
  15798. peer_id: 16,
  15799. vdev_id: 8,
  15800. reserved1: 8;
  15801. } POSTPACK;
  15802. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15803. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15804. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15805. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15806. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15807. do { \
  15808. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15809. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15810. } while (0)
  15811. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15812. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15813. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15814. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15815. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15816. do { \
  15817. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15818. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15819. } while (0)
  15820. /**
  15821. * @brief target -> RX PEER METADATA V1 format
  15822. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15823. * message from target, and will confirm to the target which peer metadata
  15824. * version to use in the wmi_init message.
  15825. *
  15826. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15827. *
  15828. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15829. * |-----------------------------------------------------------------------|
  15830. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15831. * |-----------------------------------------------------------------------|
  15832. */
  15833. PREPACK struct htt_rx_peer_metadata_v1 {
  15834. A_UINT32
  15835. peer_id: 13,
  15836. ml_peer_valid: 1,
  15837. reserved1: 2,
  15838. vdev_id: 8,
  15839. lmac_id: 2,
  15840. chip_id: 3,
  15841. reserved2: 3;
  15842. } POSTPACK;
  15843. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15844. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15845. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15846. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15847. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15848. do { \
  15849. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15850. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15851. } while (0)
  15852. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15853. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15854. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15855. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15856. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15857. do { \
  15858. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15859. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15860. } while (0)
  15861. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15862. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15863. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15864. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15865. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15866. do { \
  15867. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15868. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15869. } while (0)
  15870. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15871. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15872. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15873. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15874. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15875. do { \
  15876. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15877. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15878. } while (0)
  15879. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15880. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15881. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15882. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15883. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15884. do { \
  15885. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15886. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15887. } while (0)
  15888. /*
  15889. * In some systems, the host SW wants to specify priorities between
  15890. * different MSDU / flow queues within the same peer-TID.
  15891. * The below enums are used for the host to identify to the target
  15892. * which MSDU queue's priority it wants to adjust.
  15893. */
  15894. /*
  15895. * The MSDUQ index describe index of TCL HW, where each index is
  15896. * used for queuing particular types of MSDUs.
  15897. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15898. */
  15899. enum HTT_MSDUQ_INDEX {
  15900. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15901. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15902. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15903. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15904. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15905. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15906. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15907. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15908. HTT_MSDUQ_MAX_INDEX,
  15909. };
  15910. /* MSDU qtype definition */
  15911. enum HTT_MSDU_QTYPE {
  15912. /*
  15913. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15914. * relative priority. Instead, the relative priority of CRIT_0 versus
  15915. * CRIT_1 is controlled by the FW, through the configuration parameters
  15916. * it applies to the queues.
  15917. */
  15918. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15919. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15920. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15921. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15922. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15923. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15924. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15925. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15926. /* New MSDU_QTYPE should be added above this line */
  15927. /*
  15928. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15929. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15930. * any host/target message definitions. The QTYPE_MAX value can
  15931. * only be used internally within the host or within the target.
  15932. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15933. * it must regard the unexpected value as a default qtype value,
  15934. * or ignore it.
  15935. */
  15936. HTT_MSDU_QTYPE_MAX,
  15937. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15938. };
  15939. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15940. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15941. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15942. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15943. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15944. };
  15945. /**
  15946. * @brief target -> host mlo timestamp offset indication
  15947. *
  15948. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15949. *
  15950. * @details
  15951. * The following field definitions describe the format of the HTT target
  15952. * to host mlo timestamp offset indication message.
  15953. *
  15954. *
  15955. * |31 16|15 12|11 10|9 8|7 0 |
  15956. * |----------------------------------------------------------------------|
  15957. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15958. * |----------------------------------------------------------------------|
  15959. * | Sync time stamp lo in us |
  15960. * |----------------------------------------------------------------------|
  15961. * | Sync time stamp hi in us |
  15962. * |----------------------------------------------------------------------|
  15963. * | mlo time stamp offset lo in us |
  15964. * |----------------------------------------------------------------------|
  15965. * | mlo time stamp offset hi in us |
  15966. * |----------------------------------------------------------------------|
  15967. * | mlo time stamp offset clocks in clock ticks |
  15968. * |----------------------------------------------------------------------|
  15969. * |31 26|25 16|15 0 |
  15970. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15971. * | | compensation in clks | |
  15972. * |----------------------------------------------------------------------|
  15973. * |31 22|21 0 |
  15974. * | rsvd 3 | mlo time stamp comp timer period |
  15975. * |----------------------------------------------------------------------|
  15976. * The message is interpreted as follows:
  15977. *
  15978. * dword0 - b'0:7 - msg_type: This will be set to
  15979. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15980. * value: 0x28
  15981. *
  15982. * dword0 - b'9:8 - pdev_id
  15983. *
  15984. * dword0 - b'11:10 - chip_id
  15985. *
  15986. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15987. *
  15988. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15989. *
  15990. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15991. * which last sync interrupt was received
  15992. *
  15993. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15994. * which last sync interrupt was received
  15995. *
  15996. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15997. *
  15998. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15999. *
  16000. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16001. *
  16002. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16003. *
  16004. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16005. * for sub us resolution
  16006. *
  16007. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16008. *
  16009. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16010. * is applied, in us
  16011. *
  16012. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16013. */
  16014. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16015. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16016. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16017. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16018. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16019. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16020. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16021. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16022. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16023. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16024. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16025. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16026. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16027. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16028. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16029. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16030. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16031. do { \
  16032. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16033. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16034. } while (0)
  16035. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16036. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16037. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16038. do { \
  16039. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16040. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16041. } while (0)
  16042. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16043. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16044. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16045. do { \
  16046. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16047. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16048. } while (0)
  16049. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16050. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16051. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16052. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16053. do { \
  16054. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16055. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16056. } while (0)
  16057. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16058. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16059. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16060. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16061. do { \
  16062. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16063. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16064. } while (0)
  16065. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16066. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16067. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16068. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16069. do { \
  16070. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16071. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16072. } while (0)
  16073. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16074. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16075. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16076. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16077. do { \
  16078. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16079. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16080. } while (0)
  16081. typedef struct {
  16082. A_UINT32 msg_type: 8, /* bits 7:0 */
  16083. pdev_id: 2, /* bits 9:8 */
  16084. chip_id: 2, /* bits 11:10 */
  16085. reserved1: 4, /* bits 15:12 */
  16086. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16087. A_UINT32 sync_timestamp_lo_us;
  16088. A_UINT32 sync_timestamp_hi_us;
  16089. A_UINT32 mlo_timestamp_offset_lo_us;
  16090. A_UINT32 mlo_timestamp_offset_hi_us;
  16091. A_UINT32 mlo_timestamp_offset_clks;
  16092. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16093. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16094. reserved2: 6; /* bits 31:26 */
  16095. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16096. reserved3: 10; /* bits 31:22 */
  16097. } htt_t2h_mlo_offset_ind_t;
  16098. /*
  16099. * @brief target -> host VDEV TX RX STATS
  16100. *
  16101. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16102. *
  16103. * @details
  16104. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16105. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16106. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16107. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16108. * periodically by target even in the absence of any further HTT request
  16109. * messages from host.
  16110. *
  16111. * The message is formatted as follows:
  16112. *
  16113. * |31 16|15 8|7 0|
  16114. * |---------------------------------+----------------+----------------|
  16115. * | payload_size | pdev_id | msg_type |
  16116. * |---------------------------------+----------------+----------------|
  16117. * | reserved0 |
  16118. * |-------------------------------------------------------------------|
  16119. * | reserved1 |
  16120. * |-------------------------------------------------------------------|
  16121. * | reserved2 |
  16122. * |-------------------------------------------------------------------|
  16123. * | |
  16124. * | VDEV specific Tx Rx stats info |
  16125. * | |
  16126. * |-------------------------------------------------------------------|
  16127. *
  16128. * The message is interpreted as follows:
  16129. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16130. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16131. * b'8:15 - pdev_id
  16132. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16133. * message header fields (msg_type through reserved2)
  16134. * dword1 - b'0:31 - reserved0.
  16135. * dword2 - b'0:31 - reserved1.
  16136. * dword3 - b'0:31 - reserved2.
  16137. */
  16138. typedef struct {
  16139. A_UINT32 msg_type: 8,
  16140. pdev_id: 8,
  16141. payload_size: 16;
  16142. A_UINT32 reserved0;
  16143. A_UINT32 reserved1;
  16144. A_UINT32 reserved2;
  16145. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16146. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16147. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16148. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16149. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16150. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16151. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16152. do { \
  16153. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16154. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16155. } while (0)
  16156. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16157. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16158. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16159. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16160. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16161. do { \
  16162. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16163. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16164. } while (0)
  16165. /* SOC related stats */
  16166. typedef struct {
  16167. htt_tlv_hdr_t tlv_hdr;
  16168. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16169. * This can be due to either the peer is deleted or deletion is ongoing
  16170. * */
  16171. A_UINT32 inv_peers_msdu_drop_count_lo;
  16172. A_UINT32 inv_peers_msdu_drop_count_hi;
  16173. } htt_t2h_soc_txrx_stats_common_tlv;
  16174. /* VDEV HW Tx/Rx stats */
  16175. typedef struct {
  16176. htt_tlv_hdr_t tlv_hdr;
  16177. A_UINT32 vdev_id;
  16178. /* Rx msdu byte cnt */
  16179. A_UINT32 rx_msdu_byte_cnt_lo;
  16180. A_UINT32 rx_msdu_byte_cnt_hi;
  16181. /* Rx msdu cnt */
  16182. A_UINT32 rx_msdu_cnt_lo;
  16183. A_UINT32 rx_msdu_cnt_hi;
  16184. /* tx msdu byte cnt */
  16185. A_UINT32 tx_msdu_byte_cnt_lo;
  16186. A_UINT32 tx_msdu_byte_cnt_hi;
  16187. /* tx msdu cnt */
  16188. A_UINT32 tx_msdu_cnt_lo;
  16189. A_UINT32 tx_msdu_cnt_hi;
  16190. /* tx excessive retry discarded msdu cnt */
  16191. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16192. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16193. /* TX congestion ctrl msdu drop cnt */
  16194. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16195. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16196. /* discarded tx msdus cnt coz of time to live expiry */
  16197. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16198. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16199. /* tx excessive retry discarded msdu byte cnt */
  16200. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16201. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16202. /* TX congestion ctrl msdu drop byte cnt */
  16203. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16204. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16205. /* discarded tx msdus byte cnt coz of time to live expiry */
  16206. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16207. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16208. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16209. /*
  16210. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16211. *
  16212. * @details
  16213. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16214. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16215. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16216. * the default MSDU queues of each of the specified TIDs for the peer
  16217. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16218. * If the default MSDU queues of a given TID within the peer are not linked
  16219. * to a service class, the svc_class_id field for that TID will have a
  16220. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16221. * queues for that TID are not mapped to any service class.
  16222. *
  16223. * |31 16|15 8|7 0|
  16224. * |------------------------------+--------------+--------------|
  16225. * | peer ID | reserved | msg type |
  16226. * |------------------------------+--------------+------+-------|
  16227. * | reserved | svc class ID | TID |
  16228. * |------------------------------------------------------------|
  16229. * ...
  16230. * |------------------------------------------------------------|
  16231. * | reserved | svc class ID | TID |
  16232. * |------------------------------------------------------------|
  16233. * Header fields:
  16234. * dword0 - b'7:0 - msg_type: This will be set to
  16235. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16236. * b'31:16 - peer ID
  16237. * dword1 - b'7:0 - TID
  16238. * b'15:8 - svc class ID
  16239. * (dword2, etc. same format as dword1)
  16240. */
  16241. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16242. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16243. A_UINT32 msg_type :8,
  16244. reserved0 :8,
  16245. peer_id :16;
  16246. struct {
  16247. A_UINT32 tid :8,
  16248. svc_class_id :8,
  16249. reserved1 :16;
  16250. } tid_reports[1/*or more*/];
  16251. } POSTPACK;
  16252. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16253. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16254. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16255. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16256. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16257. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16258. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16259. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16260. do { \
  16261. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16262. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16263. } while (0)
  16264. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16265. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16266. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16267. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16268. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16269. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16270. do { \
  16271. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16272. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16273. } while (0)
  16274. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16275. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16276. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16277. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16278. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16279. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16280. do { \
  16281. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16282. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16283. } while (0)
  16284. /*
  16285. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16286. *
  16287. * @details
  16288. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16289. * flow if the flow is seen the associated service class is conveyed to the
  16290. * target via TCL Data Command. Target on the other hand internally creates the
  16291. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16292. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16293. * the newly created MSDUQ
  16294. *
  16295. * |31 27| 24|23 16|15 11|10|9 8|7 4|3 0|
  16296. * |------------------------------+----------------------+--------------|
  16297. * | peer ID | HTT qtype | msg type |
  16298. * |--------+---------------------+---------------+--+---+-------+------|
  16299. * |reserved| Ast Index |FO|WC | HLOS | remap|
  16300. * | | | | | TID | TID |
  16301. * |---------------------+----------------------------------------------|
  16302. * | reserved1 | tgt_opaque_id |
  16303. * |---------------------+----------------------------------------------|
  16304. *
  16305. * Header fields:
  16306. *
  16307. * dword0 - b'7:0 - msg_type: This will be set to
  16308. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16309. * b'15:8 - HTT qtype
  16310. * b'31:16 - peer ID
  16311. *
  16312. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16313. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16314. * hlos_tid : Common to Lithium and Beryllium
  16315. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16316. * TCL Data Command : Beryllium
  16317. * b10 - flow_override (FO), as sent by host in
  16318. * TCL Data Command: Beryllium
  16319. * b11:26 - ast_index
  16320. * Dummy AST Index in case of Lithium,
  16321. * Default AST Index in case of Beryllium
  16322. * b27:32 - reserved
  16323. *
  16324. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16325. * unique MSDUQ id in firmware
  16326. * b'24:31 - reserved1
  16327. */
  16328. PREPACK struct htt_t2h_sawf_msduq_event {
  16329. A_UINT32 msg_type : 8,
  16330. htt_qtype : 8,
  16331. peer_id :16;
  16332. A_UINT32 remap_tid : 4,
  16333. hlos_tid : 4,
  16334. who_classify_info_sel : 2,
  16335. flow_override : 1,
  16336. ast_index :16,
  16337. reserved : 5;
  16338. A_UINT32 tgt_opaque_id :24,
  16339. reserved1 : 8;
  16340. } POSTPACK;
  16341. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16342. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16343. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16344. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16345. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16346. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16347. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16348. do { \
  16349. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16350. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16351. } while (0)
  16352. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16353. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16354. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16355. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16356. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16357. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16358. do { \
  16359. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16360. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16361. } while (0)
  16362. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16363. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16364. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16365. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16366. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16367. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16368. do { \
  16369. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16370. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16371. } while (0)
  16372. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16373. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16374. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16375. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16376. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16377. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16378. do { \
  16379. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16380. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16381. } while (0)
  16382. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16383. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16384. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16385. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16386. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16387. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16388. do { \
  16389. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16390. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16391. } while (0)
  16392. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16393. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16394. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16395. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16396. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16397. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16398. do { \
  16399. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16400. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16401. } while (0)
  16402. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_M 0x07FFF800
  16403. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S 11
  16404. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_GET(_var) \
  16405. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_M) >> \
  16406. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S)
  16407. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_SET(_var, _val) \
  16408. do { \
  16409. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX, _val); \
  16410. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S)); \
  16411. } while (0)
  16412. #endif