htt.h 871 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. */
  230. #define HTT_CURRENT_VERSION_MAJOR 3
  231. #define HTT_CURRENT_VERSION_MINOR 108
  232. #define HTT_NUM_TX_FRAG_DESC 1024
  233. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  234. #define HTT_CHECK_SET_VAL(field, val) \
  235. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  236. /* macros to assist in sign-extending fields from HTT messages */
  237. #define HTT_SIGN_BIT_MASK(field) \
  238. ((field ## _M + (1 << field ## _S)) >> 1)
  239. #define HTT_SIGN_BIT(_val, field) \
  240. (_val & HTT_SIGN_BIT_MASK(field))
  241. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  242. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  243. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  244. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  245. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  246. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  247. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  248. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  249. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  250. /*
  251. * TEMPORARY:
  252. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  253. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  254. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  255. * updated.
  256. */
  257. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  258. /*
  259. * TEMPORARY:
  260. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  261. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  262. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  263. * updated.
  264. */
  265. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  266. /**
  267. * htt_dbg_stats_type -
  268. * bit positions for each stats type within a stats type bitmask
  269. * The bitmask contains 24 bits.
  270. */
  271. enum htt_dbg_stats_type {
  272. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  273. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  274. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  275. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  276. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  277. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  278. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  279. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  280. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  281. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  282. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  283. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  284. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  285. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  286. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  287. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  288. /* bits 16-23 currently reserved */
  289. /* keep this last */
  290. HTT_DBG_NUM_STATS
  291. };
  292. /*=== HTT option selection TLVs ===
  293. * Certain HTT messages have alternatives or options.
  294. * For such cases, the host and target need to agree on which option to use.
  295. * Option specification TLVs can be appended to the VERSION_REQ and
  296. * VERSION_CONF messages to select options other than the default.
  297. * These TLVs are entirely optional - if they are not provided, there is a
  298. * well-defined default for each option. If they are provided, they can be
  299. * provided in any order. Each TLV can be present or absent independent of
  300. * the presence / absence of other TLVs.
  301. *
  302. * The HTT option selection TLVs use the following format:
  303. * |31 16|15 8|7 0|
  304. * |---------------------------------+----------------+----------------|
  305. * | value (payload) | length | tag |
  306. * |-------------------------------------------------------------------|
  307. * The value portion need not be only 2 bytes; it can be extended by any
  308. * integer number of 4-byte units. The total length of the TLV, including
  309. * the tag and length fields, must be a multiple of 4 bytes. The length
  310. * field specifies the total TLV size in 4-byte units. Thus, the typical
  311. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  312. * field, would store 0x1 in its length field, to show that the TLV occupies
  313. * a single 4-byte unit.
  314. */
  315. /*--- TLV header format - applies to all HTT option TLVs ---*/
  316. enum HTT_OPTION_TLV_TAGS {
  317. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  318. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  319. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  320. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  321. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  322. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  323. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  324. };
  325. #define HTT_TCL_METADATA_VER_SZ 4
  326. PREPACK struct htt_option_tlv_header_t {
  327. A_UINT8 tag;
  328. A_UINT8 length;
  329. } POSTPACK;
  330. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  331. #define HTT_OPTION_TLV_TAG_S 0
  332. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  333. #define HTT_OPTION_TLV_LENGTH_S 8
  334. /*
  335. * value0 - 16 bit value field stored in word0
  336. * The TLV's value field may be longer than 2 bytes, in which case
  337. * the remainder of the value is stored in word1, word2, etc.
  338. */
  339. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  340. #define HTT_OPTION_TLV_VALUE0_S 16
  341. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  342. do { \
  343. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  344. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  345. } while (0)
  346. #define HTT_OPTION_TLV_TAG_GET(word) \
  347. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  348. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  349. do { \
  350. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  351. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  352. } while (0)
  353. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  354. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  355. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  356. do { \
  357. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  358. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  359. } while (0)
  360. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  361. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  362. /*--- format of specific HTT option TLVs ---*/
  363. /*
  364. * HTT option TLV for specifying LL bus address size
  365. * Some chips require bus addresses used by the target to access buffers
  366. * within the host's memory to be 32 bits; others require bus addresses
  367. * used by the target to access buffers within the host's memory to be
  368. * 64 bits.
  369. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  370. * a suffix to the VERSION_CONF message to specify which bus address format
  371. * the target requires.
  372. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  373. * default to providing bus addresses to the target in 32-bit format.
  374. */
  375. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  376. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  377. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  378. };
  379. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  380. struct htt_option_tlv_header_t hdr;
  381. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  382. } POSTPACK;
  383. /*
  384. * HTT option TLV for specifying whether HL systems should indicate
  385. * over-the-air tx completion for individual frames, or should instead
  386. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  387. * requests an OTA tx completion for a particular tx frame.
  388. * This option does not apply to LL systems, where the TX_COMPL_IND
  389. * is mandatory.
  390. * This option is primarily intended for HL systems in which the tx frame
  391. * downloads over the host --> target bus are as slow as or slower than
  392. * the transmissions over the WLAN PHY. For cases where the bus is faster
  393. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  394. * and consquently will send one TX_COMPL_IND message that covers several
  395. * tx frames. For cases where the WLAN PHY is faster than the bus,
  396. * the target will end up transmitting very short A-MPDUs, and consequently
  397. * sending many TX_COMPL_IND messages, which each cover a very small number
  398. * of tx frames.
  399. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  400. * a suffix to the VERSION_REQ message to request whether the host desires to
  401. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  402. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  403. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  404. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  405. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  406. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  407. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  408. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  409. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  410. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  411. * TLV.
  412. */
  413. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  414. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  415. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  416. };
  417. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  418. struct htt_option_tlv_header_t hdr;
  419. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  420. } POSTPACK;
  421. /*
  422. * HTT option TLV for specifying how many tx queue groups the target
  423. * may establish.
  424. * This TLV specifies the maximum value the target may send in the
  425. * txq_group_id field of any TXQ_GROUP information elements sent by
  426. * the target to the host. This allows the host to pre-allocate an
  427. * appropriate number of tx queue group structs.
  428. *
  429. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  430. * a suffix to the VERSION_REQ message to specify whether the host supports
  431. * tx queue groups at all, and if so if there is any limit on the number of
  432. * tx queue groups that the host supports.
  433. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  434. * a suffix to the VERSION_CONF message. If the host has specified in the
  435. * VER_REQ message a limit on the number of tx queue groups the host can
  436. * supprt, the target shall limit its specification of the maximum tx groups
  437. * to be no larger than this host-specified limit.
  438. *
  439. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  440. * shall preallocate 4 tx queue group structs, and the target shall not
  441. * specify a txq_group_id larger than 3.
  442. */
  443. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  444. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  445. /*
  446. * values 1 through N specify the max number of tx queue groups
  447. * the sender supports
  448. */
  449. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  450. };
  451. /* TEMPORARY backwards-compatibility alias for a typo fix -
  452. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  453. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  454. * to support the old name (with the typo) until all references to the
  455. * old name are replaced with the new name.
  456. */
  457. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  458. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  459. struct htt_option_tlv_header_t hdr;
  460. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  461. } POSTPACK;
  462. /*
  463. * HTT option TLV for specifying whether the target supports an extended
  464. * version of the HTT tx descriptor. If the target provides this TLV
  465. * and specifies in the TLV that the target supports an extended version
  466. * of the HTT tx descriptor, the target must check the "extension" bit in
  467. * the HTT tx descriptor, and if the extension bit is set, to expect a
  468. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  469. * descriptor. Furthermore, the target must provide room for the HTT
  470. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  471. * This option is intended for systems where the host needs to explicitly
  472. * control the transmission parameters such as tx power for individual
  473. * tx frames.
  474. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  475. * as a suffix to the VERSION_CONF message to explicitly specify whether
  476. * the target supports the HTT tx MSDU extension descriptor.
  477. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  478. * by the host as lack of target support for the HTT tx MSDU extension
  479. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  480. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  481. * the HTT tx MSDU extension descriptor.
  482. * The host is not required to provide the HTT tx MSDU extension descriptor
  483. * just because the target supports it; the target must check the
  484. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  485. * extension descriptor is present.
  486. */
  487. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  488. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  489. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  490. };
  491. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  492. struct htt_option_tlv_header_t hdr;
  493. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  494. } POSTPACK;
  495. /*
  496. * For the tcl data command V2 and higher support added a new
  497. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  498. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  499. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  500. * HTT option TLV for specifying which version of the TCL metadata struct
  501. * should be used:
  502. * V1 -> use htt_tx_tcl_metadata struct
  503. * V2 -> use htt_tx_tcl_metadata_v2 struct
  504. * Old FW will only support V1.
  505. * New FW will support V2. New FW will still support V1, at least during
  506. * a transition period.
  507. * Similarly, old host will only support V1, and new host will support V1 + V2.
  508. *
  509. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  510. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  511. * of TCL metadata the host supports. If the host doesn't provide a
  512. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  513. * is implicitly understood that the host only supports V1.
  514. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  515. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  516. * the host shall use. The target shall only select one of the versions
  517. * supported by the host. If the target doesn't provide a
  518. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  519. * is implicitly understood that the V1 TCL metadata shall be used.
  520. */
  521. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  522. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  523. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  524. };
  525. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  526. struct htt_option_tlv_header_t hdr;
  527. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  528. } POSTPACK;
  529. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  530. HTT_OPTION_TLV_VALUE0_SET(word, value)
  531. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  532. HTT_OPTION_TLV_VALUE0_GET(word)
  533. typedef struct {
  534. union {
  535. /* BIT [11 : 0] :- tag
  536. * BIT [23 : 12] :- length
  537. * BIT [31 : 24] :- reserved
  538. */
  539. A_UINT32 tag__length;
  540. /*
  541. * The following struct is not endian-portable.
  542. * It is suitable for use within the target, which is known to be
  543. * little-endian.
  544. * The host should use the above endian-portable macros to access
  545. * the tag and length bitfields in an endian-neutral manner.
  546. */
  547. struct {
  548. A_UINT32 tag : 12, /* BIT [11 : 0] */
  549. length : 12, /* BIT [23 : 12] */
  550. reserved : 8; /* BIT [31 : 24] */
  551. };
  552. };
  553. } htt_tlv_hdr_t;
  554. /** HTT stats TLV tag values */
  555. typedef enum {
  556. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  557. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  558. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  559. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  560. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  561. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  562. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  563. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  564. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  565. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  566. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  567. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  568. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  569. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  570. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  571. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  572. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  573. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  574. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  575. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  576. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  577. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  578. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  579. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  580. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  581. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  582. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  583. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  584. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  585. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  586. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  587. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  588. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  589. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  590. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  591. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  592. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  593. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  594. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  595. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  596. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  597. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  598. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  599. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  600. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  601. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  602. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  603. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  604. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  605. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  606. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  607. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  608. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  609. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  610. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  611. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  612. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  613. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  614. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  615. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  616. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  617. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  618. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  619. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  620. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  621. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  622. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  623. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  624. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  625. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  626. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  627. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  628. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  629. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  630. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  631. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  632. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  633. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  634. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  635. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  636. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  637. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  638. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  639. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  640. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  641. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  642. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  643. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  644. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  645. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  646. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  647. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  648. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  649. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  650. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  651. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  652. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  653. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  654. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  655. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  656. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  657. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  658. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  659. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  660. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  661. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  662. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  663. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  664. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  665. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  666. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  667. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  668. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  669. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  670. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  671. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  672. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  673. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  674. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  675. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  676. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  677. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  678. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  679. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  680. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  681. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  682. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  683. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  684. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  685. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  686. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  687. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  688. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  689. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  690. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  691. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  692. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  693. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  694. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  696. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  697. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  698. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  699. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  700. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  701. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  702. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  703. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  704. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  705. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  711. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  712. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  713. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  714. HTT_STATS_MAX_TAG,
  715. } htt_stats_tlv_tag_t;
  716. /* retain deprecated enum name as an alias for the current enum name */
  717. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  718. #define HTT_STATS_TLV_TAG_M 0x00000fff
  719. #define HTT_STATS_TLV_TAG_S 0
  720. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  721. #define HTT_STATS_TLV_LENGTH_S 12
  722. #define HTT_STATS_TLV_TAG_GET(_var) \
  723. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  724. HTT_STATS_TLV_TAG_S)
  725. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  726. do { \
  727. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  728. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  729. } while (0)
  730. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  731. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  732. HTT_STATS_TLV_LENGTH_S)
  733. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  734. do { \
  735. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  736. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  737. } while (0)
  738. /*=== host -> target messages ===============================================*/
  739. enum htt_h2t_msg_type {
  740. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  741. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  742. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  743. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  744. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  745. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  746. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  747. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  748. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  749. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  750. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  751. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  752. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  753. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  754. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  755. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  756. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  757. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  758. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  759. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  760. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  761. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  762. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  763. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  764. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  765. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  766. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  767. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  768. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  769. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  770. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  771. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  772. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  773. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  774. /* keep this last */
  775. HTT_H2T_NUM_MSGS
  776. };
  777. /*
  778. * HTT host to target message type -
  779. * stored in bits 7:0 of the first word of the message
  780. */
  781. #define HTT_H2T_MSG_TYPE_M 0xff
  782. #define HTT_H2T_MSG_TYPE_S 0
  783. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  784. do { \
  785. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  786. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  787. } while (0)
  788. #define HTT_H2T_MSG_TYPE_GET(word) \
  789. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  790. /**
  791. * @brief host -> target version number request message definition
  792. *
  793. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  794. *
  795. *
  796. * |31 24|23 16|15 8|7 0|
  797. * |----------------+----------------+----------------+----------------|
  798. * | reserved | msg type |
  799. * |-------------------------------------------------------------------|
  800. * : option request TLV (optional) |
  801. * :...................................................................:
  802. *
  803. * The VER_REQ message may consist of a single 4-byte word, or may be
  804. * extended with TLVs that specify which HTT options the host is requesting
  805. * from the target.
  806. * The following option TLVs may be appended to the VER_REQ message:
  807. * - HL_SUPPRESS_TX_COMPL_IND
  808. * - HL_MAX_TX_QUEUE_GROUPS
  809. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  810. * may be appended to the VER_REQ message (but only one TLV of each type).
  811. *
  812. * Header fields:
  813. * - MSG_TYPE
  814. * Bits 7:0
  815. * Purpose: identifies this as a version number request message
  816. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  817. */
  818. #define HTT_VER_REQ_BYTES 4
  819. /* TBDXXX: figure out a reasonable number */
  820. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  821. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  822. /**
  823. * @brief HTT tx MSDU descriptor
  824. *
  825. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  826. *
  827. * @details
  828. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  829. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  830. * the target firmware needs for the FW's tx processing, particularly
  831. * for creating the HW msdu descriptor.
  832. * The same HTT tx descriptor is used for HL and LL systems, though
  833. * a few fields within the tx descriptor are used only by LL or
  834. * only by HL.
  835. * The HTT tx descriptor is defined in two manners: by a struct with
  836. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  837. * definitions.
  838. * The target should use the struct def, for simplicitly and clarity,
  839. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  840. * neutral. Specifically, the host shall use the get/set macros built
  841. * around the mask + shift defs.
  842. */
  843. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  844. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  845. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  846. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  847. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  848. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  849. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  850. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  851. #define HTT_TX_VDEV_ID_WORD 0
  852. #define HTT_TX_VDEV_ID_MASK 0x3f
  853. #define HTT_TX_VDEV_ID_SHIFT 16
  854. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  855. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  856. #define HTT_TX_MSDU_LEN_DWORD 1
  857. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  858. /*
  859. * HTT_VAR_PADDR macros
  860. * Allow physical / bus addresses to be either a single 32-bit value,
  861. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  862. */
  863. #define HTT_VAR_PADDR32(var_name) \
  864. A_UINT32 var_name
  865. #define HTT_VAR_PADDR64_LE(var_name) \
  866. struct { \
  867. /* little-endian: lo precedes hi */ \
  868. A_UINT32 lo; \
  869. A_UINT32 hi; \
  870. } var_name
  871. /*
  872. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  873. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  874. * addresses are stored in a XXX-bit field.
  875. * This macro is used to define both htt_tx_msdu_desc32_t and
  876. * htt_tx_msdu_desc64_t structs.
  877. */
  878. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  879. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  880. { \
  881. /* DWORD 0: flags and meta-data */ \
  882. A_UINT32 \
  883. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  884. \
  885. /* pkt_subtype - \
  886. * Detailed specification of the tx frame contents, extending the \
  887. * general specification provided by pkt_type. \
  888. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  889. * pkt_type | pkt_subtype \
  890. * ============================================================== \
  891. * 802.3 | bit 0:3 - Reserved \
  892. * | bit 4: 0x0 - Copy-Engine Classification Results \
  893. * | not appended to the HTT message \
  894. * | 0x1 - Copy-Engine Classification Results \
  895. * | appended to the HTT message in the \
  896. * | format: \
  897. * | [HTT tx desc, frame header, \
  898. * | CE classification results] \
  899. * | The CE classification results begin \
  900. * | at the next 4-byte boundary after \
  901. * | the frame header. \
  902. * ------------+------------------------------------------------- \
  903. * Eth2 | bit 0:3 - Reserved \
  904. * | bit 4: 0x0 - Copy-Engine Classification Results \
  905. * | not appended to the HTT message \
  906. * | 0x1 - Copy-Engine Classification Results \
  907. * | appended to the HTT message. \
  908. * | See the above specification of the \
  909. * | CE classification results location. \
  910. * ------------+------------------------------------------------- \
  911. * native WiFi | bit 0:3 - Reserved \
  912. * | bit 4: 0x0 - Copy-Engine Classification Results \
  913. * | not appended to the HTT message \
  914. * | 0x1 - Copy-Engine Classification Results \
  915. * | appended to the HTT message. \
  916. * | See the above specification of the \
  917. * | CE classification results location. \
  918. * ------------+------------------------------------------------- \
  919. * mgmt | 0x0 - 802.11 MAC header absent \
  920. * | 0x1 - 802.11 MAC header present \
  921. * ------------+------------------------------------------------- \
  922. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  923. * | 0x1 - 802.11 MAC header present \
  924. * | bit 1: 0x0 - allow aggregation \
  925. * | 0x1 - don't allow aggregation \
  926. * | bit 2: 0x0 - perform encryption \
  927. * | 0x1 - don't perform encryption \
  928. * | bit 3: 0x0 - perform tx classification / queuing \
  929. * | 0x1 - don't perform tx classification; \
  930. * | insert the frame into the "misc" \
  931. * | tx queue \
  932. * | bit 4: 0x0 - Copy-Engine Classification Results \
  933. * | not appended to the HTT message \
  934. * | 0x1 - Copy-Engine Classification Results \
  935. * | appended to the HTT message. \
  936. * | See the above specification of the \
  937. * | CE classification results location. \
  938. */ \
  939. pkt_subtype: 5, \
  940. \
  941. /* pkt_type - \
  942. * General specification of the tx frame contents. \
  943. * The htt_pkt_type enum should be used to specify and check the \
  944. * value of this field. \
  945. */ \
  946. pkt_type: 3, \
  947. \
  948. /* vdev_id - \
  949. * ID for the vdev that is sending this tx frame. \
  950. * For certain non-standard packet types, e.g. pkt_type == raw \
  951. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  952. * This field is used primarily for determining where to queue \
  953. * broadcast and multicast frames. \
  954. */ \
  955. vdev_id: 6, \
  956. /* ext_tid - \
  957. * The extended traffic ID. \
  958. * If the TID is unknown, the extended TID is set to \
  959. * HTT_TX_EXT_TID_INVALID. \
  960. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  961. * value of the QoS TID. \
  962. * If the tx frame is non-QoS data, then the extended TID is set to \
  963. * HTT_TX_EXT_TID_NON_QOS. \
  964. * If the tx frame is multicast or broadcast, then the extended TID \
  965. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  966. */ \
  967. ext_tid: 5, \
  968. \
  969. /* postponed - \
  970. * This flag indicates whether the tx frame has been downloaded to \
  971. * the target before but discarded by the target, and now is being \
  972. * downloaded again; or if this is a new frame that is being \
  973. * downloaded for the first time. \
  974. * This flag allows the target to determine the correct order for \
  975. * transmitting new vs. old frames. \
  976. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  977. * This flag only applies to HL systems, since in LL systems, \
  978. * the tx flow control is handled entirely within the target. \
  979. */ \
  980. postponed: 1, \
  981. \
  982. /* extension - \
  983. * This flag indicates whether a HTT tx MSDU extension descriptor \
  984. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  985. * \
  986. * 0x0 - no extension MSDU descriptor is present \
  987. * 0x1 - an extension MSDU descriptor immediately follows the \
  988. * regular MSDU descriptor \
  989. */ \
  990. extension: 1, \
  991. \
  992. /* cksum_offload - \
  993. * This flag indicates whether checksum offload is enabled or not \
  994. * for this frame. Target FW use this flag to turn on HW checksumming \
  995. * 0x0 - No checksum offload \
  996. * 0x1 - L3 header checksum only \
  997. * 0x2 - L4 checksum only \
  998. * 0x3 - L3 header checksum + L4 checksum \
  999. */ \
  1000. cksum_offload: 2, \
  1001. \
  1002. /* tx_comp_req - \
  1003. * This flag indicates whether Tx Completion \
  1004. * from fw is required or not. \
  1005. * This flag is only relevant if tx completion is not \
  1006. * universally enabled. \
  1007. * For all LL systems, tx completion is mandatory, \
  1008. * so this flag will be irrelevant. \
  1009. * For HL systems tx completion is optional, but HL systems in which \
  1010. * the bus throughput exceeds the WLAN throughput will \
  1011. * probably want to always use tx completion, and thus \
  1012. * would not check this flag. \
  1013. * This flag is required when tx completions are not used universally, \
  1014. * but are still required for certain tx frames for which \
  1015. * an OTA delivery acknowledgment is needed by the host. \
  1016. * In practice, this would be for HL systems in which the \
  1017. * bus throughput is less than the WLAN throughput. \
  1018. * \
  1019. * 0x0 - Tx Completion Indication from Fw not required \
  1020. * 0x1 - Tx Completion Indication from Fw is required \
  1021. */ \
  1022. tx_compl_req: 1; \
  1023. \
  1024. \
  1025. /* DWORD 1: MSDU length and ID */ \
  1026. A_UINT32 \
  1027. len: 16, /* MSDU length, in bytes */ \
  1028. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1029. * and this id is used to calculate fragmentation \
  1030. * descriptor pointer inside the target based on \
  1031. * the base address, configured inside the target. \
  1032. */ \
  1033. \
  1034. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1035. /* frags_desc_ptr - \
  1036. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1037. * where the tx frame's fragments reside in memory. \
  1038. * This field only applies to LL systems, since in HL systems the \
  1039. * (degenerate single-fragment) fragmentation descriptor is created \
  1040. * within the target. \
  1041. */ \
  1042. _paddr__frags_desc_ptr_; \
  1043. \
  1044. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1045. /* \
  1046. * Peer ID : Target can use this value to know which peer-id packet \
  1047. * destined to. \
  1048. * It's intended to be specified by host in case of NAWDS. \
  1049. */ \
  1050. A_UINT16 peerid; \
  1051. \
  1052. /* \
  1053. * Channel frequency: This identifies the desired channel \
  1054. * frequency (in mhz) for tx frames. This is used by FW to help \
  1055. * determine when it is safe to transmit or drop frames for \
  1056. * off-channel operation. \
  1057. * The default value of zero indicates to FW that the corresponding \
  1058. * VDEV's home channel (if there is one) is the desired channel \
  1059. * frequency. \
  1060. */ \
  1061. A_UINT16 chanfreq; \
  1062. \
  1063. /* Reason reserved is commented is increasing the htt structure size \
  1064. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1065. * A_UINT32 reserved_dword3_bits0_31; \
  1066. */ \
  1067. } POSTPACK
  1068. /* define a htt_tx_msdu_desc32_t type */
  1069. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1070. /* define a htt_tx_msdu_desc64_t type */
  1071. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1072. /*
  1073. * Make htt_tx_msdu_desc_t be an alias for either
  1074. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1075. */
  1076. #if HTT_PADDR64
  1077. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1078. #else
  1079. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1080. #endif
  1081. /* decriptor information for Management frame*/
  1082. /*
  1083. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1084. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1085. */
  1086. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1087. extern A_UINT32 mgmt_hdr_len;
  1088. PREPACK struct htt_mgmt_tx_desc_t {
  1089. A_UINT32 msg_type;
  1090. #if HTT_PADDR64
  1091. A_UINT64 frag_paddr; /* DMAble address of the data */
  1092. #else
  1093. A_UINT32 frag_paddr; /* DMAble address of the data */
  1094. #endif
  1095. A_UINT32 desc_id; /* returned to host during completion
  1096. * to free the meory*/
  1097. A_UINT32 len; /* Fragment length */
  1098. A_UINT32 vdev_id; /* virtual device ID*/
  1099. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1100. } POSTPACK;
  1101. PREPACK struct htt_mgmt_tx_compl_ind {
  1102. A_UINT32 desc_id;
  1103. A_UINT32 status;
  1104. } POSTPACK;
  1105. /*
  1106. * This SDU header size comes from the summation of the following:
  1107. * 1. Max of:
  1108. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1109. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1110. * b. 802.11 header, for raw frames: 36 bytes
  1111. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1112. * QoS header, HT header)
  1113. * c. 802.3 header, for ethernet frames: 14 bytes
  1114. * (destination address, source address, ethertype / length)
  1115. * 2. Max of:
  1116. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1117. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1118. * 3. 802.1Q VLAN header: 4 bytes
  1119. * 4. LLC/SNAP header: 8 bytes
  1120. */
  1121. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1122. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1123. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1124. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1125. A_COMPILE_TIME_ASSERT(
  1126. htt_encap_hdr_size_max_check_nwifi,
  1127. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1128. A_COMPILE_TIME_ASSERT(
  1129. htt_encap_hdr_size_max_check_enet,
  1130. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1131. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1132. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1133. #define HTT_TX_HDR_SIZE_802_1Q 4
  1134. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1135. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1136. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1137. HTT_TX_HDR_SIZE_802_1Q + \
  1138. HTT_TX_HDR_SIZE_LLC_SNAP)
  1139. #define HTT_HL_TX_FRM_HDR_LEN \
  1140. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1141. #define HTT_LL_TX_FRM_HDR_LEN \
  1142. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1143. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1144. /* dword 0 */
  1145. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1146. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1147. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1148. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1149. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1150. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1151. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1152. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1153. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1154. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1155. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1156. #define HTT_TX_DESC_PKT_TYPE_S 13
  1157. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1158. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1159. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1160. #define HTT_TX_DESC_VDEV_ID_S 16
  1161. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1162. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1163. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1164. #define HTT_TX_DESC_EXT_TID_S 22
  1165. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1166. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1167. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1168. #define HTT_TX_DESC_POSTPONED_S 27
  1169. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1170. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1171. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1172. #define HTT_TX_DESC_EXTENSION_S 28
  1173. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1174. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1175. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1176. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1177. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1178. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1179. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1180. #define HTT_TX_DESC_TX_COMP_S 31
  1181. /* dword 1 */
  1182. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1183. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1184. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1185. #define HTT_TX_DESC_FRM_LEN_S 0
  1186. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1187. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1188. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1189. #define HTT_TX_DESC_FRM_ID_S 16
  1190. /* dword 2 */
  1191. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1192. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1193. /* for systems using 64-bit format for bus addresses */
  1194. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1195. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1196. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1197. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1198. /* for systems using 32-bit format for bus addresses */
  1199. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1200. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1201. /* dword 3 */
  1202. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1203. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1204. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1205. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1206. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1207. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1208. #if HTT_PADDR64
  1209. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1210. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1211. #else
  1212. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1213. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1214. #endif
  1215. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1216. #define HTT_TX_DESC_PEER_ID_S 0
  1217. /*
  1218. * TEMPORARY:
  1219. * The original definitions for the PEER_ID fields contained typos
  1220. * (with _DESC_PADDR appended to this PEER_ID field name).
  1221. * Retain deprecated original names for PEER_ID fields until all code that
  1222. * refers to them has been updated.
  1223. */
  1224. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1225. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1226. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1227. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1228. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1229. HTT_TX_DESC_PEER_ID_M
  1230. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1231. HTT_TX_DESC_PEER_ID_S
  1232. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1233. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1234. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1235. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1236. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1237. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1238. #if HTT_PADDR64
  1239. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1240. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1241. #else
  1242. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1243. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1244. #endif
  1245. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1246. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1247. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1248. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1249. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1250. do { \
  1251. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1252. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1253. } while (0)
  1254. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1255. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1256. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1259. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1260. } while (0)
  1261. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1262. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1263. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1264. do { \
  1265. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1266. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1267. } while (0)
  1268. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1269. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1270. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1271. do { \
  1272. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1273. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1274. } while (0)
  1275. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1276. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1277. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1278. do { \
  1279. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1280. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1281. } while (0)
  1282. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1283. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1284. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1288. } while (0)
  1289. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1290. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1291. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1295. } while (0)
  1296. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1297. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1298. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1302. } while (0)
  1303. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1304. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1305. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1306. do { \
  1307. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1308. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1309. } while (0)
  1310. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1311. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1312. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1313. do { \
  1314. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1315. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1316. } while (0)
  1317. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1318. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1319. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1323. } while (0)
  1324. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1325. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1326. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1330. } while (0)
  1331. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1332. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1333. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1336. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1337. } while (0)
  1338. /* enums used in the HTT tx MSDU extension descriptor */
  1339. enum {
  1340. htt_tx_guard_interval_regular = 0,
  1341. htt_tx_guard_interval_short = 1,
  1342. };
  1343. enum {
  1344. htt_tx_preamble_type_ofdm = 0,
  1345. htt_tx_preamble_type_cck = 1,
  1346. htt_tx_preamble_type_ht = 2,
  1347. htt_tx_preamble_type_vht = 3,
  1348. };
  1349. enum {
  1350. htt_tx_bandwidth_5MHz = 0,
  1351. htt_tx_bandwidth_10MHz = 1,
  1352. htt_tx_bandwidth_20MHz = 2,
  1353. htt_tx_bandwidth_40MHz = 3,
  1354. htt_tx_bandwidth_80MHz = 4,
  1355. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1356. };
  1357. /**
  1358. * @brief HTT tx MSDU extension descriptor
  1359. * @details
  1360. * If the target supports HTT tx MSDU extension descriptors, the host has
  1361. * the option of appending the following struct following the regular
  1362. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1363. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1364. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1365. * tx specs for each frame.
  1366. */
  1367. PREPACK struct htt_tx_msdu_desc_ext_t {
  1368. /* DWORD 0: flags */
  1369. A_UINT32
  1370. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1371. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1372. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1373. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1374. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1375. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1376. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1377. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1378. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1379. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1380. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1381. /* DWORD 1: tx power, tx rate, tx BW */
  1382. A_UINT32
  1383. /* pwr -
  1384. * Specify what power the tx frame needs to be transmitted at.
  1385. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1386. * The value needs to be appropriately sign-extended when extracting
  1387. * the value from the message and storing it in a variable that is
  1388. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1389. * automatically handles this sign-extension.)
  1390. * If the transmission uses multiple tx chains, this power spec is
  1391. * the total transmit power, assuming incoherent combination of
  1392. * per-chain power to produce the total power.
  1393. */
  1394. pwr: 8,
  1395. /* mcs_mask -
  1396. * Specify the allowable values for MCS index (modulation and coding)
  1397. * to use for transmitting the frame.
  1398. *
  1399. * For HT / VHT preamble types, this mask directly corresponds to
  1400. * the HT or VHT MCS indices that are allowed. For each bit N set
  1401. * within the mask, MCS index N is allowed for transmitting the frame.
  1402. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1403. * rates versus OFDM rates, so the host has the option of specifying
  1404. * that the target must transmit the frame with CCK or OFDM rates
  1405. * (not HT or VHT), but leaving the decision to the target whether
  1406. * to use CCK or OFDM.
  1407. *
  1408. * For CCK and OFDM, the bits within this mask are interpreted as
  1409. * follows:
  1410. * bit 0 -> CCK 1 Mbps rate is allowed
  1411. * bit 1 -> CCK 2 Mbps rate is allowed
  1412. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1413. * bit 3 -> CCK 11 Mbps rate is allowed
  1414. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1415. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1416. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1417. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1418. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1419. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1420. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1421. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1422. *
  1423. * The MCS index specification needs to be compatible with the
  1424. * bandwidth mask specification. For example, a MCS index == 9
  1425. * specification is inconsistent with a preamble type == VHT,
  1426. * Nss == 1, and channel bandwidth == 20 MHz.
  1427. *
  1428. * Furthermore, the host has only a limited ability to specify to
  1429. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1430. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1431. */
  1432. mcs_mask: 12,
  1433. /* nss_mask -
  1434. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1435. * Each bit in this mask corresponds to a Nss value:
  1436. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1437. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1438. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1439. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1440. * The values in the Nss mask must be suitable for the recipient, e.g.
  1441. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1442. * recipient which only supports 2x2 MIMO.
  1443. */
  1444. nss_mask: 4,
  1445. /* guard_interval -
  1446. * Specify a htt_tx_guard_interval enum value to indicate whether
  1447. * the transmission should use a regular guard interval or a
  1448. * short guard interval.
  1449. */
  1450. guard_interval: 1,
  1451. /* preamble_type_mask -
  1452. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1453. * may choose from for transmitting this frame.
  1454. * The bits in this mask correspond to the values in the
  1455. * htt_tx_preamble_type enum. For example, to allow the target
  1456. * to transmit the frame as either CCK or OFDM, this field would
  1457. * be set to
  1458. * (1 << htt_tx_preamble_type_ofdm) |
  1459. * (1 << htt_tx_preamble_type_cck)
  1460. */
  1461. preamble_type_mask: 4,
  1462. reserved1_31_29: 3; /* unused, set to 0x0 */
  1463. /* DWORD 2: tx chain mask, tx retries */
  1464. A_UINT32
  1465. /* chain_mask - specify which chains to transmit from */
  1466. chain_mask: 4,
  1467. /* retry_limit -
  1468. * Specify the maximum number of transmissions, including the
  1469. * initial transmission, to attempt before giving up if no ack
  1470. * is received.
  1471. * If the tx rate is specified, then all retries shall use the
  1472. * same rate as the initial transmission.
  1473. * If no tx rate is specified, the target can choose whether to
  1474. * retain the original rate during the retransmissions, or to
  1475. * fall back to a more robust rate.
  1476. */
  1477. retry_limit: 4,
  1478. /* bandwidth_mask -
  1479. * Specify what channel widths may be used for the transmission.
  1480. * A value of zero indicates "don't care" - the target may choose
  1481. * the transmission bandwidth.
  1482. * The bits within this mask correspond to the htt_tx_bandwidth
  1483. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1484. * The bandwidth_mask must be consistent with the preamble_type_mask
  1485. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1486. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1487. */
  1488. bandwidth_mask: 6,
  1489. reserved2_31_14: 18; /* unused, set to 0x0 */
  1490. /* DWORD 3: tx expiry time (TSF) LSBs */
  1491. A_UINT32 expire_tsf_lo;
  1492. /* DWORD 4: tx expiry time (TSF) MSBs */
  1493. A_UINT32 expire_tsf_hi;
  1494. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1495. } POSTPACK;
  1496. /* DWORD 0 */
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1498. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1499. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1500. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1503. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1504. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1517. /* DWORD 1 */
  1518. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1519. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1520. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1521. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1522. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1523. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1524. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1525. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1526. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1527. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1528. /* DWORD 2 */
  1529. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1530. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1531. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1532. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1533. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1534. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1535. /* DWORD 0 */
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1537. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1538. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1540. do { \
  1541. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1542. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1543. } while (0)
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1545. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1546. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1548. do { \
  1549. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1550. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1551. } while (0)
  1552. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1553. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1554. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1556. do { \
  1557. HTT_CHECK_SET_VAL( \
  1558. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1559. ((_var) |= ((_val) \
  1560. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1561. } while (0)
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1563. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1564. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1565. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1566. do { \
  1567. HTT_CHECK_SET_VAL( \
  1568. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1569. ((_var) |= ((_val) \
  1570. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1571. } while (0)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1573. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1574. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1575. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1576. do { \
  1577. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1578. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1579. } while (0)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1582. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1583. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1584. do { \
  1585. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1586. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1587. } while (0)
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1590. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1591. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1592. do { \
  1593. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1594. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1595. } while (0)
  1596. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1597. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1598. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1599. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1600. do { \
  1601. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1602. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1603. } while (0)
  1604. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1605. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1606. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1607. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1608. do { \
  1609. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1610. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1611. } while (0)
  1612. /* DWORD 1 */
  1613. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1614. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1615. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1616. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1617. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1618. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1619. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1620. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1621. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1622. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1624. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1625. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1628. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1629. } while (0)
  1630. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1631. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1632. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1633. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1634. do { \
  1635. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1636. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1637. } while (0)
  1638. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1640. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1641. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1642. do { \
  1643. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1644. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1645. } while (0)
  1646. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1647. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1648. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1649. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1650. do { \
  1651. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1652. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1653. } while (0)
  1654. /* DWORD 2 */
  1655. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1656. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1657. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1658. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1659. do { \
  1660. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1661. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1662. } while (0)
  1663. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1664. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1665. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1666. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1667. do { \
  1668. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1669. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1673. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1674. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1678. } while (0)
  1679. typedef enum {
  1680. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1681. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1682. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1683. } htt_11ax_ltf_subtype_t;
  1684. typedef enum {
  1685. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1686. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1687. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1688. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1689. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1690. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1691. } htt_tx_ext2_preamble_type_t;
  1692. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1693. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1694. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1695. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1696. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1697. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1698. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1699. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1700. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1701. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1702. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1703. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1704. /**
  1705. * @brief HTT tx MSDU extension descriptor v2
  1706. * @details
  1707. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1708. * is received as tcl_exit_base->host_meta_info in firmware.
  1709. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1710. * are already part of tcl_exit_base.
  1711. */
  1712. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1713. /* DWORD 0: flags */
  1714. A_UINT32
  1715. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1716. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1717. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1718. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1719. valid_retries : 1, /* if set, tx retries spec is valid */
  1720. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1721. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1722. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1723. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1724. valid_key_flags : 1, /* if set, key flags is valid */
  1725. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1726. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1727. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1728. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1729. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1730. 1 = ENCRYPT,
  1731. 2 ~ 3 - Reserved */
  1732. /* retry_limit -
  1733. * Specify the maximum number of transmissions, including the
  1734. * initial transmission, to attempt before giving up if no ack
  1735. * is received.
  1736. * If the tx rate is specified, then all retries shall use the
  1737. * same rate as the initial transmission.
  1738. * If no tx rate is specified, the target can choose whether to
  1739. * retain the original rate during the retransmissions, or to
  1740. * fall back to a more robust rate.
  1741. */
  1742. retry_limit : 4,
  1743. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1744. * Valid only for 11ax preamble types HE_SU
  1745. * and HE_EXT_SU
  1746. */
  1747. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1748. * Valid only for 11ax preamble types HE_SU
  1749. * and HE_EXT_SU
  1750. */
  1751. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1752. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1753. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1754. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1755. */
  1756. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1757. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1758. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1759. * Use cases:
  1760. * Any time firmware uses TQM-BYPASS for Data
  1761. * TID, firmware expect host to set this bit.
  1762. */
  1763. /* DWORD 1: tx power, tx rate */
  1764. A_UINT32
  1765. power : 8, /* unit of the power field is 0.5 dbm
  1766. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1767. * signed value ranging from -64dbm to 63.5 dbm
  1768. */
  1769. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1770. * Setting more than one MCS isn't currently
  1771. * supported by the target (but is supported
  1772. * in the interface in case in the future
  1773. * the target supports specifications of
  1774. * a limited set of MCS values.
  1775. */
  1776. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1777. * Setting more than one Nss isn't currently
  1778. * supported by the target (but is supported
  1779. * in the interface in case in the future
  1780. * the target supports specifications of
  1781. * a limited set of Nss values.
  1782. */
  1783. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1784. update_peer_cache : 1; /* When set these custom values will be
  1785. * used for all packets, until the next
  1786. * update via this ext header.
  1787. * This is to make sure not all packets
  1788. * need to include this header.
  1789. */
  1790. /* DWORD 2: tx chain mask, tx retries */
  1791. A_UINT32
  1792. /* chain_mask - specify which chains to transmit from */
  1793. chain_mask : 8,
  1794. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1795. * TODO: Update Enum values for key_flags
  1796. */
  1797. /*
  1798. * Channel frequency: This identifies the desired channel
  1799. * frequency (in MHz) for tx frames. This is used by FW to help
  1800. * determine when it is safe to transmit or drop frames for
  1801. * off-channel operation.
  1802. * The default value of zero indicates to FW that the corresponding
  1803. * VDEV's home channel (if there is one) is the desired channel
  1804. * frequency.
  1805. */
  1806. chanfreq : 16;
  1807. /* DWORD 3: tx expiry time (TSF) LSBs */
  1808. A_UINT32 expire_tsf_lo;
  1809. /* DWORD 4: tx expiry time (TSF) MSBs */
  1810. A_UINT32 expire_tsf_hi;
  1811. /* DWORD 5: flags to control routing / processing of the MSDU */
  1812. A_UINT32
  1813. /* learning_frame
  1814. * When this flag is set, this frame will be dropped by FW
  1815. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1816. */
  1817. learning_frame : 1,
  1818. /* send_as_standalone
  1819. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1820. * i.e. with no A-MSDU or A-MPDU aggregation.
  1821. * The scope is extended to other use-cases.
  1822. */
  1823. send_as_standalone : 1,
  1824. /* is_host_opaque_valid
  1825. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1826. * with valid information.
  1827. */
  1828. is_host_opaque_valid : 1,
  1829. traffic_end_indication: 1,
  1830. rsvd0 : 28;
  1831. /* DWORD 6 : Host opaque cookie for special frames */
  1832. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1833. rsvd1 : 16;
  1834. /*
  1835. * This structure can be expanded further up to 40 bytes
  1836. * by adding further DWORDs as needed.
  1837. */
  1838. } POSTPACK;
  1839. /* DWORD 0 */
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1846. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1847. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1850. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1866. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1867. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1868. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1869. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1870. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1871. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1872. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1873. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1874. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1875. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1876. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1877. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1878. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1879. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1880. /* DWORD 1 */
  1881. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1882. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1883. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1884. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1885. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1886. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1887. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1888. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1889. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1890. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1891. /* DWORD 2 */
  1892. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1893. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1894. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1895. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1896. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1897. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1898. /* DWORD 5 */
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1905. /* DWORD 6 */
  1906. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1907. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1908. /* DWORD 0 */
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1910. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1911. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1915. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1916. } while (0)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1918. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1919. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1923. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1924. } while (0)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1926. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1927. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1931. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1932. } while (0)
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1934. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1935. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1937. do { \
  1938. HTT_CHECK_SET_VAL( \
  1939. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1940. ((_var) |= ((_val) \
  1941. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1942. } while (0)
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1944. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1945. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1946. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1949. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1950. } while (0)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1952. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1953. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1957. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1958. } while (0)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1960. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1961. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL( \
  1965. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1966. ((_var) |= ((_val) \
  1967. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1968. } while (0)
  1969. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1970. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1971. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1972. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1975. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1976. } while (0)
  1977. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1978. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1979. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1980. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1983. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1984. } while (0)
  1985. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1986. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1987. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1991. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1992. } while (0)
  1993. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1994. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1995. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1996. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1997. do { \
  1998. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1999. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2000. } while (0)
  2001. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2002. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2003. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2004. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2005. do { \
  2006. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2007. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2008. } while (0)
  2009. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2010. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2011. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2012. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2013. do { \
  2014. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2015. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2016. } while (0)
  2017. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2018. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2019. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2020. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2021. do { \
  2022. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2023. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2024. } while (0)
  2025. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2026. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2027. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2028. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2031. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2032. } while (0)
  2033. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2034. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2035. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2036. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2037. do { \
  2038. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2039. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2040. } while (0)
  2041. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2042. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2043. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2044. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2045. do { \
  2046. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2047. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2048. } while (0)
  2049. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2050. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2051. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2052. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2053. do { \
  2054. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2055. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2056. } while (0)
  2057. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2058. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2059. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2060. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2064. } while (0)
  2065. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2066. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2067. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2068. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2072. } while (0)
  2073. /* DWORD 1 */
  2074. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2075. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2076. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2077. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2078. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2079. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2080. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2081. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2082. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2083. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2084. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2085. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2086. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2090. } while (0)
  2091. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2092. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2093. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2094. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2098. } while (0)
  2099. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2100. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2101. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2102. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2103. do { \
  2104. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2105. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2106. } while (0)
  2107. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2108. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2109. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2110. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2111. do { \
  2112. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2113. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2114. } while (0)
  2115. /* DWORD 2 */
  2116. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2117. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2118. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2119. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2120. do { \
  2121. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2122. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2123. } while (0)
  2124. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2125. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2126. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2127. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2128. do { \
  2129. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2130. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2131. } while (0)
  2132. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2133. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2134. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2135. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2136. do { \
  2137. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2138. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2139. } while (0)
  2140. /* DWORD 5 */
  2141. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2142. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2143. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2144. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2145. do { \
  2146. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2147. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2148. } while (0)
  2149. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2150. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2151. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2152. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2153. do { \
  2154. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2155. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2156. } while (0)
  2157. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2158. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2159. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2160. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2161. do { \
  2162. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2163. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2164. } while (0)
  2165. /* DWORD 6 */
  2166. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2167. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2168. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2169. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2173. } while (0)
  2174. typedef enum {
  2175. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2176. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2177. } htt_tcl_metadata_type;
  2178. /**
  2179. * @brief HTT TCL command number format
  2180. * @details
  2181. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2182. * available to firmware as tcl_exit_base->tcl_status_number.
  2183. * For regular / multicast packets host will send vdev and mac id and for
  2184. * NAWDS packets, host will send peer id.
  2185. * A_UINT32 is used to avoid endianness conversion problems.
  2186. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2187. */
  2188. typedef struct {
  2189. A_UINT32
  2190. type: 1, /* vdev_id based or peer_id based */
  2191. rsvd: 31;
  2192. } htt_tx_tcl_vdev_or_peer_t;
  2193. typedef struct {
  2194. A_UINT32
  2195. type: 1, /* vdev_id based or peer_id based */
  2196. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2197. vdev_id: 8,
  2198. pdev_id: 2,
  2199. host_inspected:1,
  2200. rsvd: 19;
  2201. } htt_tx_tcl_vdev_metadata;
  2202. typedef struct {
  2203. A_UINT32
  2204. type: 1, /* vdev_id based or peer_id based */
  2205. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2206. peer_id: 14,
  2207. rsvd: 16;
  2208. } htt_tx_tcl_peer_metadata;
  2209. PREPACK struct htt_tx_tcl_metadata {
  2210. union {
  2211. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2212. htt_tx_tcl_vdev_metadata vdev_meta;
  2213. htt_tx_tcl_peer_metadata peer_meta;
  2214. };
  2215. } POSTPACK;
  2216. /* DWORD 0 */
  2217. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2218. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2219. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2220. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2221. /* VDEV metadata */
  2222. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2223. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2224. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2225. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2226. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2227. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2228. /* PEER metadata */
  2229. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2230. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2231. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2232. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2233. HTT_TX_TCL_METADATA_TYPE_S)
  2234. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2235. do { \
  2236. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2237. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2238. } while (0)
  2239. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2240. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2241. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2242. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2243. do { \
  2244. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2245. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2246. } while (0)
  2247. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2248. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2249. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2250. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2251. do { \
  2252. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2253. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2254. } while (0)
  2255. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2256. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2257. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2258. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2259. do { \
  2260. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2261. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2262. } while (0)
  2263. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2264. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2265. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2266. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2267. do { \
  2268. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2269. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2270. } while (0)
  2271. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2272. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2273. HTT_TX_TCL_METADATA_PEER_ID_S)
  2274. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2278. } while (0)
  2279. /*------------------------------------------------------------------
  2280. * V2 Version of TCL Data Command
  2281. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2282. * MLO global_seq all flavours of TCL Data Cmd.
  2283. *-----------------------------------------------------------------*/
  2284. typedef enum {
  2285. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2286. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2287. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2288. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2289. } htt_tcl_metadata_type_v2;
  2290. /**
  2291. * @brief HTT TCL command number format
  2292. * @details
  2293. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2294. * available to firmware as tcl_exit_base->tcl_status_number.
  2295. * A_UINT32 is used to avoid endianness conversion problems.
  2296. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2297. */
  2298. typedef struct {
  2299. A_UINT32
  2300. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2301. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2302. vdev_id: 8,
  2303. pdev_id: 2,
  2304. host_inspected:1,
  2305. rsvd: 2,
  2306. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2307. } htt_tx_tcl_vdev_metadata_v2;
  2308. typedef struct {
  2309. A_UINT32
  2310. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2311. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2312. peer_id: 13,
  2313. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2314. } htt_tx_tcl_peer_metadata_v2;
  2315. typedef struct {
  2316. A_UINT32
  2317. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2318. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2319. svc_class_id: 8,
  2320. rsvd: 5,
  2321. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2322. } htt_tx_tcl_svc_class_id_metadata;
  2323. typedef struct {
  2324. A_UINT32
  2325. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2326. host_inspected: 1,
  2327. global_seq_no: 12,
  2328. rsvd: 1,
  2329. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2330. } htt_tx_tcl_global_seq_metadata;
  2331. PREPACK struct htt_tx_tcl_metadata_v2 {
  2332. union {
  2333. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2334. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2335. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2336. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2337. };
  2338. } POSTPACK;
  2339. /* DWORD 0 */
  2340. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2341. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2342. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2343. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2344. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2345. /* VDEV V2 metadata */
  2346. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2347. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2348. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2349. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2350. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2351. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2352. /* PEER V2 metadata */
  2353. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2354. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2355. /* SVC_CLASS_ID metadata */
  2356. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2357. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2358. /* Global Seq no metadata */
  2359. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2360. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2361. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2362. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2363. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2364. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2365. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2366. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2367. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2368. do { \
  2369. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2370. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2371. } while (0)
  2372. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2373. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2374. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2375. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2376. do { \
  2377. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2378. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2379. } while (0)
  2380. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2381. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2382. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2383. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2384. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2385. do { \
  2386. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2387. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2388. } while (0)
  2389. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2390. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2391. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2392. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2393. do { \
  2394. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2395. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2396. } while (0)
  2397. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2398. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2399. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2400. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2401. do { \
  2402. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2403. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2404. } while (0)
  2405. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2406. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2407. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2408. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2409. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2410. do { \
  2411. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2412. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2413. } while (0)
  2414. /*----- Get and Set V2 type field in Service Class fields ----*/
  2415. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2416. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2417. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2418. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2419. do { \
  2420. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2421. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2422. } while (0)
  2423. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2424. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2425. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2426. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2427. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2428. do { \
  2429. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2430. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2431. } while (0)
  2432. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2433. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2434. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2435. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2439. } while (0)
  2440. /*------------------------------------------------------------------
  2441. * End V2 Version of TCL Data Command
  2442. *-----------------------------------------------------------------*/
  2443. typedef enum {
  2444. HTT_TX_FW2WBM_TX_STATUS_OK,
  2445. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2446. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2447. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2448. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2449. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2450. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2451. HTT_TX_FW2WBM_TX_STATUS_MAX
  2452. } htt_tx_fw2wbm_tx_status_t;
  2453. typedef enum {
  2454. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2455. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2456. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2457. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2458. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2459. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2460. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2461. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2462. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2463. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2464. } htt_tx_fw2wbm_reinject_reason_t;
  2465. /**
  2466. * @brief HTT TX WBM Completion from firmware to host
  2467. * @details
  2468. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2469. * DWORD 3 and 4 for software based completions (Exception frames and
  2470. * TQM bypass frames)
  2471. * For software based completions, wbm_release_ring->release_source_module will
  2472. * be set to release_source_fw
  2473. */
  2474. PREPACK struct htt_tx_wbm_completion {
  2475. A_UINT32
  2476. sch_cmd_id: 24,
  2477. exception_frame: 1, /* If set, this packet was queued via exception path */
  2478. rsvd0_31_25: 7;
  2479. A_UINT32
  2480. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2481. * reception of an ACK or BA, this field indicates
  2482. * the RSSI of the received ACK or BA frame.
  2483. * When the frame is removed as result of a direct
  2484. * remove command from the SW, this field is set
  2485. * to 0x0 (which is never a valid value when real
  2486. * RSSI is available).
  2487. * Units: dB w.r.t noise floor
  2488. */
  2489. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2490. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2491. rsvd1_31_16: 16;
  2492. } POSTPACK;
  2493. /* DWORD 0 */
  2494. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2495. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2496. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2497. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2498. /* DWORD 1 */
  2499. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2500. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2501. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2502. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2503. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2504. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2505. /* DWORD 0 */
  2506. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2507. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2508. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2509. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2510. do { \
  2511. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2512. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2513. } while (0)
  2514. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2515. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2516. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2517. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2518. do { \
  2519. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2520. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2521. } while (0)
  2522. /* DWORD 1 */
  2523. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2524. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2525. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2526. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2527. do { \
  2528. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2529. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2530. } while (0)
  2531. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2532. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2533. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2534. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2535. do { \
  2536. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2537. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2538. } while (0)
  2539. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2540. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2541. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2542. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2543. do { \
  2544. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2545. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2546. } while (0)
  2547. /**
  2548. * @brief HTT TX WBM Completion from firmware to host
  2549. * @details
  2550. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2551. * (WBM) offload HW.
  2552. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2553. * For software based completions, release_source_module will
  2554. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2555. * struct wbm_release_ring and then switch to this after looking at
  2556. * release_source_module.
  2557. */
  2558. PREPACK struct htt_tx_wbm_completion_v2 {
  2559. A_UINT32
  2560. used_by_hw0; /* Refer to struct wbm_release_ring */
  2561. A_UINT32
  2562. used_by_hw1; /* Refer to struct wbm_release_ring */
  2563. A_UINT32
  2564. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2565. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2566. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2567. exception_frame: 1,
  2568. rsvd0: 12, /* For future use */
  2569. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2570. rsvd1: 1; /* For future use */
  2571. A_UINT32
  2572. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2573. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2574. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2575. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2576. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2577. */
  2578. A_UINT32
  2579. data1: 32;
  2580. A_UINT32
  2581. data2: 32;
  2582. A_UINT32
  2583. used_by_hw3; /* Refer to struct wbm_release_ring */
  2584. } POSTPACK;
  2585. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2586. /* DWORD 3 */
  2587. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2588. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2589. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2590. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2591. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2592. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2593. /* DWORD 3 */
  2594. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2595. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2596. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2597. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2598. do { \
  2599. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2600. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2601. } while (0)
  2602. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2603. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2604. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2605. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2606. do { \
  2607. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2608. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2609. } while (0)
  2610. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2611. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2612. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2613. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2614. do { \
  2615. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2616. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2617. } while (0)
  2618. /**
  2619. * @brief HTT TX WBM Completion from firmware to host (V3)
  2620. * @details
  2621. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2622. * (WBM) offload HW.
  2623. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2624. * For software based completions, release_source_module will
  2625. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2626. * struct wbm_release_ring and then switch to this after looking at
  2627. * release_source_module.
  2628. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2629. * by new generations of targets.
  2630. */
  2631. PREPACK struct htt_tx_wbm_completion_v3 {
  2632. A_UINT32
  2633. used_by_hw0; /* Refer to struct wbm_release_ring */
  2634. A_UINT32
  2635. used_by_hw1; /* Refer to struct wbm_release_ring */
  2636. A_UINT32
  2637. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2638. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2639. used_by_hw3: 15;
  2640. A_UINT32
  2641. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2642. exception_frame: 1,
  2643. rsvd0: 27; /* For future use */
  2644. A_UINT32
  2645. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2646. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2647. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2648. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2649. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2650. */
  2651. A_UINT32
  2652. data1: 32;
  2653. A_UINT32
  2654. data2: 32;
  2655. A_UINT32
  2656. rsvd1: 20,
  2657. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2658. } POSTPACK;
  2659. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2660. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2661. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2662. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2663. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2664. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2665. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2666. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2667. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2668. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2669. do { \
  2670. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2671. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2672. } while (0)
  2673. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2674. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2675. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2676. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2677. do { \
  2678. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2679. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2680. } while (0)
  2681. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2682. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2683. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2684. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2685. do { \
  2686. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2687. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2688. } while (0)
  2689. typedef enum {
  2690. TX_FRAME_TYPE_UNDEFINED = 0,
  2691. TX_FRAME_TYPE_EAPOL = 1,
  2692. } htt_tx_wbm_status_frame_type;
  2693. /**
  2694. * @brief HTT TX WBM transmit status from firmware to host
  2695. * @details
  2696. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2697. * (WBM) offload HW.
  2698. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2699. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2700. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2701. */
  2702. PREPACK struct htt_tx_wbm_transmit_status {
  2703. A_UINT32
  2704. sch_cmd_id: 24,
  2705. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2706. * reception of an ACK or BA, this field indicates
  2707. * the RSSI of the received ACK or BA frame.
  2708. * When the frame is removed as result of a direct
  2709. * remove command from the SW, this field is set
  2710. * to 0x0 (which is never a valid value when real
  2711. * RSSI is available).
  2712. * Units: dB w.r.t noise floor
  2713. */
  2714. A_UINT32
  2715. sw_peer_id: 16,
  2716. tid_num: 5,
  2717. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2718. * and tid_num fields contain valid data.
  2719. * If this "valid" flag is not set, the
  2720. * sw_peer_id and tid_num fields must be ignored.
  2721. */
  2722. mcast: 1,
  2723. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2724. * contains valid data.
  2725. */
  2726. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2727. reserved: 4;
  2728. A_UINT32
  2729. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2730. * packets in the wbm completion path
  2731. */
  2732. } POSTPACK;
  2733. /* DWORD 4 */
  2734. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2735. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2736. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2737. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2738. /* DWORD 5 */
  2739. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2740. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2741. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2742. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2743. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2744. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2745. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2746. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2747. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2748. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2749. /* DWORD 4 */
  2750. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2751. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2752. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2753. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2754. do { \
  2755. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2756. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2757. } while (0)
  2758. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2759. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2760. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2761. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2762. do { \
  2763. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2764. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2765. } while (0)
  2766. /* DWORD 5 */
  2767. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2768. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2769. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2770. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2771. do { \
  2772. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2773. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2774. } while (0)
  2775. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2776. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2777. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2778. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2779. do { \
  2780. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2781. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2782. } while (0)
  2783. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2784. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2785. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2786. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2787. do { \
  2788. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2789. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2790. } while (0)
  2791. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2792. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2793. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2794. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2795. do { \
  2796. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2797. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2798. } while (0)
  2799. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2800. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2801. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2802. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2803. do { \
  2804. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2805. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2806. } while (0)
  2807. /**
  2808. * @brief HTT TX WBM reinject status from firmware to host
  2809. * @details
  2810. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2811. * (WBM) offload HW.
  2812. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2813. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2814. */
  2815. PREPACK struct htt_tx_wbm_reinject_status {
  2816. A_UINT32
  2817. reserved0: 32;
  2818. A_UINT32
  2819. reserved1: 32;
  2820. A_UINT32
  2821. reserved2: 32;
  2822. } POSTPACK;
  2823. /**
  2824. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2825. * @details
  2826. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2827. * (WBM) offload HW.
  2828. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2829. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2830. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2831. * STA side.
  2832. */
  2833. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2834. A_UINT32
  2835. mec_sa_addr_31_0;
  2836. A_UINT32
  2837. mec_sa_addr_47_32: 16,
  2838. sa_ast_index: 16;
  2839. A_UINT32
  2840. vdev_id: 8,
  2841. reserved0: 24;
  2842. } POSTPACK;
  2843. /* DWORD 4 - mec_sa_addr_31_0 */
  2844. /* DWORD 5 */
  2845. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2846. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2847. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2848. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2849. /* DWORD 6 */
  2850. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2851. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2852. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2853. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2854. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2855. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2856. do { \
  2857. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2858. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2859. } while (0)
  2860. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2861. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2862. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2863. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2864. do { \
  2865. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2866. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2867. } while (0)
  2868. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2869. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2870. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2871. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2872. do { \
  2873. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2874. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2875. } while (0)
  2876. typedef enum {
  2877. TX_FLOW_PRIORITY_BE,
  2878. TX_FLOW_PRIORITY_HIGH,
  2879. TX_FLOW_PRIORITY_LOW,
  2880. } htt_tx_flow_priority_t;
  2881. typedef enum {
  2882. TX_FLOW_LATENCY_SENSITIVE,
  2883. TX_FLOW_LATENCY_INSENSITIVE,
  2884. } htt_tx_flow_latency_t;
  2885. typedef enum {
  2886. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2887. TX_FLOW_INTERACTIVE_TRAFFIC,
  2888. TX_FLOW_PERIODIC_TRAFFIC,
  2889. TX_FLOW_BURSTY_TRAFFIC,
  2890. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2891. } htt_tx_flow_traffic_pattern_t;
  2892. /**
  2893. * @brief HTT TX Flow search metadata format
  2894. * @details
  2895. * Host will set this metadata in flow table's flow search entry along with
  2896. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2897. * firmware and TQM ring if the flow search entry wins.
  2898. * This metadata is available to firmware in that first MSDU's
  2899. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2900. * to one of the available flows for specific tid and returns the tqm flow
  2901. * pointer as part of htt_tx_map_flow_info message.
  2902. */
  2903. PREPACK struct htt_tx_flow_metadata {
  2904. A_UINT32
  2905. rsvd0_1_0: 2,
  2906. tid: 4,
  2907. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2908. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2909. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2910. * Else choose final tid based on latency, priority.
  2911. */
  2912. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2913. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2914. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2915. } POSTPACK;
  2916. /* DWORD 0 */
  2917. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2918. #define HTT_TX_FLOW_METADATA_TID_S 2
  2919. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2920. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2921. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2922. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2923. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2924. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2925. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2926. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2927. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2928. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2929. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2930. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2931. /* DWORD 0 */
  2932. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2933. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2934. HTT_TX_FLOW_METADATA_TID_S)
  2935. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2936. do { \
  2937. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2938. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2939. } while (0)
  2940. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2941. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2942. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2943. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2944. do { \
  2945. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2946. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2947. } while (0)
  2948. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2949. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2950. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2951. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2952. do { \
  2953. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2954. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2955. } while (0)
  2956. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2957. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2958. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2959. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2960. do { \
  2961. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2962. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2963. } while (0)
  2964. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2965. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2966. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2967. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2968. do { \
  2969. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2970. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2971. } while (0)
  2972. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2973. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2974. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2975. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2976. do { \
  2977. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2978. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2979. } while (0)
  2980. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2981. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2982. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2983. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2984. do { \
  2985. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2986. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2987. } while (0)
  2988. /**
  2989. * @brief host -> target ADD WDS Entry
  2990. *
  2991. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2992. *
  2993. * @brief host -> target DELETE WDS Entry
  2994. *
  2995. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2996. *
  2997. * @details
  2998. * HTT wds entry from source port learning
  2999. * Host will learn wds entries from rx and send this message to firmware
  3000. * to enable firmware to configure/delete AST entries for wds clients.
  3001. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3002. * and when SA's entry is deleted, firmware removes this AST entry
  3003. *
  3004. * The message would appear as follows:
  3005. *
  3006. * |31 30|29 |17 16|15 8|7 0|
  3007. * |----------------+----------------+----------------+----------------|
  3008. * | rsvd0 |PDVID| vdev_id | msg_type |
  3009. * |-------------------------------------------------------------------|
  3010. * | sa_addr_31_0 |
  3011. * |-------------------------------------------------------------------|
  3012. * | | ta_peer_id | sa_addr_47_32 |
  3013. * |-------------------------------------------------------------------|
  3014. * Where PDVID = pdev_id
  3015. *
  3016. * The message is interpreted as follows:
  3017. *
  3018. * dword0 - b'0:7 - msg_type: This will be set to
  3019. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3020. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3021. *
  3022. * dword0 - b'8:15 - vdev_id
  3023. *
  3024. * dword0 - b'16:17 - pdev_id
  3025. *
  3026. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3027. *
  3028. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3029. *
  3030. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3031. *
  3032. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3033. */
  3034. PREPACK struct htt_wds_entry {
  3035. A_UINT32
  3036. msg_type: 8,
  3037. vdev_id: 8,
  3038. pdev_id: 2,
  3039. rsvd0: 14;
  3040. A_UINT32 sa_addr_31_0;
  3041. A_UINT32
  3042. sa_addr_47_32: 16,
  3043. ta_peer_id: 14,
  3044. rsvd2: 2;
  3045. } POSTPACK;
  3046. /* DWORD 0 */
  3047. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3048. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3049. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3050. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3051. /* DWORD 2 */
  3052. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3053. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3054. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3055. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3056. /* DWORD 0 */
  3057. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3058. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3059. HTT_WDS_ENTRY_VDEV_ID_S)
  3060. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3061. do { \
  3062. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3063. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3064. } while (0)
  3065. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3066. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3067. HTT_WDS_ENTRY_PDEV_ID_S)
  3068. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3069. do { \
  3070. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3071. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3072. } while (0)
  3073. /* DWORD 2 */
  3074. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3075. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3076. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3077. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3078. do { \
  3079. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3080. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3081. } while (0)
  3082. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3083. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3084. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3085. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3086. do { \
  3087. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3088. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3089. } while (0)
  3090. /**
  3091. * @brief MAC DMA rx ring setup specification
  3092. *
  3093. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3094. *
  3095. * @details
  3096. * To allow for dynamic rx ring reconfiguration and to avoid race
  3097. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3098. * it uses. Instead, it sends this message to the target, indicating how
  3099. * the rx ring used by the host should be set up and maintained.
  3100. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3101. * specifications.
  3102. *
  3103. * |31 16|15 8|7 0|
  3104. * |---------------------------------------------------------------|
  3105. * header: | reserved | num rings | msg type |
  3106. * |---------------------------------------------------------------|
  3107. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3108. #if HTT_PADDR64
  3109. * | FW_IDX shadow register physical address (bits 63:32) |
  3110. #endif
  3111. * |---------------------------------------------------------------|
  3112. * | rx ring base physical address (bits 31:0) |
  3113. #if HTT_PADDR64
  3114. * | rx ring base physical address (bits 63:32) |
  3115. #endif
  3116. * |---------------------------------------------------------------|
  3117. * | rx ring buffer size | rx ring length |
  3118. * |---------------------------------------------------------------|
  3119. * | FW_IDX initial value | enabled flags |
  3120. * |---------------------------------------------------------------|
  3121. * | MSDU payload offset | 802.11 header offset |
  3122. * |---------------------------------------------------------------|
  3123. * | PPDU end offset | PPDU start offset |
  3124. * |---------------------------------------------------------------|
  3125. * | MPDU end offset | MPDU start offset |
  3126. * |---------------------------------------------------------------|
  3127. * | MSDU end offset | MSDU start offset |
  3128. * |---------------------------------------------------------------|
  3129. * | frag info offset | rx attention offset |
  3130. * |---------------------------------------------------------------|
  3131. * payload 2, if present, has the same format as payload 1
  3132. * Header fields:
  3133. * - MSG_TYPE
  3134. * Bits 7:0
  3135. * Purpose: identifies this as an rx ring configuration message
  3136. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3137. * - NUM_RINGS
  3138. * Bits 15:8
  3139. * Purpose: indicates whether the host is setting up one rx ring or two
  3140. * Value: 1 or 2
  3141. * Payload:
  3142. * for systems using 64-bit format for bus addresses:
  3143. * - IDX_SHADOW_REG_PADDR_LO
  3144. * Bits 31:0
  3145. * Value: lower 4 bytes of physical address of the host's
  3146. * FW_IDX shadow register
  3147. * - IDX_SHADOW_REG_PADDR_HI
  3148. * Bits 31:0
  3149. * Value: upper 4 bytes of physical address of the host's
  3150. * FW_IDX shadow register
  3151. * - RING_BASE_PADDR_LO
  3152. * Bits 31:0
  3153. * Value: lower 4 bytes of physical address of the host's rx ring
  3154. * - RING_BASE_PADDR_HI
  3155. * Bits 31:0
  3156. * Value: uppper 4 bytes of physical address of the host's rx ring
  3157. * for systems using 32-bit format for bus addresses:
  3158. * - IDX_SHADOW_REG_PADDR
  3159. * Bits 31:0
  3160. * Value: physical address of the host's FW_IDX shadow register
  3161. * - RING_BASE_PADDR
  3162. * Bits 31:0
  3163. * Value: physical address of the host's rx ring
  3164. * - RING_LEN
  3165. * Bits 15:0
  3166. * Value: number of elements in the rx ring
  3167. * - RING_BUF_SZ
  3168. * Bits 31:16
  3169. * Value: size of the buffers referenced by the rx ring, in byte units
  3170. * - ENABLED_FLAGS
  3171. * Bits 15:0
  3172. * Value: 1-bit flags to show whether different rx fields are enabled
  3173. * bit 0: 802.11 header enabled (1) or disabled (0)
  3174. * bit 1: MSDU payload enabled (1) or disabled (0)
  3175. * bit 2: PPDU start enabled (1) or disabled (0)
  3176. * bit 3: PPDU end enabled (1) or disabled (0)
  3177. * bit 4: MPDU start enabled (1) or disabled (0)
  3178. * bit 5: MPDU end enabled (1) or disabled (0)
  3179. * bit 6: MSDU start enabled (1) or disabled (0)
  3180. * bit 7: MSDU end enabled (1) or disabled (0)
  3181. * bit 8: rx attention enabled (1) or disabled (0)
  3182. * bit 9: frag info enabled (1) or disabled (0)
  3183. * bit 10: unicast rx enabled (1) or disabled (0)
  3184. * bit 11: multicast rx enabled (1) or disabled (0)
  3185. * bit 12: ctrl rx enabled (1) or disabled (0)
  3186. * bit 13: mgmt rx enabled (1) or disabled (0)
  3187. * bit 14: null rx enabled (1) or disabled (0)
  3188. * bit 15: phy data rx enabled (1) or disabled (0)
  3189. * - IDX_INIT_VAL
  3190. * Bits 31:16
  3191. * Purpose: Specify the initial value for the FW_IDX.
  3192. * Value: the number of buffers initially present in the host's rx ring
  3193. * - OFFSET_802_11_HDR
  3194. * Bits 15:0
  3195. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3196. * - OFFSET_MSDU_PAYLOAD
  3197. * Bits 31:16
  3198. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3199. * - OFFSET_PPDU_START
  3200. * Bits 15:0
  3201. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3202. * - OFFSET_PPDU_END
  3203. * Bits 31:16
  3204. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3205. * - OFFSET_MPDU_START
  3206. * Bits 15:0
  3207. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3208. * - OFFSET_MPDU_END
  3209. * Bits 31:16
  3210. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3211. * - OFFSET_MSDU_START
  3212. * Bits 15:0
  3213. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3214. * - OFFSET_MSDU_END
  3215. * Bits 31:16
  3216. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3217. * - OFFSET_RX_ATTN
  3218. * Bits 15:0
  3219. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3220. * - OFFSET_FRAG_INFO
  3221. * Bits 31:16
  3222. * Value: offset in QUAD-bytes of frag info table
  3223. */
  3224. /* header fields */
  3225. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3226. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3227. /* payload fields */
  3228. /* for systems using a 64-bit format for bus addresses */
  3229. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3230. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3231. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3232. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3233. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3234. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3235. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3236. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3237. /* for systems using a 32-bit format for bus addresses */
  3238. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3239. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3240. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3241. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3242. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3243. #define HTT_RX_RING_CFG_LEN_S 0
  3244. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3245. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3246. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3247. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3248. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3249. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3250. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3251. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3252. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3253. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3254. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3255. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3256. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3257. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3258. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3259. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3260. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3261. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3262. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3263. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3264. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3265. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3266. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3267. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3268. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3269. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3270. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3271. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3272. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3273. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3274. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3275. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3276. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3277. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3278. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3279. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3280. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3281. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3282. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3283. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3284. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3285. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3286. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3287. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3288. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3289. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3290. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3291. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3292. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3293. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3294. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3295. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3296. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3297. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3298. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3299. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3300. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3301. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3302. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3303. #if HTT_PADDR64
  3304. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3305. #else
  3306. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3307. #endif
  3308. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3309. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3310. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3311. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3312. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3313. do { \
  3314. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3315. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3316. } while (0)
  3317. /* degenerate case for 32-bit fields */
  3318. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3319. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3320. ((_var) = (_val))
  3321. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3322. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3323. ((_var) = (_val))
  3324. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3325. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3326. ((_var) = (_val))
  3327. /* degenerate case for 32-bit fields */
  3328. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3329. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3330. ((_var) = (_val))
  3331. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3332. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3333. ((_var) = (_val))
  3334. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3335. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3336. ((_var) = (_val))
  3337. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3338. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3339. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3340. do { \
  3341. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3342. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3343. } while (0)
  3344. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3345. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3346. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3347. do { \
  3348. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3349. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3350. } while (0)
  3351. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3352. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3353. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3354. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3355. do { \
  3356. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3357. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3358. } while (0)
  3359. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3360. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3361. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3362. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3363. do { \
  3364. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3365. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3366. } while (0)
  3367. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3368. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3369. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3370. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3371. do { \
  3372. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3373. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3374. } while (0)
  3375. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3376. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3377. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3378. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3379. do { \
  3380. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3381. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3382. } while (0)
  3383. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3384. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3385. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3386. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3387. do { \
  3388. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3389. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3390. } while (0)
  3391. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3392. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3393. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3394. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3395. do { \
  3396. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3397. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3398. } while (0)
  3399. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3400. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3401. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3402. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3403. do { \
  3404. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3405. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3406. } while (0)
  3407. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3408. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3409. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3410. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3411. do { \
  3412. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3413. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3414. } while (0)
  3415. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3416. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3417. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3418. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3419. do { \
  3420. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3421. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3422. } while (0)
  3423. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3424. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3425. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3426. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3427. do { \
  3428. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3429. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3430. } while (0)
  3431. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3432. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3433. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3434. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3435. do { \
  3436. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3437. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3438. } while (0)
  3439. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3440. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3441. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3442. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3443. do { \
  3444. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3445. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3446. } while (0)
  3447. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3448. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3449. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3450. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3451. do { \
  3452. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3453. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3454. } while (0)
  3455. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3456. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3457. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3458. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3459. do { \
  3460. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3461. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3462. } while (0)
  3463. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3464. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3465. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3466. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3467. do { \
  3468. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3469. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3470. } while (0)
  3471. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3472. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3473. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3474. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3475. do { \
  3476. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3477. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3478. } while (0)
  3479. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3480. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3481. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3482. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3483. do { \
  3484. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3485. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3486. } while (0)
  3487. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3488. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3489. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3490. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3491. do { \
  3492. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3493. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3494. } while (0)
  3495. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3496. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3497. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3498. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3499. do { \
  3500. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3501. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3502. } while (0)
  3503. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3504. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3505. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3506. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3507. do { \
  3508. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3509. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3510. } while (0)
  3511. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3512. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3513. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3514. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3515. do { \
  3516. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3517. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3518. } while (0)
  3519. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3520. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3521. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3522. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3523. do { \
  3524. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3525. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3526. } while (0)
  3527. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3528. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3529. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3530. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3531. do { \
  3532. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3533. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3534. } while (0)
  3535. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3536. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3537. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3538. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3539. do { \
  3540. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3541. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3542. } while (0)
  3543. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3544. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3545. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3546. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3547. do { \
  3548. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3549. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3550. } while (0)
  3551. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3552. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3553. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3554. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3555. do { \
  3556. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3557. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3558. } while (0)
  3559. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3560. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3561. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3562. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3563. do { \
  3564. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3565. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3566. } while (0)
  3567. /**
  3568. * @brief host -> target FW statistics retrieve
  3569. *
  3570. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3571. *
  3572. * @details
  3573. * The following field definitions describe the format of the HTT host
  3574. * to target FW stats retrieve message. The message specifies the type of
  3575. * stats host wants to retrieve.
  3576. *
  3577. * |31 24|23 16|15 8|7 0|
  3578. * |-----------------------------------------------------------|
  3579. * | stats types request bitmask | msg type |
  3580. * |-----------------------------------------------------------|
  3581. * | stats types reset bitmask | reserved |
  3582. * |-----------------------------------------------------------|
  3583. * | stats type | config value |
  3584. * |-----------------------------------------------------------|
  3585. * | cookie LSBs |
  3586. * |-----------------------------------------------------------|
  3587. * | cookie MSBs |
  3588. * |-----------------------------------------------------------|
  3589. * Header fields:
  3590. * - MSG_TYPE
  3591. * Bits 7:0
  3592. * Purpose: identifies this is a stats upload request message
  3593. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3594. * - UPLOAD_TYPES
  3595. * Bits 31:8
  3596. * Purpose: identifies which types of FW statistics to upload
  3597. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3598. * - RESET_TYPES
  3599. * Bits 31:8
  3600. * Purpose: identifies which types of FW statistics to reset
  3601. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3602. * - CFG_VAL
  3603. * Bits 23:0
  3604. * Purpose: give an opaque configuration value to the specified stats type
  3605. * Value: stats-type specific configuration value
  3606. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3607. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3608. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3609. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3610. * - CFG_STAT_TYPE
  3611. * Bits 31:24
  3612. * Purpose: specify which stats type (if any) the config value applies to
  3613. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3614. * a valid configuration specification
  3615. * - COOKIE_LSBS
  3616. * Bits 31:0
  3617. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3618. * message with its preceding host->target stats request message.
  3619. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3620. * - COOKIE_MSBS
  3621. * Bits 31:0
  3622. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3623. * message with its preceding host->target stats request message.
  3624. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3625. */
  3626. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3627. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3628. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3629. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3630. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3631. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3632. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3633. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3634. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3635. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3636. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3637. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3638. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3639. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3640. do { \
  3641. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3642. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3643. } while (0)
  3644. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3645. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3646. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3647. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3648. do { \
  3649. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3650. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3651. } while (0)
  3652. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3653. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3654. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3655. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3656. do { \
  3657. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3658. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3659. } while (0)
  3660. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3661. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3662. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3663. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3664. do { \
  3665. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3666. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3667. } while (0)
  3668. /**
  3669. * @brief host -> target HTT out-of-band sync request
  3670. *
  3671. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3672. *
  3673. * @details
  3674. * The HTT SYNC tells the target to suspend processing of subsequent
  3675. * HTT host-to-target messages until some other target agent locally
  3676. * informs the target HTT FW that the current sync counter is equal to
  3677. * or greater than (in a modulo sense) the sync counter specified in
  3678. * the SYNC message.
  3679. * This allows other host-target components to synchronize their operation
  3680. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3681. * security key has been downloaded to and activated by the target.
  3682. * In the absence of any explicit synchronization counter value
  3683. * specification, the target HTT FW will use zero as the default current
  3684. * sync value.
  3685. *
  3686. * |31 24|23 16|15 8|7 0|
  3687. * |-----------------------------------------------------------|
  3688. * | reserved | sync count | msg type |
  3689. * |-----------------------------------------------------------|
  3690. * Header fields:
  3691. * - MSG_TYPE
  3692. * Bits 7:0
  3693. * Purpose: identifies this as a sync message
  3694. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3695. * - SYNC_COUNT
  3696. * Bits 15:8
  3697. * Purpose: specifies what sync value the HTT FW will wait for from
  3698. * an out-of-band specification to resume its operation
  3699. * Value: in-band sync counter value to compare against the out-of-band
  3700. * counter spec.
  3701. * The HTT target FW will suspend its host->target message processing
  3702. * as long as
  3703. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3704. */
  3705. #define HTT_H2T_SYNC_MSG_SZ 4
  3706. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3707. #define HTT_H2T_SYNC_COUNT_S 8
  3708. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3709. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3710. HTT_H2T_SYNC_COUNT_S)
  3711. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3712. do { \
  3713. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3714. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3715. } while (0)
  3716. /**
  3717. * @brief host -> target HTT aggregation configuration
  3718. *
  3719. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3720. */
  3721. #define HTT_AGGR_CFG_MSG_SZ 4
  3722. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3723. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3724. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3725. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3726. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3727. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3728. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3729. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3730. do { \
  3731. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3732. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3733. } while (0)
  3734. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3735. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3736. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3737. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3738. do { \
  3739. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3740. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3741. } while (0)
  3742. /**
  3743. * @brief host -> target HTT configure max amsdu info per vdev
  3744. *
  3745. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3746. *
  3747. * @details
  3748. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3749. *
  3750. * |31 21|20 16|15 8|7 0|
  3751. * |-----------------------------------------------------------|
  3752. * | reserved | vdev id | max amsdu | msg type |
  3753. * |-----------------------------------------------------------|
  3754. * Header fields:
  3755. * - MSG_TYPE
  3756. * Bits 7:0
  3757. * Purpose: identifies this as a aggr cfg ex message
  3758. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3759. * - MAX_NUM_AMSDU_SUBFRM
  3760. * Bits 15:8
  3761. * Purpose: max MSDUs per A-MSDU
  3762. * - VDEV_ID
  3763. * Bits 20:16
  3764. * Purpose: ID of the vdev to which this limit is applied
  3765. */
  3766. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3767. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3768. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3769. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3770. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3771. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3772. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3773. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3774. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3775. do { \
  3776. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3777. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3778. } while (0)
  3779. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3780. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3781. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3782. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3783. do { \
  3784. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3785. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3786. } while (0)
  3787. /**
  3788. * @brief HTT WDI_IPA Config Message
  3789. *
  3790. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3791. *
  3792. * @details
  3793. * The HTT WDI_IPA config message is created/sent by host at driver
  3794. * init time. It contains information about data structures used on
  3795. * WDI_IPA TX and RX path.
  3796. * TX CE ring is used for pushing packet metadata from IPA uC
  3797. * to WLAN FW
  3798. * TX Completion ring is used for generating TX completions from
  3799. * WLAN FW to IPA uC
  3800. * RX Indication ring is used for indicating RX packets from FW
  3801. * to IPA uC
  3802. * RX Ring2 is used as either completion ring or as second
  3803. * indication ring. when Ring2 is used as completion ring, IPA uC
  3804. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3805. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3806. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3807. * indicated in RX Indication ring. Please see WDI_IPA specification
  3808. * for more details.
  3809. * |31 24|23 16|15 8|7 0|
  3810. * |----------------+----------------+----------------+----------------|
  3811. * | tx pkt pool size | Rsvd | msg_type |
  3812. * |-------------------------------------------------------------------|
  3813. * | tx comp ring base (bits 31:0) |
  3814. #if HTT_PADDR64
  3815. * | tx comp ring base (bits 63:32) |
  3816. #endif
  3817. * |-------------------------------------------------------------------|
  3818. * | tx comp ring size |
  3819. * |-------------------------------------------------------------------|
  3820. * | tx comp WR_IDX physical address (bits 31:0) |
  3821. #if HTT_PADDR64
  3822. * | tx comp WR_IDX physical address (bits 63:32) |
  3823. #endif
  3824. * |-------------------------------------------------------------------|
  3825. * | tx CE WR_IDX physical address (bits 31:0) |
  3826. #if HTT_PADDR64
  3827. * | tx CE WR_IDX physical address (bits 63:32) |
  3828. #endif
  3829. * |-------------------------------------------------------------------|
  3830. * | rx indication ring base (bits 31:0) |
  3831. #if HTT_PADDR64
  3832. * | rx indication ring base (bits 63:32) |
  3833. #endif
  3834. * |-------------------------------------------------------------------|
  3835. * | rx indication ring size |
  3836. * |-------------------------------------------------------------------|
  3837. * | rx ind RD_IDX physical address (bits 31:0) |
  3838. #if HTT_PADDR64
  3839. * | rx ind RD_IDX physical address (bits 63:32) |
  3840. #endif
  3841. * |-------------------------------------------------------------------|
  3842. * | rx ind WR_IDX physical address (bits 31:0) |
  3843. #if HTT_PADDR64
  3844. * | rx ind WR_IDX physical address (bits 63:32) |
  3845. #endif
  3846. * |-------------------------------------------------------------------|
  3847. * |-------------------------------------------------------------------|
  3848. * | rx ring2 base (bits 31:0) |
  3849. #if HTT_PADDR64
  3850. * | rx ring2 base (bits 63:32) |
  3851. #endif
  3852. * |-------------------------------------------------------------------|
  3853. * | rx ring2 size |
  3854. * |-------------------------------------------------------------------|
  3855. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3856. #if HTT_PADDR64
  3857. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3858. #endif
  3859. * |-------------------------------------------------------------------|
  3860. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3861. #if HTT_PADDR64
  3862. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3863. #endif
  3864. * |-------------------------------------------------------------------|
  3865. *
  3866. * Header fields:
  3867. * Header fields:
  3868. * - MSG_TYPE
  3869. * Bits 7:0
  3870. * Purpose: Identifies this as WDI_IPA config message
  3871. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3872. * - TX_PKT_POOL_SIZE
  3873. * Bits 15:0
  3874. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3875. * WDI_IPA TX path
  3876. * For systems using 32-bit format for bus addresses:
  3877. * - TX_COMP_RING_BASE_ADDR
  3878. * Bits 31:0
  3879. * Purpose: TX Completion Ring base address in DDR
  3880. * - TX_COMP_RING_SIZE
  3881. * Bits 31:0
  3882. * Purpose: TX Completion Ring size (must be power of 2)
  3883. * - TX_COMP_WR_IDX_ADDR
  3884. * Bits 31:0
  3885. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3886. * updates the Write Index for WDI_IPA TX completion ring
  3887. * - TX_CE_WR_IDX_ADDR
  3888. * Bits 31:0
  3889. * Purpose: DDR address where IPA uC
  3890. * updates the WR Index for TX CE ring
  3891. * (needed for fusion platforms)
  3892. * - RX_IND_RING_BASE_ADDR
  3893. * Bits 31:0
  3894. * Purpose: RX Indication Ring base address in DDR
  3895. * - RX_IND_RING_SIZE
  3896. * Bits 31:0
  3897. * Purpose: RX Indication Ring size
  3898. * - RX_IND_RD_IDX_ADDR
  3899. * Bits 31:0
  3900. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3901. * RX indication ring
  3902. * - RX_IND_WR_IDX_ADDR
  3903. * Bits 31:0
  3904. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3905. * updates the Write Index for WDI_IPA RX indication ring
  3906. * - RX_RING2_BASE_ADDR
  3907. * Bits 31:0
  3908. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3909. * - RX_RING2_SIZE
  3910. * Bits 31:0
  3911. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3912. * - RX_RING2_RD_IDX_ADDR
  3913. * Bits 31:0
  3914. * Purpose: If Second RX ring is Indication ring, DDR address where
  3915. * IPA uC updates the Read Index for Ring2.
  3916. * If Second RX ring is completion ring, this is NOT used
  3917. * - RX_RING2_WR_IDX_ADDR
  3918. * Bits 31:0
  3919. * Purpose: If Second RX ring is Indication ring, DDR address where
  3920. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3921. * If second RX ring is completion ring, DDR address where
  3922. * IPA uC updates the Write Index for Ring 2.
  3923. * For systems using 64-bit format for bus addresses:
  3924. * - TX_COMP_RING_BASE_ADDR_LO
  3925. * Bits 31:0
  3926. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3927. * - TX_COMP_RING_BASE_ADDR_HI
  3928. * Bits 31:0
  3929. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3930. * - TX_COMP_RING_SIZE
  3931. * Bits 31:0
  3932. * Purpose: TX Completion Ring size (must be power of 2)
  3933. * - TX_COMP_WR_IDX_ADDR_LO
  3934. * Bits 31:0
  3935. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3936. * Lower 4 bytes of DDR address where WIFI FW
  3937. * updates the Write Index for WDI_IPA TX completion ring
  3938. * - TX_COMP_WR_IDX_ADDR_HI
  3939. * Bits 31:0
  3940. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3941. * Higher 4 bytes of DDR address where WIFI FW
  3942. * updates the Write Index for WDI_IPA TX completion ring
  3943. * - TX_CE_WR_IDX_ADDR_LO
  3944. * Bits 31:0
  3945. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3946. * updates the WR Index for TX CE ring
  3947. * (needed for fusion platforms)
  3948. * - TX_CE_WR_IDX_ADDR_HI
  3949. * Bits 31:0
  3950. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3951. * updates the WR Index for TX CE ring
  3952. * (needed for fusion platforms)
  3953. * - RX_IND_RING_BASE_ADDR_LO
  3954. * Bits 31:0
  3955. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3956. * - RX_IND_RING_BASE_ADDR_HI
  3957. * Bits 31:0
  3958. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3959. * - RX_IND_RING_SIZE
  3960. * Bits 31:0
  3961. * Purpose: RX Indication Ring size
  3962. * - RX_IND_RD_IDX_ADDR_LO
  3963. * Bits 31:0
  3964. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3965. * for WDI_IPA RX indication ring
  3966. * - RX_IND_RD_IDX_ADDR_HI
  3967. * Bits 31:0
  3968. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3969. * for WDI_IPA RX indication ring
  3970. * - RX_IND_WR_IDX_ADDR_LO
  3971. * Bits 31:0
  3972. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3973. * Lower 4 bytes of DDR address where WIFI FW
  3974. * updates the Write Index for WDI_IPA RX indication ring
  3975. * - RX_IND_WR_IDX_ADDR_HI
  3976. * Bits 31:0
  3977. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3978. * Higher 4 bytes of DDR address where WIFI FW
  3979. * updates the Write Index for WDI_IPA RX indication ring
  3980. * - RX_RING2_BASE_ADDR_LO
  3981. * Bits 31:0
  3982. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3983. * - RX_RING2_BASE_ADDR_HI
  3984. * Bits 31:0
  3985. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3986. * - RX_RING2_SIZE
  3987. * Bits 31:0
  3988. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3989. * - RX_RING2_RD_IDX_ADDR_LO
  3990. * Bits 31:0
  3991. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3992. * DDR address where IPA uC updates the Read Index for Ring2.
  3993. * If Second RX ring is completion ring, this is NOT used
  3994. * - RX_RING2_RD_IDX_ADDR_HI
  3995. * Bits 31:0
  3996. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3997. * DDR address where IPA uC updates the Read Index for Ring2.
  3998. * If Second RX ring is completion ring, this is NOT used
  3999. * - RX_RING2_WR_IDX_ADDR_LO
  4000. * Bits 31:0
  4001. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4002. * DDR address where WIFI FW updates the Write Index
  4003. * for WDI_IPA RX ring2
  4004. * If second RX ring is completion ring, lower 4 bytes of
  4005. * DDR address where IPA uC updates the Write Index for Ring 2.
  4006. * - RX_RING2_WR_IDX_ADDR_HI
  4007. * Bits 31:0
  4008. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4009. * DDR address where WIFI FW updates the Write Index
  4010. * for WDI_IPA RX ring2
  4011. * If second RX ring is completion ring, higher 4 bytes of
  4012. * DDR address where IPA uC updates the Write Index for Ring 2.
  4013. */
  4014. #if HTT_PADDR64
  4015. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4016. #else
  4017. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4018. #endif
  4019. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4020. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4021. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4022. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4023. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4025. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4027. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4029. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4031. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4033. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4035. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4037. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4039. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4041. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4053. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4055. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4057. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4061. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4081. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4082. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4083. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4084. do { \
  4085. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4086. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4087. } while (0)
  4088. /* for systems using 32-bit format for bus addr */
  4089. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4090. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4091. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4092. do { \
  4093. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4094. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4095. } while (0)
  4096. /* for systems using 64-bit format for bus addr */
  4097. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4098. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4099. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4100. do { \
  4101. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4102. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4103. } while (0)
  4104. /* for systems using 64-bit format for bus addr */
  4105. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4106. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4107. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4108. do { \
  4109. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4110. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4111. } while (0)
  4112. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4113. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4114. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4115. do { \
  4116. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4117. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4118. } while (0)
  4119. /* for systems using 32-bit format for bus addr */
  4120. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4121. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4122. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4125. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4126. } while (0)
  4127. /* for systems using 64-bit format for bus addr */
  4128. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4129. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4130. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4133. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4134. } while (0)
  4135. /* for systems using 64-bit format for bus addr */
  4136. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4137. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4138. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4139. do { \
  4140. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4141. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4142. } while (0)
  4143. /* for systems using 32-bit format for bus addr */
  4144. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4145. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4146. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4147. do { \
  4148. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4149. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4150. } while (0)
  4151. /* for systems using 64-bit format for bus addr */
  4152. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4153. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4154. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4155. do { \
  4156. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4157. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4158. } while (0)
  4159. /* for systems using 64-bit format for bus addr */
  4160. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4161. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4162. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4163. do { \
  4164. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4165. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4166. } while (0)
  4167. /* for systems using 32-bit format for bus addr */
  4168. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4169. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4170. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4173. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4174. } while (0)
  4175. /* for systems using 64-bit format for bus addr */
  4176. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4177. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4178. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4179. do { \
  4180. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4181. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4182. } while (0)
  4183. /* for systems using 64-bit format for bus addr */
  4184. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4185. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4186. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4187. do { \
  4188. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4189. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4190. } while (0)
  4191. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4192. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4193. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4194. do { \
  4195. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4196. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4197. } while (0)
  4198. /* for systems using 32-bit format for bus addr */
  4199. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4200. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4201. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4202. do { \
  4203. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4204. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4205. } while (0)
  4206. /* for systems using 64-bit format for bus addr */
  4207. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4208. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4209. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4212. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4213. } while (0)
  4214. /* for systems using 64-bit format for bus addr */
  4215. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4216. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4217. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4218. do { \
  4219. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4220. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4221. } while (0)
  4222. /* for systems using 32-bit format for bus addr */
  4223. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4224. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4225. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4226. do { \
  4227. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4228. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4229. } while (0)
  4230. /* for systems using 64-bit format for bus addr */
  4231. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4232. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4233. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4234. do { \
  4235. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4236. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4237. } while (0)
  4238. /* for systems using 64-bit format for bus addr */
  4239. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4240. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4241. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4242. do { \
  4243. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4244. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4245. } while (0)
  4246. /* for systems using 32-bit format for bus addr */
  4247. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4248. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4249. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4250. do { \
  4251. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4252. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4253. } while (0)
  4254. /* for systems using 64-bit format for bus addr */
  4255. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4256. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4257. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4258. do { \
  4259. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4260. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4261. } while (0)
  4262. /* for systems using 64-bit format for bus addr */
  4263. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4264. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4265. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4266. do { \
  4267. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4268. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4269. } while (0)
  4270. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4271. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4272. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4273. do { \
  4274. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4275. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4276. } while (0)
  4277. /* for systems using 32-bit format for bus addr */
  4278. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4279. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4280. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4281. do { \
  4282. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4283. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4284. } while (0)
  4285. /* for systems using 64-bit format for bus addr */
  4286. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4287. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4288. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4289. do { \
  4290. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4291. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4292. } while (0)
  4293. /* for systems using 64-bit format for bus addr */
  4294. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4295. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4296. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4297. do { \
  4298. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4299. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4300. } while (0)
  4301. /* for systems using 32-bit format for bus addr */
  4302. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4303. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4304. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4305. do { \
  4306. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4307. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4308. } while (0)
  4309. /* for systems using 64-bit format for bus addr */
  4310. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4311. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4312. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4313. do { \
  4314. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4315. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4316. } while (0)
  4317. /* for systems using 64-bit format for bus addr */
  4318. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4319. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4320. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4321. do { \
  4322. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4323. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4324. } while (0)
  4325. /*
  4326. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4327. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4328. * addresses are stored in a XXX-bit field.
  4329. * This macro is used to define both htt_wdi_ipa_config32_t and
  4330. * htt_wdi_ipa_config64_t structs.
  4331. */
  4332. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4333. _paddr__tx_comp_ring_base_addr_, \
  4334. _paddr__tx_comp_wr_idx_addr_, \
  4335. _paddr__tx_ce_wr_idx_addr_, \
  4336. _paddr__rx_ind_ring_base_addr_, \
  4337. _paddr__rx_ind_rd_idx_addr_, \
  4338. _paddr__rx_ind_wr_idx_addr_, \
  4339. _paddr__rx_ring2_base_addr_,\
  4340. _paddr__rx_ring2_rd_idx_addr_,\
  4341. _paddr__rx_ring2_wr_idx_addr_) \
  4342. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4343. { \
  4344. /* DWORD 0: flags and meta-data */ \
  4345. A_UINT32 \
  4346. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4347. reserved: 8, \
  4348. tx_pkt_pool_size: 16;\
  4349. /* DWORD 1 */\
  4350. _paddr__tx_comp_ring_base_addr_;\
  4351. /* DWORD 2 (or 3)*/\
  4352. A_UINT32 tx_comp_ring_size;\
  4353. /* DWORD 3 (or 4)*/\
  4354. _paddr__tx_comp_wr_idx_addr_;\
  4355. /* DWORD 4 (or 6)*/\
  4356. _paddr__tx_ce_wr_idx_addr_;\
  4357. /* DWORD 5 (or 8)*/\
  4358. _paddr__rx_ind_ring_base_addr_;\
  4359. /* DWORD 6 (or 10)*/\
  4360. A_UINT32 rx_ind_ring_size;\
  4361. /* DWORD 7 (or 11)*/\
  4362. _paddr__rx_ind_rd_idx_addr_;\
  4363. /* DWORD 8 (or 13)*/\
  4364. _paddr__rx_ind_wr_idx_addr_;\
  4365. /* DWORD 9 (or 15)*/\
  4366. _paddr__rx_ring2_base_addr_;\
  4367. /* DWORD 10 (or 17) */\
  4368. A_UINT32 rx_ring2_size;\
  4369. /* DWORD 11 (or 18) */\
  4370. _paddr__rx_ring2_rd_idx_addr_;\
  4371. /* DWORD 12 (or 20) */\
  4372. _paddr__rx_ring2_wr_idx_addr_;\
  4373. } POSTPACK
  4374. /* define a htt_wdi_ipa_config32_t type */
  4375. 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));
  4376. /* define a htt_wdi_ipa_config64_t type */
  4377. 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));
  4378. #if HTT_PADDR64
  4379. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4380. #else
  4381. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4382. #endif
  4383. enum htt_wdi_ipa_op_code {
  4384. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4385. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4386. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4387. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4388. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4389. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4390. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4391. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4392. /* keep this last */
  4393. HTT_WDI_IPA_OPCODE_MAX
  4394. };
  4395. /**
  4396. * @brief HTT WDI_IPA Operation Request Message
  4397. *
  4398. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4399. *
  4400. * @details
  4401. * HTT WDI_IPA Operation Request message is sent by host
  4402. * to either suspend or resume WDI_IPA TX or RX path.
  4403. * |31 24|23 16|15 8|7 0|
  4404. * |----------------+----------------+----------------+----------------|
  4405. * | op_code | Rsvd | msg_type |
  4406. * |-------------------------------------------------------------------|
  4407. *
  4408. * Header fields:
  4409. * - MSG_TYPE
  4410. * Bits 7:0
  4411. * Purpose: Identifies this as WDI_IPA Operation Request message
  4412. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4413. * - OP_CODE
  4414. * Bits 31:16
  4415. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4416. * value: = enum htt_wdi_ipa_op_code
  4417. */
  4418. PREPACK struct htt_wdi_ipa_op_request_t
  4419. {
  4420. /* DWORD 0: flags and meta-data */
  4421. A_UINT32
  4422. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4423. reserved: 8,
  4424. op_code: 16;
  4425. } POSTPACK;
  4426. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4427. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4428. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4429. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4430. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4431. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4432. do { \
  4433. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4434. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4435. } while (0)
  4436. /*
  4437. * @brief host -> target HTT_MSI_SETUP message
  4438. *
  4439. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4440. *
  4441. * @details
  4442. * After target is booted up, host can send MSI setup message so that
  4443. * target sets up HW registers based on setup message.
  4444. *
  4445. * The message would appear as follows:
  4446. * |31 24|23 16|15|14 8|7 0|
  4447. * |---------------+-----------------+-----------------+-----------------|
  4448. * | reserved | msi_type | pdev_id | msg_type |
  4449. * |---------------------------------------------------------------------|
  4450. * | msi_addr_lo |
  4451. * |---------------------------------------------------------------------|
  4452. * | msi_addr_hi |
  4453. * |---------------------------------------------------------------------|
  4454. * | msi_data |
  4455. * |---------------------------------------------------------------------|
  4456. *
  4457. * The message is interpreted as follows:
  4458. * dword0 - b'0:7 - msg_type: This will be set to
  4459. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4460. * b'8:15 - pdev_id:
  4461. * 0 (for rings at SOC/UMAC level),
  4462. * 1/2/3 mac id (for rings at LMAC level)
  4463. * b'16:23 - msi_type: identify which msi registers need to be setup
  4464. * more details can be got from enum htt_msi_setup_type
  4465. * b'24:31 - reserved
  4466. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4467. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4468. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4469. */
  4470. PREPACK struct htt_msi_setup_t {
  4471. A_UINT32 msg_type: 8,
  4472. pdev_id: 8,
  4473. msi_type: 8,
  4474. reserved: 8;
  4475. A_UINT32 msi_addr_lo;
  4476. A_UINT32 msi_addr_hi;
  4477. A_UINT32 msi_data;
  4478. } POSTPACK;
  4479. enum htt_msi_setup_type {
  4480. HTT_PPDU_END_MSI_SETUP_TYPE,
  4481. /* Insert new types here*/
  4482. };
  4483. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4484. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4485. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4486. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4487. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4488. HTT_MSI_SETUP_PDEV_ID_S)
  4489. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4490. do { \
  4491. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4492. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4493. } while (0)
  4494. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4495. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4496. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4497. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4498. HTT_MSI_SETUP_MSI_TYPE_S)
  4499. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4500. do { \
  4501. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4502. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4503. } while (0)
  4504. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4505. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4506. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4507. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4508. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4509. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4510. do { \
  4511. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4512. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4513. } while (0)
  4514. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4515. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4516. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4517. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4518. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4519. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4520. do { \
  4521. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4522. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4523. } while (0)
  4524. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4525. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4526. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4527. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4528. HTT_MSI_SETUP_MSI_DATA_S)
  4529. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4530. do { \
  4531. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4532. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4533. } while (0)
  4534. /*
  4535. * @brief host -> target HTT_SRING_SETUP message
  4536. *
  4537. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4538. *
  4539. * @details
  4540. * After target is booted up, Host can send SRING setup message for
  4541. * each host facing LMAC SRING. Target setups up HW registers based
  4542. * on setup message and confirms back to Host if response_required is set.
  4543. * Host should wait for confirmation message before sending new SRING
  4544. * setup message
  4545. *
  4546. * The message would appear as follows:
  4547. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4548. * |--------------- +-----------------+-----------------+-----------------|
  4549. * | ring_type | ring_id | pdev_id | msg_type |
  4550. * |----------------------------------------------------------------------|
  4551. * | ring_base_addr_lo |
  4552. * |----------------------------------------------------------------------|
  4553. * | ring_base_addr_hi |
  4554. * |----------------------------------------------------------------------|
  4555. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4556. * |----------------------------------------------------------------------|
  4557. * | ring_head_offset32_remote_addr_lo |
  4558. * |----------------------------------------------------------------------|
  4559. * | ring_head_offset32_remote_addr_hi |
  4560. * |----------------------------------------------------------------------|
  4561. * | ring_tail_offset32_remote_addr_lo |
  4562. * |----------------------------------------------------------------------|
  4563. * | ring_tail_offset32_remote_addr_hi |
  4564. * |----------------------------------------------------------------------|
  4565. * | ring_msi_addr_lo |
  4566. * |----------------------------------------------------------------------|
  4567. * | ring_msi_addr_hi |
  4568. * |----------------------------------------------------------------------|
  4569. * | ring_msi_data |
  4570. * |----------------------------------------------------------------------|
  4571. * | intr_timer_th |IM| intr_batch_counter_th |
  4572. * |----------------------------------------------------------------------|
  4573. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4574. * |----------------------------------------------------------------------|
  4575. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4576. * |----------------------------------------------------------------------|
  4577. * Where
  4578. * IM = sw_intr_mode
  4579. * RR = response_required
  4580. * PTCF = prefetch_timer_cfg
  4581. * IP = IPA drop flag
  4582. *
  4583. * The message is interpreted as follows:
  4584. * dword0 - b'0:7 - msg_type: This will be set to
  4585. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4586. * b'8:15 - pdev_id:
  4587. * 0 (for rings at SOC/UMAC level),
  4588. * 1/2/3 mac id (for rings at LMAC level)
  4589. * b'16:23 - ring_id: identify which ring is to setup,
  4590. * more details can be got from enum htt_srng_ring_id
  4591. * b'24:31 - ring_type: identify type of host rings,
  4592. * more details can be got from enum htt_srng_ring_type
  4593. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4594. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4595. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4596. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4597. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4598. * SW_TO_HW_RING.
  4599. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4600. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4601. * Lower 32 bits of memory address of the remote variable
  4602. * storing the 4-byte word offset that identifies the head
  4603. * element within the ring.
  4604. * (The head offset variable has type A_UINT32.)
  4605. * Valid for HW_TO_SW and SW_TO_SW rings.
  4606. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4607. * Upper 32 bits of memory address of the remote variable
  4608. * storing the 4-byte word offset that identifies the head
  4609. * element within the ring.
  4610. * (The head offset variable has type A_UINT32.)
  4611. * Valid for HW_TO_SW and SW_TO_SW rings.
  4612. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4613. * Lower 32 bits of memory address of the remote variable
  4614. * storing the 4-byte word offset that identifies the tail
  4615. * element within the ring.
  4616. * (The tail offset variable has type A_UINT32.)
  4617. * Valid for HW_TO_SW and SW_TO_SW rings.
  4618. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4619. * Upper 32 bits of memory address of the remote variable
  4620. * storing the 4-byte word offset that identifies the tail
  4621. * element within the ring.
  4622. * (The tail offset variable has type A_UINT32.)
  4623. * Valid for HW_TO_SW and SW_TO_SW rings.
  4624. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4625. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4626. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4627. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4628. * dword10 - b'0:31 - ring_msi_data: MSI data
  4629. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4630. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4631. * dword11 - b'0:14 - intr_batch_counter_th:
  4632. * batch counter threshold is in units of 4-byte words.
  4633. * HW internally maintains and increments batch count.
  4634. * (see SRING spec for detail description).
  4635. * When batch count reaches threshold value, an interrupt
  4636. * is generated by HW.
  4637. * b'15 - sw_intr_mode:
  4638. * This configuration shall be static.
  4639. * Only programmed at power up.
  4640. * 0: generate pulse style sw interrupts
  4641. * 1: generate level style sw interrupts
  4642. * b'16:31 - intr_timer_th:
  4643. * The timer init value when timer is idle or is
  4644. * initialized to start downcounting.
  4645. * In 8us units (to cover a range of 0 to 524 ms)
  4646. * dword12 - b'0:15 - intr_low_threshold:
  4647. * Used only by Consumer ring to generate ring_sw_int_p.
  4648. * Ring entries low threshold water mark, that is used
  4649. * in combination with the interrupt timer as well as
  4650. * the the clearing of the level interrupt.
  4651. * b'16:18 - prefetch_timer_cfg:
  4652. * Used only by Consumer ring to set timer mode to
  4653. * support Application prefetch handling.
  4654. * The external tail offset/pointer will be updated
  4655. * at following intervals:
  4656. * 3'b000: (Prefetch feature disabled; used only for debug)
  4657. * 3'b001: 1 usec
  4658. * 3'b010: 4 usec
  4659. * 3'b011: 8 usec (default)
  4660. * 3'b100: 16 usec
  4661. * Others: Reserverd
  4662. * b'19 - response_required:
  4663. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4664. * b'20 - ipa_drop_flag:
  4665. Indicates that host will config ipa drop threshold percentage
  4666. * b'21:31 - reserved: reserved for future use
  4667. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4668. * b'8:15 - ipa drop high threshold percentage:
  4669. * b'16:31 - Reserved
  4670. */
  4671. PREPACK struct htt_sring_setup_t {
  4672. A_UINT32 msg_type: 8,
  4673. pdev_id: 8,
  4674. ring_id: 8,
  4675. ring_type: 8;
  4676. A_UINT32 ring_base_addr_lo;
  4677. A_UINT32 ring_base_addr_hi;
  4678. A_UINT32 ring_size: 16,
  4679. ring_entry_size: 8,
  4680. ring_misc_cfg_flag: 8;
  4681. A_UINT32 ring_head_offset32_remote_addr_lo;
  4682. A_UINT32 ring_head_offset32_remote_addr_hi;
  4683. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4684. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4685. A_UINT32 ring_msi_addr_lo;
  4686. A_UINT32 ring_msi_addr_hi;
  4687. A_UINT32 ring_msi_data;
  4688. A_UINT32 intr_batch_counter_th: 15,
  4689. sw_intr_mode: 1,
  4690. intr_timer_th: 16;
  4691. A_UINT32 intr_low_threshold: 16,
  4692. prefetch_timer_cfg: 3,
  4693. response_required: 1,
  4694. ipa_drop_flag: 1,
  4695. reserved1: 11;
  4696. A_UINT32 ipa_drop_low_threshold: 8,
  4697. ipa_drop_high_threshold: 8,
  4698. reserved: 16;
  4699. } POSTPACK;
  4700. enum htt_srng_ring_type {
  4701. HTT_HW_TO_SW_RING = 0,
  4702. HTT_SW_TO_HW_RING,
  4703. HTT_SW_TO_SW_RING,
  4704. /* Insert new ring types above this line */
  4705. };
  4706. enum htt_srng_ring_id {
  4707. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4708. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4709. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4710. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4711. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4712. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4713. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4714. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4715. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4716. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4717. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4718. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4719. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4720. /* Add Other SRING which can't be directly configured by host software above this line */
  4721. };
  4722. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4723. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4724. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4725. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4726. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4727. HTT_SRING_SETUP_PDEV_ID_S)
  4728. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4729. do { \
  4730. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4731. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4732. } while (0)
  4733. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4734. #define HTT_SRING_SETUP_RING_ID_S 16
  4735. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4736. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4737. HTT_SRING_SETUP_RING_ID_S)
  4738. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4739. do { \
  4740. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4741. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4742. } while (0)
  4743. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4744. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4745. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4746. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4747. HTT_SRING_SETUP_RING_TYPE_S)
  4748. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4749. do { \
  4750. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4751. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4752. } while (0)
  4753. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4754. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4755. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4756. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4757. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4758. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4761. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4762. } while (0)
  4763. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4764. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4765. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4766. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4767. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4768. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4769. do { \
  4770. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4771. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4772. } while (0)
  4773. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4774. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4775. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4776. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4777. HTT_SRING_SETUP_RING_SIZE_S)
  4778. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4779. do { \
  4780. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4781. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4782. } while (0)
  4783. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4784. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4785. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4786. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4787. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4788. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4789. do { \
  4790. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4791. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4792. } while (0)
  4793. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4794. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4795. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4796. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4797. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4798. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4799. do { \
  4800. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4801. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4802. } while (0)
  4803. /* This control bit is applicable to only Producer, which updates Ring ID field
  4804. * of each descriptor before pushing into the ring.
  4805. * 0: updates ring_id(default)
  4806. * 1: ring_id updating disabled */
  4807. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4808. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4809. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4810. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4811. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4812. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4813. do { \
  4814. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4815. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4816. } while (0)
  4817. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4818. * of each descriptor before pushing into the ring.
  4819. * 0: updates Loopcnt(default)
  4820. * 1: Loopcnt updating disabled */
  4821. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4822. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4823. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4824. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4825. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4826. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4827. do { \
  4828. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4829. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4830. } while (0)
  4831. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4832. * into security_id port of GXI/AXI. */
  4833. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4834. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4835. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4836. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4837. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4839. do { \
  4840. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4841. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4842. } while (0)
  4843. /* During MSI write operation, SRNG drives value of this register bit into
  4844. * swap bit of GXI/AXI. */
  4845. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4847. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4848. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4849. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4851. do { \
  4852. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4853. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4854. } while (0)
  4855. /* During Pointer write operation, SRNG drives value of this register bit into
  4856. * swap bit of GXI/AXI. */
  4857. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4860. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4861. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4863. do { \
  4864. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4865. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4866. } while (0)
  4867. /* During any data or TLV write operation, SRNG drives value of this register
  4868. * bit into swap bit of GXI/AXI. */
  4869. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4872. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4873. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4875. do { \
  4876. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4877. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4878. } while (0)
  4879. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4880. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4881. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4882. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4883. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4884. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4885. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4886. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4887. do { \
  4888. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4889. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4890. } while (0)
  4891. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4892. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4893. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4894. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4895. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4896. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4897. do { \
  4898. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4899. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4900. } while (0)
  4901. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4902. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4903. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4904. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4905. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4906. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4907. do { \
  4908. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4909. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4910. } while (0)
  4911. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4912. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4913. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4914. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4915. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4916. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4917. do { \
  4918. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4919. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4920. } while (0)
  4921. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4922. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4923. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4924. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4925. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4926. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4927. do { \
  4928. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4929. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4930. } while (0)
  4931. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4932. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4933. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4934. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4935. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4936. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4937. do { \
  4938. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4939. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4940. } while (0)
  4941. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4942. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4943. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4944. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4945. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4946. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4947. do { \
  4948. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4949. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4950. } while (0)
  4951. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4952. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4953. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4954. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4955. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4956. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4957. do { \
  4958. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4959. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4960. } while (0)
  4961. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4962. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4963. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4964. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4965. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4966. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4967. do { \
  4968. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4969. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4970. } while (0)
  4971. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4972. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4973. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4974. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4975. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4976. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4977. do { \
  4978. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4979. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4980. } while (0)
  4981. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4982. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4983. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4984. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4985. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4986. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4987. do { \
  4988. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4989. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4990. } while (0)
  4991. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4992. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4993. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4994. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4995. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4996. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4997. do { \
  4998. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4999. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5000. } while (0)
  5001. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5002. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5003. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5004. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5005. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5006. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5007. do { \
  5008. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5009. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5010. } while (0)
  5011. /**
  5012. * @brief host -> target RX ring selection config message
  5013. *
  5014. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5015. *
  5016. * @details
  5017. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5018. * configure RXDMA rings.
  5019. * The configuration is per ring based and includes both packet subtypes
  5020. * and PPDU/MPDU TLVs.
  5021. *
  5022. * The message would appear as follows:
  5023. *
  5024. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5025. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5026. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5027. * |-------------------------------------------------------------------|
  5028. * | rsvd2 | ring_buffer_size |
  5029. * |-------------------------------------------------------------------|
  5030. * | packet_type_enable_flags_0 |
  5031. * |-------------------------------------------------------------------|
  5032. * | packet_type_enable_flags_1 |
  5033. * |-------------------------------------------------------------------|
  5034. * | packet_type_enable_flags_2 |
  5035. * |-------------------------------------------------------------------|
  5036. * | packet_type_enable_flags_3 |
  5037. * |-------------------------------------------------------------------|
  5038. * | tlv_filter_in_flags |
  5039. * |-------------------------------------------------------------------|
  5040. * | rx_header_offset | rx_packet_offset |
  5041. * |-------------------------------------------------------------------|
  5042. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5043. * |-------------------------------------------------------------------|
  5044. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5045. * |-------------------------------------------------------------------|
  5046. * | rsvd3 | rx_attention_offset |
  5047. * |-------------------------------------------------------------------|
  5048. * | rsvd4 | mo| fp| rx_drop_threshold |
  5049. * | |ndp|ndp| |
  5050. * |-------------------------------------------------------------------|
  5051. * Where:
  5052. * PS = pkt_swap
  5053. * SS = status_swap
  5054. * OV = rx_offsets_valid
  5055. * DT = drop_thresh_valid
  5056. * The message is interpreted as follows:
  5057. * dword0 - b'0:7 - msg_type: This will be set to
  5058. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5059. * b'8:15 - pdev_id:
  5060. * 0 (for rings at SOC/UMAC level),
  5061. * 1/2/3 mac id (for rings at LMAC level)
  5062. * b'16:23 - ring_id : Identify the ring to configure.
  5063. * More details can be got from enum htt_srng_ring_id
  5064. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5065. * BUF_RING_CFG_0 defs within HW .h files,
  5066. * e.g. wmac_top_reg_seq_hwioreg.h
  5067. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5068. * BUF_RING_CFG_0 defs within HW .h files,
  5069. * e.g. wmac_top_reg_seq_hwioreg.h
  5070. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5071. * configuration fields are valid
  5072. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5073. * rx_drop_threshold field is valid
  5074. * b'28 - rx_mon_global_en: Enable/Disable global register
  5075. 8 configuration in Rx monitor module.
  5076. * b'29:31 - rsvd1: reserved for future use
  5077. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5078. * in byte units.
  5079. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5080. * b'16:18 - config_length_mgmt (MGMT):
  5081. * Represents the length of mpdu bytes for mgmt pkt.
  5082. * valid values:
  5083. * 001 - 64bytes
  5084. * 010 - 128bytes
  5085. * 100 - 256bytes
  5086. * 111 - Full mpdu bytes
  5087. * b'19:21 - config_length_ctrl (CTRL):
  5088. * Represents the length of mpdu bytes for ctrl pkt.
  5089. * valid values:
  5090. * 001 - 64bytes
  5091. * 010 - 128bytes
  5092. * 100 - 256bytes
  5093. * 111 - Full mpdu bytes
  5094. * b'22:24 - config_length_data (DATA):
  5095. * Represents the length of mpdu bytes for data pkt.
  5096. * valid values:
  5097. * 001 - 64bytes
  5098. * 010 - 128bytes
  5099. * 100 - 256bytes
  5100. * 111 - Full mpdu bytes
  5101. * b'25:26 - rx_hdr_len:
  5102. * Specifies the number of bytes of recvd packet to copy
  5103. * into the rx_hdr tlv.
  5104. * supported values for now by host:
  5105. * 01 - 64bytes
  5106. * 10 - 128bytes
  5107. * 11 - 256bytes
  5108. * default - 128 bytes
  5109. * b'27:31 - rsvd2: Reserved for future use
  5110. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5111. * Enable MGMT packet from 0b0000 to 0b1001
  5112. * bits from low to high: FP, MD, MO - 3 bits
  5113. * FP: Filter_Pass
  5114. * MD: Monitor_Direct
  5115. * MO: Monitor_Other
  5116. * 10 mgmt subtypes * 3 bits -> 30 bits
  5117. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5118. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5119. * Enable MGMT packet from 0b1010 to 0b1111
  5120. * bits from low to high: FP, MD, MO - 3 bits
  5121. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5122. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5123. * Enable CTRL packet from 0b0000 to 0b1001
  5124. * bits from low to high: FP, MD, MO - 3 bits
  5125. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5126. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5127. * Enable CTRL packet from 0b1010 to 0b1111,
  5128. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5129. * bits from low to high: FP, MD, MO - 3 bits
  5130. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5131. * dword6 - b'0:31 - tlv_filter_in_flags:
  5132. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5133. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5134. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5135. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5136. * A value of 0 will be considered as ignore this config.
  5137. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5138. * e.g. wmac_top_reg_seq_hwioreg.h
  5139. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5140. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5141. * A value of 0 will be considered as ignore this config.
  5142. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5143. * e.g. wmac_top_reg_seq_hwioreg.h
  5144. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5145. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5146. * A value of 0 will be considered as ignore this config.
  5147. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5148. * e.g. wmac_top_reg_seq_hwioreg.h
  5149. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5150. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5151. * A value of 0 will be considered as ignore this config.
  5152. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5153. * e.g. wmac_top_reg_seq_hwioreg.h
  5154. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5155. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5156. * A value of 0 will be considered as ignore this config.
  5157. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5158. * e.g. wmac_top_reg_seq_hwioreg.h
  5159. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5160. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5161. * A value of 0 will be considered as ignore this config.
  5162. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5163. * e.g. wmac_top_reg_seq_hwioreg.h
  5164. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5165. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5166. * A value of 0 will be considered as ignore this config.
  5167. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5168. * e.g. wmac_top_reg_seq_hwioreg.h
  5169. * - b'16:31 - rsvd3 for future use
  5170. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5171. * to source rings. Consumer drops packets if the available
  5172. * words in the ring falls below the configured threshold
  5173. * value.
  5174. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5175. * by host. 1 -> subscribed
  5176. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5177. * by host. 1 -> subscribed
  5178. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5179. * subscribed by host. 1 -> subscribed
  5180. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5181. * selection for the FP PHY ERR status tlv.
  5182. * 0 - wbm2rxdma_buf_source_ring
  5183. * 1 - fw2rxdma_buf_source_ring
  5184. * 2 - sw2rxdma_buf_source_ring
  5185. * 3 - no_buffer_ring
  5186. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5187. * selection for the FP PHY ERR status tlv.
  5188. * 0 - rxdma_release_ring
  5189. * 1 - rxdma2fw_ring
  5190. * 2 - rxdma2sw_ring
  5191. * 3 - rxdma2reo_ring
  5192. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5193. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5194. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5195. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5196. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5197. * 0: MSDU level logging
  5198. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5199. * 0: MSDU level logging
  5200. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5201. * 0: MSDU level logging
  5202. * - b'23 - word_mask_compaction: enable/disable word mask for
  5203. * mpdu/msdu start/end tlvs
  5204. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5205. * manager override
  5206. * - b'25:28 - rbm_override_val: return buffer manager override value
  5207. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5208. * which have to be posted to host from phy.
  5209. * Corresponding to errors defined in
  5210. * phyrx_abort_request_reason enums 0 to 31.
  5211. * Refer to RXPCU register definition header files for the
  5212. * phyrx_abort_request_reason enum definition.
  5213. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5214. * errors which have to be posted to host from phy.
  5215. * Corresponding to errors defined in
  5216. * phyrx_abort_request_reason enums 32 to 63.
  5217. * Refer to RXPCU register definition header files for the
  5218. * phyrx_abort_request_reason enum definition.
  5219. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5220. * applicable if word mask enabled
  5221. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5222. * applicable if word mask enabled
  5223. * - b'19:31 - rsvd7
  5224. * dword15- b'0:16 - rx_msdu_end_word_mask
  5225. * - b'17:31 - rsvd5
  5226. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5227. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5228. * buffer
  5229. * 1: RX_PKT TLV logging at specified offset for the
  5230. * subsequent buffer
  5231. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5232. */
  5233. PREPACK struct htt_rx_ring_selection_cfg_t {
  5234. A_UINT32 msg_type: 8,
  5235. pdev_id: 8,
  5236. ring_id: 8,
  5237. status_swap: 1,
  5238. pkt_swap: 1,
  5239. rx_offsets_valid: 1,
  5240. drop_thresh_valid: 1,
  5241. rx_mon_global_en: 1,
  5242. rsvd1: 3;
  5243. A_UINT32 ring_buffer_size: 16,
  5244. config_length_mgmt:3,
  5245. config_length_ctrl:3,
  5246. config_length_data:3,
  5247. rx_hdr_len: 2,
  5248. rsvd2: 5;
  5249. A_UINT32 packet_type_enable_flags_0;
  5250. A_UINT32 packet_type_enable_flags_1;
  5251. A_UINT32 packet_type_enable_flags_2;
  5252. A_UINT32 packet_type_enable_flags_3;
  5253. A_UINT32 tlv_filter_in_flags;
  5254. A_UINT32 rx_packet_offset: 16,
  5255. rx_header_offset: 16;
  5256. A_UINT32 rx_mpdu_end_offset: 16,
  5257. rx_mpdu_start_offset: 16;
  5258. A_UINT32 rx_msdu_end_offset: 16,
  5259. rx_msdu_start_offset: 16;
  5260. A_UINT32 rx_attn_offset: 16,
  5261. rsvd3: 16;
  5262. A_UINT32 rx_drop_threshold: 10,
  5263. fp_ndp: 1,
  5264. mo_ndp: 1,
  5265. fp_phy_err: 1,
  5266. fp_phy_err_buf_src: 2,
  5267. fp_phy_err_buf_dest: 2,
  5268. pkt_type_enable_msdu_or_mpdu_logging:3,
  5269. dma_mpdu_mgmt: 1,
  5270. dma_mpdu_ctrl: 1,
  5271. dma_mpdu_data: 1,
  5272. word_mask_compaction_enable:1,
  5273. rbm_override_enable: 1,
  5274. rbm_override_val: 4,
  5275. rsvd4: 3;
  5276. A_UINT32 phy_err_mask;
  5277. A_UINT32 phy_err_mask_cont;
  5278. A_UINT32 rx_mpdu_start_word_mask:16,
  5279. rx_mpdu_end_word_mask: 3,
  5280. rsvd7: 13;
  5281. A_UINT32 rx_msdu_end_word_mask: 17,
  5282. rsvd5: 15;
  5283. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5284. rx_pkt_tlv_offset: 15,
  5285. rsvd6: 16;
  5286. } POSTPACK;
  5287. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5288. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5289. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5290. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5291. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5292. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5293. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5294. do { \
  5295. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5296. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5297. } while (0)
  5298. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5299. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5300. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5301. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5302. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5303. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5304. do { \
  5305. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5306. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5307. } while (0)
  5308. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5309. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5310. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5311. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5312. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5313. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5314. do { \
  5315. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5316. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5317. } while (0)
  5318. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5319. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5320. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5321. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5322. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5323. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5324. do { \
  5325. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5326. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5327. } while (0)
  5328. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5329. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5330. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5331. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5332. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5333. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5334. do { \
  5335. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5336. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5337. } while (0)
  5338. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5339. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5340. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5341. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5342. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5343. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5344. do { \
  5345. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5346. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5347. } while (0)
  5348. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5349. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5350. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5351. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5352. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5353. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5354. do { \
  5355. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5356. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5357. } while (0)
  5358. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5359. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5360. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5361. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5362. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5363. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5364. do { \
  5365. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5366. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5367. } while (0)
  5368. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5369. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5370. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5371. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5372. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5373. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5374. do { \
  5375. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5376. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5377. } while (0)
  5378. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5379. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5380. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5381. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5382. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5383. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5384. do { \
  5385. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5386. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5387. } while (0)
  5388. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5389. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5390. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5391. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5392. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5393. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5394. do { \
  5395. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5396. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5397. } while (0)
  5398. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5399. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5400. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5401. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5402. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5403. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5404. do { \
  5405. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5406. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5407. } while(0)
  5408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5411. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5412. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5414. do { \
  5415. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5416. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5417. } while (0)
  5418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5421. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5422. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5424. do { \
  5425. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5426. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5427. } while (0)
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5431. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5432. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5434. do { \
  5435. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5436. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5437. } while (0)
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5441. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5442. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5446. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5447. } while (0)
  5448. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5449. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5450. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5451. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5452. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5453. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5454. do { \
  5455. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5456. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5457. } while (0)
  5458. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5459. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5460. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5461. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5462. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5463. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5466. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5467. } while (0)
  5468. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5469. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5470. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5471. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5472. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5473. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5474. do { \
  5475. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5476. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5477. } while (0)
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5479. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5480. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5481. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5482. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5483. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5484. do { \
  5485. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5486. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5487. } while (0)
  5488. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5489. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5490. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5491. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5492. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5493. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5496. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5497. } while (0)
  5498. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5499. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5500. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5501. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5502. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5503. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5506. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5507. } while (0)
  5508. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5509. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5510. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5511. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5512. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5513. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5516. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5517. } while (0)
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5519. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5520. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5521. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5522. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5524. do { \
  5525. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5526. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5527. } while (0)
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5530. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5531. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5532. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5536. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5537. } while (0)
  5538. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5539. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5540. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5541. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5542. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5543. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5546. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5547. } while (0)
  5548. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5549. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5550. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5551. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5552. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5553. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5556. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5557. } while (0)
  5558. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5559. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5560. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5561. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5562. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5563. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5566. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5567. } while (0)
  5568. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5569. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5570. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5571. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5572. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5573. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5576. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5577. } while (0)
  5578. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5579. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5580. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5581. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5582. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5583. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5586. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5587. } while (0)
  5588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5591. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5592. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5594. do { \
  5595. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5596. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5597. } while (0)
  5598. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5599. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5600. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5601. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5602. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5603. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5604. do { \
  5605. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5606. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5607. } while (0)
  5608. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5609. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5610. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5611. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5612. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5613. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5616. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5617. } while (0)
  5618. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5619. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5620. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5621. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5622. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5623. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5626. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5627. } while (0)
  5628. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5629. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5630. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5631. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5632. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5633. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5634. do { \
  5635. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5636. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5637. } while (0)
  5638. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5639. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5640. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5641. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5642. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5643. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5644. do { \
  5645. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5646. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5647. } while (0)
  5648. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5649. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5650. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5651. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5652. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5653. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5654. do { \
  5655. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5656. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5657. } while (0)
  5658. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5659. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5660. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5661. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5662. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5663. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5664. do { \
  5665. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5666. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5667. } while (0)
  5668. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5669. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5670. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5671. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5672. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5673. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5674. do { \
  5675. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5676. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5677. } while (0)
  5678. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5679. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5680. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5681. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5682. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5683. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5684. do { \
  5685. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5686. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5687. } while (0)
  5688. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5689. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5690. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5691. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5692. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5694. do { \
  5695. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5696. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5697. } while (0)
  5698. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5699. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5700. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5701. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5702. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5703. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5704. do { \
  5705. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5706. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5707. } while (0)
  5708. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5709. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5710. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5711. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5712. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5713. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5714. do { \
  5715. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5716. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5717. } while (0)
  5718. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5719. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5720. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5721. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5722. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5723. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5724. do { \
  5725. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5726. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5727. } while (0)
  5728. /*
  5729. * Subtype based MGMT frames enable bits.
  5730. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5731. */
  5732. /* association request */
  5733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5739. /* association response */
  5740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5746. /* Reassociation request */
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5753. /* Reassociation response */
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5760. /* Probe request */
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5767. /* Probe response */
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5774. /* Timing Advertisement */
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5781. /* Reserved */
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5788. /* Beacon */
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5795. /* ATIM */
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5802. /* Disassociation */
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5809. /* Authentication */
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5816. /* Deauthentication */
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5823. /* Action */
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5830. /* Action No Ack */
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5837. /* Reserved */
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5844. /*
  5845. * Subtype based CTRL frames enable bits.
  5846. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5847. */
  5848. /* Reserved */
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5855. /* Reserved */
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5862. /* Reserved */
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5869. /* Reserved */
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5876. /* Reserved */
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5883. /* Reserved */
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5890. /* Reserved */
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5897. /* Control Wrapper */
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5904. /* Block Ack Request */
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5911. /* Block Ack*/
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5918. /* PS-POLL */
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5925. /* RTS */
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5932. /* CTS */
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5939. /* ACK */
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5946. /* CF-END */
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5953. /* CF-END + CF-ACK */
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5960. /* Multicast data */
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5967. /* Unicast data */
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5974. /* NULL data */
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5982. do { \
  5983. HTT_CHECK_SET_VAL(httsym, value); \
  5984. (word) |= (value) << httsym##_S; \
  5985. } while (0)
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5987. (((word) & httsym##_M) >> httsym##_S)
  5988. #define htt_rx_ring_pkt_enable_subtype_set( \
  5989. word, flag, mode, type, subtype, val) \
  5990. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5991. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5992. #define htt_rx_ring_pkt_enable_subtype_get( \
  5993. word, flag, mode, type, subtype) \
  5994. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5995. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5996. /* Definition to filter in TLVs */
  5997. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5998. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5999. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6025. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6026. do { \
  6027. HTT_CHECK_SET_VAL(httsym, enable); \
  6028. (word) |= (enable) << httsym##_S; \
  6029. } while (0)
  6030. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6031. (((word) & httsym##_M) >> httsym##_S)
  6032. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6033. HTT_RX_RING_TLV_ENABLE_SET( \
  6034. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6035. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6036. HTT_RX_RING_TLV_ENABLE_GET( \
  6037. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6038. /**
  6039. * @brief host -> target TX monitor config message
  6040. *
  6041. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6042. *
  6043. * @details
  6044. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6045. * configure RXDMA rings.
  6046. * The configuration is per ring based and includes both packet types
  6047. * and PPDU/MPDU TLVs.
  6048. *
  6049. * The message would appear as follows:
  6050. *
  6051. * |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|
  6052. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6053. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6054. * |-----------+--------+--------+-----+------------------------------------|
  6055. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6056. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6057. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6058. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6059. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6060. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6061. * |------------------------------------------------------------------------|
  6062. * | tlv_filter_mask_in0 |
  6063. * |------------------------------------------------------------------------|
  6064. * | tlv_filter_mask_in1 |
  6065. * |------------------------------------------------------------------------|
  6066. * | tlv_filter_mask_in2 |
  6067. * |------------------------------------------------------------------------|
  6068. * | tlv_filter_mask_in3 |
  6069. * |-----------------+-----------------+---------------------+--------------|
  6070. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6071. * |------------------------------------------------------------------------|
  6072. * | pcu_ppdu_setup_word_mask |
  6073. * |--------------------+--+--+--+-----+---------------------+--------------|
  6074. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6075. * |------------------------------------------------------------------------|
  6076. *
  6077. * Where:
  6078. * PS = pkt_swap
  6079. * SS = status_swap
  6080. * The message is interpreted as follows:
  6081. * dword0 - b'0:7 - msg_type: This will be set to
  6082. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6083. * b'8:15 - pdev_id:
  6084. * 0 (for rings at SOC level),
  6085. * 1/2/3 mac id (for rings at LMAC level)
  6086. * b'16:23 - ring_id : Identify the ring to configure.
  6087. * More details can be got from enum htt_srng_ring_id
  6088. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6089. * BUF_RING_CFG_0 defs within HW .h files,
  6090. * e.g. wmac_top_reg_seq_hwioreg.h
  6091. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6092. * BUF_RING_CFG_0 defs within HW .h files,
  6093. * e.g. wmac_top_reg_seq_hwioreg.h
  6094. * b'26 - tx_mon_global_en: Enable/Disable global register
  6095. * configuration in Tx monitor module.
  6096. * b'27:31 - rsvd1: reserved for future use
  6097. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6098. * in byte units.
  6099. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6100. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6101. * 64, 128, 256.
  6102. * If all 3 bits are set config length is > 256.
  6103. * if val is '0', then ignore this field.
  6104. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6105. * 64, 128, 256.
  6106. * If all 3 bits are set config length is > 256.
  6107. * if val is '0', then ignore this field.
  6108. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6109. * 64, 128, 256.
  6110. * If all 3 bits are set config length is > 256.
  6111. * If val is '0', then ignore this field.
  6112. * - b'25:31 - rsvd2: Reserved for future use
  6113. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6114. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6115. * If packet_type_enable_flags is '1' for MGMT type,
  6116. * monitor will ignore this bit and allow this TLV.
  6117. * If packet_type_enable_flags is '0' for MGMT type,
  6118. * monitor will use this bit to enable/disable logging
  6119. * of this TLV.
  6120. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6121. * If packet_type_enable_flags is '1' for CTRL type,
  6122. * monitor will ignore this bit and allow this TLV.
  6123. * If packet_type_enable_flags is '0' for CTRL type,
  6124. * monitor will use this bit to enable/disable logging
  6125. * of this TLV.
  6126. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  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. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6133. * If packet_type_enable_flags is '1' for MGMT type,
  6134. * monitor will ignore this bit and allow this TLV.
  6135. * If packet_type_enable_flags is '0' for MGMT type,
  6136. * monitor will use this bit to enable/disable logging
  6137. * of this TLV.
  6138. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6139. * If packet_type_enable_flags is '1' for CTRL type,
  6140. * monitor will ignore this bit and allow this TLV.
  6141. * If packet_type_enable_flags is '0' for CTRL type,
  6142. * monitor will use this bit to enable/disable logging
  6143. * of this TLV.
  6144. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6145. * If packet_type_enable_flags is '1' for DATA type,
  6146. * monitor will ignore this bit and allow this TLV.
  6147. * If packet_type_enable_flags is '0' for DATA type,
  6148. * monitor will use this bit to enable/disable logging
  6149. * of this TLV.
  6150. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6151. * If packet_type_enable_flags is '1' for MGMT type,
  6152. * monitor will ignore this bit and allow this TLV.
  6153. * If packet_type_enable_flags is '0' for MGMT type,
  6154. * monitor will use this bit to enable/disable logging
  6155. * of this TLV.
  6156. * If filter_in_TX_MPDU_START = 1 it is recommended
  6157. * to set this bit.
  6158. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6159. * If packet_type_enable_flags is '1' for CTRL type,
  6160. * monitor will ignore this bit and allow this TLV.
  6161. * If packet_type_enable_flags is '0' for CTRL type,
  6162. * monitor will use this bit to enable/disable logging
  6163. * of this TLV.
  6164. * If filter_in_TX_MPDU_START = 1 it is recommended
  6165. * to set this bit.
  6166. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6167. * If packet_type_enable_flags is '1' for DATA type,
  6168. * monitor will ignore this bit and allow this TLV.
  6169. * If packet_type_enable_flags is '0' for DATA type,
  6170. * monitor will use this bit to enable/disable logging
  6171. * of this TLV.
  6172. * If filter_in_TX_MPDU_START = 1 it is recommended
  6173. * to set this bit.
  6174. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6175. * If packet_type_enable_flags is '1' for MGMT type,
  6176. * monitor will ignore this bit and allow this TLV.
  6177. * If packet_type_enable_flags is '0' for MGMT type,
  6178. * monitor will use this bit to enable/disable logging
  6179. * of this TLV.
  6180. * If filter_in_TX_MSDU_START = 1 it is recommended
  6181. * to set this bit.
  6182. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6183. * If packet_type_enable_flags is '1' for CTRL type,
  6184. * monitor will ignore this bit and allow this TLV.
  6185. * If packet_type_enable_flags is '0' for CTRL type,
  6186. * monitor will use this bit to enable/disable logging
  6187. * of this TLV.
  6188. * If filter_in_TX_MSDU_START = 1 it is recommended
  6189. * to set this bit.
  6190. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6191. * If packet_type_enable_flags is '1' for DATA type,
  6192. * monitor will ignore this bit and allow this TLV.
  6193. * If packet_type_enable_flags is '0' for DATA type,
  6194. * monitor will use this bit to enable/disable logging
  6195. * of this TLV.
  6196. * If filter_in_TX_MSDU_START = 1 it is recommended
  6197. * to set this bit.
  6198. * b'15:31 - rsvd3: Reserved for future use
  6199. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6200. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6201. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6202. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6203. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6204. * - b'8:15 - tx_peer_entry_word_mask:
  6205. * - b'16:23 - tx_queue_ext_word_mask:
  6206. * - b'24:31 - tx_msdu_start_word_mask:
  6207. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6208. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6209. * - b'8:15 - rxpcu_user_setup_word_mask:
  6210. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6211. * MGMT, CTRL, DATA
  6212. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6213. * 0 -> MSDU level logging is enabled
  6214. * (valid only if bit is set in
  6215. * pkt_type_enable_msdu_or_mpdu_logging)
  6216. * 1 -> MPDU level logging is enabled
  6217. * (valid only if bit is set in
  6218. * pkt_type_enable_msdu_or_mpdu_logging)
  6219. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6220. * 0 -> MSDU level logging is enabled
  6221. * (valid only if bit is set in
  6222. * pkt_type_enable_msdu_or_mpdu_logging)
  6223. * 1 -> MPDU level logging is enabled
  6224. * (valid only if bit is set in
  6225. * pkt_type_enable_msdu_or_mpdu_logging)
  6226. * - b'21 - dma_mpdu_data(D) : For DATA
  6227. * 0 -> MSDU level logging is enabled
  6228. * (valid only if bit is set in
  6229. * pkt_type_enable_msdu_or_mpdu_logging)
  6230. * 1 -> MPDU level logging is enabled
  6231. * (valid only if bit is set in
  6232. * pkt_type_enable_msdu_or_mpdu_logging)
  6233. * - b'22:31 - rsvd4 for future use
  6234. */
  6235. PREPACK struct htt_tx_monitor_cfg_t {
  6236. A_UINT32 msg_type: 8,
  6237. pdev_id: 8,
  6238. ring_id: 8,
  6239. status_swap: 1,
  6240. pkt_swap: 1,
  6241. tx_mon_global_en: 1,
  6242. rsvd1: 5;
  6243. A_UINT32 ring_buffer_size: 16,
  6244. config_length_mgmt: 3,
  6245. config_length_ctrl: 3,
  6246. config_length_data: 3,
  6247. rsvd2: 7;
  6248. A_UINT32 pkt_type_enable_flags: 3,
  6249. filter_in_tx_mpdu_start_mgmt: 1,
  6250. filter_in_tx_mpdu_start_ctrl: 1,
  6251. filter_in_tx_mpdu_start_data: 1,
  6252. filter_in_tx_msdu_start_mgmt: 1,
  6253. filter_in_tx_msdu_start_ctrl: 1,
  6254. filter_in_tx_msdu_start_data: 1,
  6255. filter_in_tx_mpdu_end_mgmt: 1,
  6256. filter_in_tx_mpdu_end_ctrl: 1,
  6257. filter_in_tx_mpdu_end_data: 1,
  6258. filter_in_tx_msdu_end_mgmt: 1,
  6259. filter_in_tx_msdu_end_ctrl: 1,
  6260. filter_in_tx_msdu_end_data: 1,
  6261. rsvd3: 17;
  6262. A_UINT32 tlv_filter_mask_in0;
  6263. A_UINT32 tlv_filter_mask_in1;
  6264. A_UINT32 tlv_filter_mask_in2;
  6265. A_UINT32 tlv_filter_mask_in3;
  6266. A_UINT32 tx_fes_setup_word_mask: 8,
  6267. tx_peer_entry_word_mask: 8,
  6268. tx_queue_ext_word_mask: 8,
  6269. tx_msdu_start_word_mask: 8;
  6270. A_UINT32 pcu_ppdu_setup_word_mask;
  6271. A_UINT32 tx_mpdu_start_word_mask: 8,
  6272. rxpcu_user_setup_word_mask: 8,
  6273. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6274. dma_mpdu_mgmt: 1,
  6275. dma_mpdu_ctrl: 1,
  6276. dma_mpdu_data: 1,
  6277. rsvd4: 10;
  6278. } POSTPACK;
  6279. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6280. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6281. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6282. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6283. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6284. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6285. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6286. do { \
  6287. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6288. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6289. } while (0)
  6290. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6291. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6292. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6293. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6294. HTT_TX_MONITOR_CFG_RING_ID_S)
  6295. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6296. do { \
  6297. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6298. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6299. } while (0)
  6300. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6301. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6302. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6303. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6304. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6305. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6306. do { \
  6307. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6308. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6309. } while (0)
  6310. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6311. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6312. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6313. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6314. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6315. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6316. do { \
  6317. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6318. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6319. } while (0)
  6320. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6321. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6322. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6323. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6324. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6325. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6326. do { \
  6327. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6328. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6329. } while (0)
  6330. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6331. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6332. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6333. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6334. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6335. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6336. do { \
  6337. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6338. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6339. } while (0)
  6340. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6341. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6342. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6343. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6344. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6345. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6346. do { \
  6347. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6348. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6349. } while (0)
  6350. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6351. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6352. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6353. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6354. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6355. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6356. do { \
  6357. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6358. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6359. } while (0)
  6360. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6361. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6362. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6363. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6364. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6365. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6366. do { \
  6367. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6368. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6369. } while (0)
  6370. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6371. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6372. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6373. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6374. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6375. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6376. do { \
  6377. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6378. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6379. } while (0)
  6380. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6381. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6382. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6383. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6384. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6385. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6386. do { \
  6387. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6388. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6389. } while (0)
  6390. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6391. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6392. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6393. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6394. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6395. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6396. do { \
  6397. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6398. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6399. } while (0)
  6400. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6401. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6402. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6403. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6404. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6405. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6406. do { \
  6407. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6408. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6409. } while (0)
  6410. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6411. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6412. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6413. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6414. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6415. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6416. do { \
  6417. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6418. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6419. } while (0)
  6420. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6421. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6422. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6423. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6424. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6425. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6426. do { \
  6427. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6428. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6429. } while (0)
  6430. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6431. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6432. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6433. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6434. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6435. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6436. do { \
  6437. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6438. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6439. } while (0)
  6440. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6441. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6442. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6443. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6444. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6445. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6446. do { \
  6447. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6448. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6449. } while (0)
  6450. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6451. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6452. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6453. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6454. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6455. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6456. do { \
  6457. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6458. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6459. } while (0)
  6460. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6461. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6462. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6463. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6464. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6465. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6466. do { \
  6467. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6468. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6469. } while (0)
  6470. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6471. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6472. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6473. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6474. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6475. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6476. do { \
  6477. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6478. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6479. } while (0)
  6480. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6481. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6482. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6483. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6484. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6485. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6486. do { \
  6487. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6488. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6489. } while (0)
  6490. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6491. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6492. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6493. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6494. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6495. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6496. do { \
  6497. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6498. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6499. } while (0)
  6500. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6501. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6502. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6503. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6504. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6505. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6506. do { \
  6507. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6508. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6509. } while (0)
  6510. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6511. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6512. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6513. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6514. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6515. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6516. do { \
  6517. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6518. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6519. } while (0)
  6520. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6521. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6522. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6523. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6524. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6525. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6526. do { \
  6527. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6528. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6529. } while (0)
  6530. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6531. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6532. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6533. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6534. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6535. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6536. do { \
  6537. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6538. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6539. } while (0)
  6540. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6541. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6542. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6543. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6544. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6545. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6546. do { \
  6547. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6548. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6549. } while (0)
  6550. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6551. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6552. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6553. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6554. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6555. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6556. do { \
  6557. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6558. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6559. } while (0)
  6560. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6561. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6562. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6563. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6564. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6565. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6566. do { \
  6567. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6568. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6569. } while (0)
  6570. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6571. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6572. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6573. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6574. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6575. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6576. do { \
  6577. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6578. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6579. } while (0)
  6580. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6581. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6582. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6583. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6584. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6585. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6586. do { \
  6587. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6588. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6589. } while (0)
  6590. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6591. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6592. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6593. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6594. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6595. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6596. do { \
  6597. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6598. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6599. } while (0)
  6600. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6601. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6602. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6603. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6604. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6605. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6606. do { \
  6607. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6608. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6609. } while (0)
  6610. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6611. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6612. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6613. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6614. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6615. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6616. do { \
  6617. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6618. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6619. } while (0)
  6620. /*
  6621. * pkt_type_enable_flags
  6622. */
  6623. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6624. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6627. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6628. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6629. /*
  6630. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6631. */
  6632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6638. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6639. do { \
  6640. HTT_CHECK_SET_VAL(httsym, value); \
  6641. (word) |= (value) << httsym##_S; \
  6642. } while (0)
  6643. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6644. (((word) & httsym##_M) >> httsym##_S)
  6645. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6646. * type -> MGMT, CTRL, DATA*/
  6647. #define htt_tx_ring_pkt_type_set( \
  6648. word, mode, type, val) \
  6649. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6650. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6651. #define htt_tx_ring_pkt_type_get( \
  6652. word, mode, type) \
  6653. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6654. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6655. /* Definition to filter in TLVs */
  6656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6720. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6721. do { \
  6722. HTT_CHECK_SET_VAL(httsym, enable); \
  6723. (word) |= (enable) << httsym##_S; \
  6724. } while (0)
  6725. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6726. (((word) & httsym##_M) >> httsym##_S)
  6727. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6728. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6729. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6730. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6731. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6732. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6797. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6798. do { \
  6799. HTT_CHECK_SET_VAL(httsym, enable); \
  6800. (word) |= (enable) << httsym##_S; \
  6801. } while (0)
  6802. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6803. (((word) & httsym##_M) >> httsym##_S)
  6804. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6805. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6806. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6807. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6808. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6809. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6874. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6875. do { \
  6876. HTT_CHECK_SET_VAL(httsym, enable); \
  6877. (word) |= (enable) << httsym##_S; \
  6878. } while (0)
  6879. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6880. (((word) & httsym##_M) >> httsym##_S)
  6881. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6882. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6883. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6884. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6885. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6886. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6931. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6932. do { \
  6933. HTT_CHECK_SET_VAL(httsym, enable); \
  6934. (word) |= (enable) << httsym##_S; \
  6935. } while (0)
  6936. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6937. (((word) & httsym##_M) >> httsym##_S)
  6938. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6939. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6940. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6941. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6942. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6943. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6944. /**
  6945. * @brief host --> target Receive Flow Steering configuration message definition
  6946. *
  6947. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6948. *
  6949. * host --> target Receive Flow Steering configuration message definition.
  6950. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6951. * The reason for this is we want RFS to be configured and ready before MAC
  6952. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6953. *
  6954. * |31 24|23 16|15 9|8|7 0|
  6955. * |----------------+----------------+----------------+----------------|
  6956. * | reserved |E| msg type |
  6957. * |-------------------------------------------------------------------|
  6958. * Where E = RFS enable flag
  6959. *
  6960. * The RFS_CONFIG message consists of a single 4-byte word.
  6961. *
  6962. * Header fields:
  6963. * - MSG_TYPE
  6964. * Bits 7:0
  6965. * Purpose: identifies this as a RFS config msg
  6966. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6967. * - RFS_CONFIG
  6968. * Bit 8
  6969. * Purpose: Tells target whether to enable (1) or disable (0)
  6970. * flow steering feature when sending rx indication messages to host
  6971. */
  6972. #define HTT_H2T_RFS_CONFIG_M 0x100
  6973. #define HTT_H2T_RFS_CONFIG_S 8
  6974. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6975. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6976. HTT_H2T_RFS_CONFIG_S)
  6977. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6978. do { \
  6979. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6980. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6981. } while (0)
  6982. #define HTT_RFS_CFG_REQ_BYTES 4
  6983. /**
  6984. * @brief host -> target FW extended statistics request
  6985. *
  6986. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6987. *
  6988. * @details
  6989. * The following field definitions describe the format of the HTT host
  6990. * to target FW extended stats retrieve message.
  6991. * The message specifies the type of stats the host wants to retrieve.
  6992. *
  6993. * |31 24|23 16|15 8|7 0|
  6994. * |-----------------------------------------------------------|
  6995. * | reserved | stats type | pdev_mask | msg type |
  6996. * |-----------------------------------------------------------|
  6997. * | config param [0] |
  6998. * |-----------------------------------------------------------|
  6999. * | config param [1] |
  7000. * |-----------------------------------------------------------|
  7001. * | config param [2] |
  7002. * |-----------------------------------------------------------|
  7003. * | config param [3] |
  7004. * |-----------------------------------------------------------|
  7005. * | reserved |
  7006. * |-----------------------------------------------------------|
  7007. * | cookie LSBs |
  7008. * |-----------------------------------------------------------|
  7009. * | cookie MSBs |
  7010. * |-----------------------------------------------------------|
  7011. * Header fields:
  7012. * - MSG_TYPE
  7013. * Bits 7:0
  7014. * Purpose: identifies this is a extended stats upload request message
  7015. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7016. * - PDEV_MASK
  7017. * Bits 8:15
  7018. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7019. * Value: This is a overloaded field, refer to usage and interpretation of
  7020. * PDEV in interface document.
  7021. * Bit 8 : Reserved for SOC stats
  7022. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7023. * Indicates MACID_MASK in DBS
  7024. * - STATS_TYPE
  7025. * Bits 23:16
  7026. * Purpose: identifies which FW statistics to upload
  7027. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7028. * - Reserved
  7029. * Bits 31:24
  7030. * - CONFIG_PARAM [0]
  7031. * Bits 31:0
  7032. * Purpose: give an opaque configuration value to the specified stats type
  7033. * Value: stats-type specific configuration value
  7034. * Refer to htt_stats.h for interpretation for each stats sub_type
  7035. * - CONFIG_PARAM [1]
  7036. * Bits 31:0
  7037. * Purpose: give an opaque configuration value to the specified stats type
  7038. * Value: stats-type specific configuration value
  7039. * Refer to htt_stats.h for interpretation for each stats sub_type
  7040. * - CONFIG_PARAM [2]
  7041. * Bits 31:0
  7042. * Purpose: give an opaque configuration value to the specified stats type
  7043. * Value: stats-type specific configuration value
  7044. * Refer to htt_stats.h for interpretation for each stats sub_type
  7045. * - CONFIG_PARAM [3]
  7046. * Bits 31:0
  7047. * Purpose: give an opaque configuration value to the specified stats type
  7048. * Value: stats-type specific configuration value
  7049. * Refer to htt_stats.h for interpretation for each stats sub_type
  7050. * - Reserved [31:0] for future use.
  7051. * - COOKIE_LSBS
  7052. * Bits 31:0
  7053. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7054. * message with its preceding host->target stats request message.
  7055. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7056. * - COOKIE_MSBS
  7057. * Bits 31:0
  7058. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7059. * message with its preceding host->target stats request message.
  7060. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7061. */
  7062. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7063. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7064. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7065. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7066. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7067. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7068. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7069. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7070. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7071. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7072. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7073. do { \
  7074. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7075. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7076. } while (0)
  7077. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7078. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7079. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7080. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7081. do { \
  7082. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7083. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7084. } while (0)
  7085. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7086. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7087. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7088. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7089. do { \
  7090. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7091. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7092. } while (0)
  7093. /**
  7094. * @brief host -> target FW streaming statistics request
  7095. *
  7096. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7097. *
  7098. * @details
  7099. * The following field definitions describe the format of the HTT host
  7100. * to target message that requests the target to start or stop producing
  7101. * ongoing stats of the specified type.
  7102. *
  7103. * |31|30 |23 16|15 8|7 0|
  7104. * |-----------------------------------------------------------|
  7105. * |EN| reserved | stats type | reserved | msg type |
  7106. * |-----------------------------------------------------------|
  7107. * | config param [0] |
  7108. * |-----------------------------------------------------------|
  7109. * | config param [1] |
  7110. * |-----------------------------------------------------------|
  7111. * | config param [2] |
  7112. * |-----------------------------------------------------------|
  7113. * | config param [3] |
  7114. * |-----------------------------------------------------------|
  7115. * Where:
  7116. * - EN is an enable/disable flag
  7117. * Header fields:
  7118. * - MSG_TYPE
  7119. * Bits 7:0
  7120. * Purpose: identifies this is a streaming stats upload request message
  7121. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7122. * - STATS_TYPE
  7123. * Bits 23:16
  7124. * Purpose: identifies which FW statistics to upload
  7125. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7126. * Only the htt_dbg_ext_stats_type values identified as streaming
  7127. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7128. * - ENABLE
  7129. * Bit 31
  7130. * Purpose: enable/disable the target's ongoing stats of the specified type
  7131. * Value:
  7132. * 0 - disable ongoing production of the specified stats type
  7133. * 1 - enable ongoing production of the specified stats type
  7134. * - CONFIG_PARAM [0]
  7135. * Bits 31:0
  7136. * Purpose: give an opaque configuration value to the specified stats type
  7137. * Value: stats-type specific configuration value
  7138. * Refer to htt_stats.h for interpretation for each stats sub_type
  7139. * - CONFIG_PARAM [1]
  7140. * Bits 31:0
  7141. * Purpose: give an opaque configuration value to the specified stats type
  7142. * Value: stats-type specific configuration value
  7143. * Refer to htt_stats.h for interpretation for each stats sub_type
  7144. * - CONFIG_PARAM [2]
  7145. * Bits 31:0
  7146. * Purpose: give an opaque configuration value to the specified stats type
  7147. * Value: stats-type specific configuration value
  7148. * Refer to htt_stats.h for interpretation for each stats sub_type
  7149. * - CONFIG_PARAM [3]
  7150. * Bits 31:0
  7151. * Purpose: give an opaque configuration value to the specified stats type
  7152. * Value: stats-type specific configuration value
  7153. * Refer to htt_stats.h for interpretation for each stats sub_type
  7154. */
  7155. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7156. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7157. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7158. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7159. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7160. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7161. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7162. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7163. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7164. do { \
  7165. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7166. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7167. } while (0)
  7168. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7169. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7170. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7171. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7172. do { \
  7173. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7174. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7175. } while (0)
  7176. /**
  7177. * @brief host -> target FW PPDU_STATS request message
  7178. *
  7179. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7180. *
  7181. * @details
  7182. * The following field definitions describe the format of the HTT host
  7183. * to target FW for PPDU_STATS_CFG msg.
  7184. * The message allows the host to configure the PPDU_STATS_IND messages
  7185. * produced by the target.
  7186. *
  7187. * |31 24|23 16|15 8|7 0|
  7188. * |-----------------------------------------------------------|
  7189. * | REQ bit mask | pdev_mask | msg type |
  7190. * |-----------------------------------------------------------|
  7191. * Header fields:
  7192. * - MSG_TYPE
  7193. * Bits 7:0
  7194. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7195. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7196. * - PDEV_MASK
  7197. * Bits 8:15
  7198. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7199. * Value: This is a overloaded field, refer to usage and interpretation of
  7200. * PDEV in interface document.
  7201. * Bit 8 : Reserved for SOC stats
  7202. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7203. * Indicates MACID_MASK in DBS
  7204. * - REQ_TLV_BIT_MASK
  7205. * Bits 16:31
  7206. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7207. * needs to be included in the target's PPDU_STATS_IND messages.
  7208. * Value: refer htt_ppdu_stats_tlv_tag_t
  7209. *
  7210. */
  7211. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7212. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7213. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7214. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7215. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7216. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7217. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7218. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7219. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7220. do { \
  7221. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7222. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7223. } while (0)
  7224. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7225. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7226. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7227. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7228. do { \
  7229. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7230. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7231. } while (0)
  7232. /**
  7233. * @brief Host-->target HTT RX FSE setup message
  7234. *
  7235. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7236. *
  7237. * @details
  7238. * Through this message, the host will provide details of the flow tables
  7239. * in host DDR along with hash keys.
  7240. * This message can be sent per SOC or per PDEV, which is differentiated
  7241. * by pdev id values.
  7242. * The host will allocate flow search table and sends table size,
  7243. * physical DMA address of flow table, and hash keys to firmware to
  7244. * program into the RXOLE FSE HW block.
  7245. *
  7246. * The following field definitions describe the format of the RX FSE setup
  7247. * message sent from the host to target
  7248. *
  7249. * Header fields:
  7250. * dword0 - b'7:0 - msg_type: This will be set to
  7251. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7252. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7253. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7254. * pdev's LMAC ring.
  7255. * b'31:16 - reserved : Reserved for future use
  7256. * dword1 - b'19:0 - number of records: This field indicates the number of
  7257. * entries in the flow table. For example: 8k number of
  7258. * records is equivalent to
  7259. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7260. * b'27:20 - max search: This field specifies the skid length to FSE
  7261. * parser HW module whenever match is not found at the
  7262. * exact index pointed by hash.
  7263. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7264. * Refer htt_ip_da_sa_prefix below for more details.
  7265. * b'31:30 - reserved: Reserved for future use
  7266. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7267. * table allocated by host in DDR
  7268. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7269. * table allocated by host in DDR
  7270. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7271. * entry hashing
  7272. *
  7273. *
  7274. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7275. * |---------------------------------------------------------------|
  7276. * | reserved | pdev_id | MSG_TYPE |
  7277. * |---------------------------------------------------------------|
  7278. * |resvd|IPDSA| max_search | Number of records |
  7279. * |---------------------------------------------------------------|
  7280. * | base address lo |
  7281. * |---------------------------------------------------------------|
  7282. * | base address high |
  7283. * |---------------------------------------------------------------|
  7284. * | toeplitz key 31_0 |
  7285. * |---------------------------------------------------------------|
  7286. * | toeplitz key 63_32 |
  7287. * |---------------------------------------------------------------|
  7288. * | toeplitz key 95_64 |
  7289. * |---------------------------------------------------------------|
  7290. * | toeplitz key 127_96 |
  7291. * |---------------------------------------------------------------|
  7292. * | toeplitz key 159_128 |
  7293. * |---------------------------------------------------------------|
  7294. * | toeplitz key 191_160 |
  7295. * |---------------------------------------------------------------|
  7296. * | toeplitz key 223_192 |
  7297. * |---------------------------------------------------------------|
  7298. * | toeplitz key 255_224 |
  7299. * |---------------------------------------------------------------|
  7300. * | toeplitz key 287_256 |
  7301. * |---------------------------------------------------------------|
  7302. * | reserved | toeplitz key 314_288(26:0 bits) |
  7303. * |---------------------------------------------------------------|
  7304. * where:
  7305. * IPDSA = ip_da_sa
  7306. */
  7307. /**
  7308. * @brief: htt_ip_da_sa_prefix
  7309. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7310. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7311. * documentation per RFC3849
  7312. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7313. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7314. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7315. */
  7316. enum htt_ip_da_sa_prefix {
  7317. HTT_RX_IPV6_20010db8,
  7318. HTT_RX_IPV4_MAPPED_IPV6,
  7319. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7320. HTT_RX_IPV6_64FF9B,
  7321. };
  7322. /**
  7323. * @brief Host-->target HTT RX FISA configure and enable
  7324. *
  7325. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7326. *
  7327. * @details
  7328. * The host will send this command down to configure and enable the FISA
  7329. * operational params.
  7330. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7331. * register.
  7332. * Should configure both the MACs.
  7333. *
  7334. * dword0 - b'7:0 - msg_type:
  7335. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7336. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7337. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7338. * pdev's LMAC ring.
  7339. * b'31:16 - reserved : Reserved for future use
  7340. *
  7341. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7342. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7343. * packets. 1 flow search will be skipped
  7344. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7345. * tcp,udp packets
  7346. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7347. * calculation
  7348. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7349. * calculation
  7350. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7351. * calculation
  7352. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7353. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7354. * length
  7355. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7356. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7357. * length
  7358. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7359. * num jump
  7360. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7361. * num jump
  7362. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7363. * data type switch has happend for MPDU Sequence num jump
  7364. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7365. * for MPDU Sequence num jump
  7366. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7367. * for decrypt errors
  7368. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7369. * while aggregating a msdu
  7370. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7371. * The aggregation is done until (number of MSDUs aggregated
  7372. * < LIMIT + 1)
  7373. * b'31:18 - Reserved
  7374. *
  7375. * fisa_control_value - 32bit value FW can write to register
  7376. *
  7377. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7378. * Threshold value for FISA timeout (units are microseconds).
  7379. * When the global timestamp exceeds this threshold, FISA
  7380. * aggregation will be restarted.
  7381. * A value of 0 means timeout is disabled.
  7382. * Compare the threshold register with timestamp field in
  7383. * flow entry to generate timeout for the flow.
  7384. *
  7385. * |31 18 |17 16|15 8|7 0|
  7386. * |-------------------------------------------------------------|
  7387. * | reserved | pdev_mask | msg type |
  7388. * |-------------------------------------------------------------|
  7389. * | reserved | FISA_CTRL |
  7390. * |-------------------------------------------------------------|
  7391. * | FISA_TIMEOUT_THRESH |
  7392. * |-------------------------------------------------------------|
  7393. */
  7394. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7395. A_UINT32 msg_type:8,
  7396. pdev_id:8,
  7397. reserved0:16;
  7398. /**
  7399. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7400. * [17:0]
  7401. */
  7402. union {
  7403. /*
  7404. * fisa_control_bits structure is deprecated.
  7405. * Please use fisa_control_bits_v2 going forward.
  7406. */
  7407. struct {
  7408. A_UINT32 fisa_enable: 1,
  7409. ipsec_skip_search: 1,
  7410. nontcp_skip_search: 1,
  7411. add_ipv4_fixed_hdr_len: 1,
  7412. add_ipv6_fixed_hdr_len: 1,
  7413. add_tcp_fixed_hdr_len: 1,
  7414. add_udp_hdr_len: 1,
  7415. chksum_cum_ip_len_en: 1,
  7416. disable_tid_check: 1,
  7417. disable_ta_check: 1,
  7418. disable_qos_check: 1,
  7419. disable_raw_check: 1,
  7420. disable_decrypt_err_check: 1,
  7421. disable_msdu_drop_check: 1,
  7422. fisa_aggr_limit: 4,
  7423. reserved: 14;
  7424. } fisa_control_bits;
  7425. struct {
  7426. A_UINT32 fisa_enable: 1,
  7427. fisa_aggr_limit: 4,
  7428. reserved: 27;
  7429. } fisa_control_bits_v2;
  7430. A_UINT32 fisa_control_value;
  7431. } u_fisa_control;
  7432. /**
  7433. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7434. * timeout threshold for aggregation. Unit in usec.
  7435. * [31:0]
  7436. */
  7437. A_UINT32 fisa_timeout_threshold;
  7438. } POSTPACK;
  7439. /* DWord 0: pdev-ID */
  7440. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7441. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7442. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7443. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7444. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7445. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7446. do { \
  7447. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7448. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7449. } while (0)
  7450. /* Dword 1: fisa_control_value fisa config */
  7451. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7452. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7453. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7454. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7455. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7456. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7457. do { \
  7458. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7459. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7460. } while (0)
  7461. /* Dword 1: fisa_control_value ipsec_skip_search */
  7462. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7463. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7464. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7465. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7466. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7467. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7468. do { \
  7469. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7470. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7471. } while (0)
  7472. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7473. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7474. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7475. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7476. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7477. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7478. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7479. do { \
  7480. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7481. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7482. } while (0)
  7483. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7484. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7485. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7486. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7487. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7488. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7489. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7490. do { \
  7491. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7492. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7493. } while (0)
  7494. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7495. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7496. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7497. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7498. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7499. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7500. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7501. do { \
  7502. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7503. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7504. } while (0)
  7505. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7506. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7507. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7508. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7509. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7510. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7511. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7512. do { \
  7513. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7514. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7515. } while (0)
  7516. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7517. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7518. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7519. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7520. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7521. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7522. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7523. do { \
  7524. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7525. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7526. } while (0)
  7527. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7528. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7529. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7530. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7531. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7532. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7533. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7534. do { \
  7535. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7536. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7537. } while (0)
  7538. /* Dword 1: fisa_control_value disable_tid_check */
  7539. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7540. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7541. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7542. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7543. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7544. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7545. do { \
  7546. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7547. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7548. } while (0)
  7549. /* Dword 1: fisa_control_value disable_ta_check */
  7550. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7551. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7552. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7553. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7554. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7555. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7556. do { \
  7557. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7558. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7559. } while (0)
  7560. /* Dword 1: fisa_control_value disable_qos_check */
  7561. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7562. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7563. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7564. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7565. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7566. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7567. do { \
  7568. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7569. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7570. } while (0)
  7571. /* Dword 1: fisa_control_value disable_raw_check */
  7572. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7573. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7574. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7575. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7576. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7577. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7578. do { \
  7579. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7580. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7581. } while (0)
  7582. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7583. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7584. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7585. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7586. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7587. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7588. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7589. do { \
  7590. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7591. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7592. } while (0)
  7593. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7594. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7595. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7596. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7597. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7598. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7599. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7600. do { \
  7601. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7602. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7603. } while (0)
  7604. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7605. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7606. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7607. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7608. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7609. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7610. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7611. do { \
  7612. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7613. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7614. } while (0)
  7615. /* Dword 1: fisa_control_value fisa config */
  7616. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7617. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7618. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7619. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7620. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7621. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7622. do { \
  7623. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7624. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7625. } while (0)
  7626. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7627. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7628. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7629. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7630. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7631. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7632. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7633. do { \
  7634. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7635. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7636. } while (0)
  7637. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7638. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7639. pdev_id:8,
  7640. reserved0:16;
  7641. A_UINT32 num_records:20,
  7642. max_search:8,
  7643. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7644. reserved1:2;
  7645. A_UINT32 base_addr_lo;
  7646. A_UINT32 base_addr_hi;
  7647. A_UINT32 toeplitz31_0;
  7648. A_UINT32 toeplitz63_32;
  7649. A_UINT32 toeplitz95_64;
  7650. A_UINT32 toeplitz127_96;
  7651. A_UINT32 toeplitz159_128;
  7652. A_UINT32 toeplitz191_160;
  7653. A_UINT32 toeplitz223_192;
  7654. A_UINT32 toeplitz255_224;
  7655. A_UINT32 toeplitz287_256;
  7656. A_UINT32 toeplitz314_288:27,
  7657. reserved2:5;
  7658. } POSTPACK;
  7659. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7660. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7661. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7662. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7663. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7664. /* DWORD 0: Pdev ID */
  7665. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7666. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7667. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7668. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7669. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7670. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7671. do { \
  7672. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7673. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7674. } while (0)
  7675. /* DWORD 1:num of records */
  7676. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7677. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7678. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7679. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7680. HTT_RX_FSE_SETUP_NUM_REC_S)
  7681. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7682. do { \
  7683. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7684. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7685. } while (0)
  7686. /* DWORD 1:max_search */
  7687. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7688. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7689. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7690. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7691. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7692. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7693. do { \
  7694. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7695. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7696. } while (0)
  7697. /* DWORD 1:ip_da_sa prefix */
  7698. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7699. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7700. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7701. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7702. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7703. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7704. do { \
  7705. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7706. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7707. } while (0)
  7708. /* DWORD 2: Base Address LO */
  7709. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7710. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7711. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7712. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7713. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7714. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7715. do { \
  7716. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7717. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7718. } while (0)
  7719. /* DWORD 3: Base Address High */
  7720. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7721. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7722. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7723. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7724. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7725. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7726. do { \
  7727. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7728. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7729. } while (0)
  7730. /* DWORD 4-12: Hash Value */
  7731. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7732. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7733. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7734. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7735. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7736. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7737. do { \
  7738. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7739. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7740. } while (0)
  7741. /* DWORD 13: Hash Value 314:288 bits */
  7742. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7743. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7744. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7745. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7746. do { \
  7747. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7748. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7749. } while (0)
  7750. /**
  7751. * @brief Host-->target HTT RX FSE operation message
  7752. *
  7753. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7754. *
  7755. * @details
  7756. * The host will send this Flow Search Engine (FSE) operation message for
  7757. * every flow add/delete operation.
  7758. * The FSE operation includes FSE full cache invalidation or individual entry
  7759. * invalidation.
  7760. * This message can be sent per SOC or per PDEV which is differentiated
  7761. * by pdev id values.
  7762. *
  7763. * |31 16|15 8|7 1|0|
  7764. * |-------------------------------------------------------------|
  7765. * | reserved | pdev_id | MSG_TYPE |
  7766. * |-------------------------------------------------------------|
  7767. * | reserved | operation |I|
  7768. * |-------------------------------------------------------------|
  7769. * | ip_src_addr_31_0 |
  7770. * |-------------------------------------------------------------|
  7771. * | ip_src_addr_63_32 |
  7772. * |-------------------------------------------------------------|
  7773. * | ip_src_addr_95_64 |
  7774. * |-------------------------------------------------------------|
  7775. * | ip_src_addr_127_96 |
  7776. * |-------------------------------------------------------------|
  7777. * | ip_dst_addr_31_0 |
  7778. * |-------------------------------------------------------------|
  7779. * | ip_dst_addr_63_32 |
  7780. * |-------------------------------------------------------------|
  7781. * | ip_dst_addr_95_64 |
  7782. * |-------------------------------------------------------------|
  7783. * | ip_dst_addr_127_96 |
  7784. * |-------------------------------------------------------------|
  7785. * | l4_dst_port | l4_src_port |
  7786. * | (32-bit SPI incase of IPsec) |
  7787. * |-------------------------------------------------------------|
  7788. * | reserved | l4_proto |
  7789. * |-------------------------------------------------------------|
  7790. *
  7791. * where I is 1-bit ipsec_valid.
  7792. *
  7793. * The following field definitions describe the format of the RX FSE operation
  7794. * message sent from the host to target for every add/delete flow entry to flow
  7795. * table.
  7796. *
  7797. * Header fields:
  7798. * dword0 - b'7:0 - msg_type: This will be set to
  7799. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7800. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7801. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7802. * specified pdev's LMAC ring.
  7803. * b'31:16 - reserved : Reserved for future use
  7804. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7805. * (Internet Protocol Security).
  7806. * IPsec describes the framework for providing security at
  7807. * IP layer. IPsec is defined for both versions of IP:
  7808. * IPV4 and IPV6.
  7809. * Please refer to htt_rx_flow_proto enumeration below for
  7810. * more info.
  7811. * ipsec_valid = 1 for IPSEC packets
  7812. * ipsec_valid = 0 for IP Packets
  7813. * b'7:1 - operation: This indicates types of FSE operation.
  7814. * Refer to htt_rx_fse_operation enumeration:
  7815. * 0 - No Cache Invalidation required
  7816. * 1 - Cache invalidate only one entry given by IP
  7817. * src/dest address at DWORD[2:9]
  7818. * 2 - Complete FSE Cache Invalidation
  7819. * 3 - FSE Disable
  7820. * 4 - FSE Enable
  7821. * b'31:8 - reserved: Reserved for future use
  7822. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7823. * for per flow addition/deletion
  7824. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7825. * and the subsequent 3 A_UINT32 will be padding bytes.
  7826. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7827. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7828. * from 0 to 65535 but only 0 to 1023 are designated as
  7829. * well-known ports. Refer to [RFC1700] for more details.
  7830. * This field is valid only if
  7831. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7832. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7833. * range from 0 to 65535 but only 0 to 1023 are designated
  7834. * as well-known ports. Refer to [RFC1700] for more details.
  7835. * This field is valid only if
  7836. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7837. * - SPI (31:0): Security Parameters Index is an
  7838. * identification tag added to the header while using IPsec
  7839. * for tunneling the IP traffici.
  7840. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7841. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7842. * Assigned Internet Protocol Numbers.
  7843. * l4_proto numbers for standard protocol like UDP/TCP
  7844. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7845. * l4_proto = 17 for UDP etc.
  7846. * b'31:8 - reserved: Reserved for future use.
  7847. *
  7848. */
  7849. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7850. A_UINT32 msg_type:8,
  7851. pdev_id:8,
  7852. reserved0:16;
  7853. A_UINT32 ipsec_valid:1,
  7854. operation:7,
  7855. reserved1:24;
  7856. A_UINT32 ip_src_addr_31_0;
  7857. A_UINT32 ip_src_addr_63_32;
  7858. A_UINT32 ip_src_addr_95_64;
  7859. A_UINT32 ip_src_addr_127_96;
  7860. A_UINT32 ip_dest_addr_31_0;
  7861. A_UINT32 ip_dest_addr_63_32;
  7862. A_UINT32 ip_dest_addr_95_64;
  7863. A_UINT32 ip_dest_addr_127_96;
  7864. union {
  7865. A_UINT32 spi;
  7866. struct {
  7867. A_UINT32 l4_src_port:16,
  7868. l4_dest_port:16;
  7869. } ip;
  7870. } u;
  7871. A_UINT32 l4_proto:8,
  7872. reserved:24;
  7873. } POSTPACK;
  7874. /**
  7875. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7876. *
  7877. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7878. *
  7879. * @details
  7880. * The host will send this Full monitor mode register configuration message.
  7881. * This message can be sent per SOC or per PDEV which is differentiated
  7882. * by pdev id values.
  7883. *
  7884. * |31 16|15 11|10 8|7 3|2|1|0|
  7885. * |-------------------------------------------------------------|
  7886. * | reserved | pdev_id | MSG_TYPE |
  7887. * |-------------------------------------------------------------|
  7888. * | reserved |Release Ring |N|Z|E|
  7889. * |-------------------------------------------------------------|
  7890. *
  7891. * where E is 1-bit full monitor mode enable/disable.
  7892. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7893. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7894. *
  7895. * The following field definitions describe the format of the full monitor
  7896. * mode configuration message sent from the host to target for each pdev.
  7897. *
  7898. * Header fields:
  7899. * dword0 - b'7:0 - msg_type: This will be set to
  7900. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7901. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7902. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7903. * specified pdev's LMAC ring.
  7904. * b'31:16 - reserved : Reserved for future use.
  7905. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7906. * monitor mode rxdma register is to be enabled or disabled.
  7907. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7908. * additional descriptors at ppdu end for zero mpdus
  7909. * enabled or disabled.
  7910. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7911. * additional descriptors at ppdu end for non zero mpdus
  7912. * enabled or disabled.
  7913. * b'10:3 - release_ring: This indicates the destination ring
  7914. * selection for the descriptor at the end of PPDU
  7915. * 0 - REO ring select
  7916. * 1 - FW ring select
  7917. * 2 - SW ring select
  7918. * 3 - Release ring select
  7919. * Refer to htt_rx_full_mon_release_ring.
  7920. * b'31:11 - reserved for future use
  7921. */
  7922. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7923. A_UINT32 msg_type:8,
  7924. pdev_id:8,
  7925. reserved0:16;
  7926. A_UINT32 full_monitor_mode_enable:1,
  7927. addnl_descs_zero_mpdus_end:1,
  7928. addnl_descs_non_zero_mpdus_end:1,
  7929. release_ring:8,
  7930. reserved1:21;
  7931. } POSTPACK;
  7932. /**
  7933. * Enumeration for full monitor mode destination ring select
  7934. * 0 - REO destination ring select
  7935. * 1 - FW destination ring select
  7936. * 2 - SW destination ring select
  7937. * 3 - Release destination ring select
  7938. */
  7939. enum htt_rx_full_mon_release_ring {
  7940. HTT_RX_MON_RING_REO,
  7941. HTT_RX_MON_RING_FW,
  7942. HTT_RX_MON_RING_SW,
  7943. HTT_RX_MON_RING_RELEASE,
  7944. };
  7945. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7946. /* DWORD 0: Pdev ID */
  7947. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7948. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7949. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7950. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7951. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7952. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7953. do { \
  7954. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7955. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7956. } while (0)
  7957. /* DWORD 1:ENABLE */
  7958. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7959. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7960. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7961. do { \
  7962. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7963. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7964. } while (0)
  7965. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7966. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7967. /* DWORD 1:ZERO_MPDU */
  7968. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7969. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7970. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7971. do { \
  7972. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7973. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7974. } while (0)
  7975. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7976. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7977. /* DWORD 1:NON_ZERO_MPDU */
  7978. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7979. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7980. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7981. do { \
  7982. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7983. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7984. } while (0)
  7985. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7986. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7987. /* DWORD 1:RELEASE_RINGS */
  7988. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7989. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7990. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7991. do { \
  7992. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7993. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7994. } while (0)
  7995. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7996. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7997. /**
  7998. * Enumeration for IP Protocol or IPSEC Protocol
  7999. * IPsec describes the framework for providing security at IP layer.
  8000. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8001. */
  8002. enum htt_rx_flow_proto {
  8003. HTT_RX_FLOW_IP_PROTO,
  8004. HTT_RX_FLOW_IPSEC_PROTO,
  8005. };
  8006. /**
  8007. * Enumeration for FSE Cache Invalidation
  8008. * 0 - No Cache Invalidation required
  8009. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8010. * 2 - Complete FSE Cache Invalidation
  8011. * 3 - FSE Disable
  8012. * 4 - FSE Enable
  8013. */
  8014. enum htt_rx_fse_operation {
  8015. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8016. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8017. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8018. HTT_RX_FSE_DISABLE,
  8019. HTT_RX_FSE_ENABLE,
  8020. };
  8021. /* DWORD 0: Pdev ID */
  8022. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8023. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8024. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8025. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8026. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8027. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8028. do { \
  8029. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8030. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8031. } while (0)
  8032. /* DWORD 1:IP PROTO or IPSEC */
  8033. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8034. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8035. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8036. do { \
  8037. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8038. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8039. } while (0)
  8040. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8041. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8042. /* DWORD 1:FSE Operation */
  8043. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8044. #define HTT_RX_FSE_OPERATION_S 1
  8045. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8046. do { \
  8047. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8048. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8049. } while (0)
  8050. #define HTT_RX_FSE_OPERATION_GET(word) \
  8051. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8052. /* DWORD 2-9:IP Address */
  8053. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8054. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8055. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8056. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8057. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8058. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8059. do { \
  8060. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8061. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8062. } while (0)
  8063. /* DWORD 10:Source Port Number */
  8064. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8065. #define HTT_RX_FSE_SOURCEPORT_S 0
  8066. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8067. do { \
  8068. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8069. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8070. } while (0)
  8071. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8072. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8073. /* DWORD 11:Destination Port Number */
  8074. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8075. #define HTT_RX_FSE_DESTPORT_S 16
  8076. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8077. do { \
  8078. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8079. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8080. } while (0)
  8081. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8082. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8083. /* DWORD 10-11:SPI (In case of IPSEC) */
  8084. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8085. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8086. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8087. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8088. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8089. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8090. do { \
  8091. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8092. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8093. } while (0)
  8094. /* DWORD 12:L4 PROTO */
  8095. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8096. #define HTT_RX_FSE_L4_PROTO_S 0
  8097. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8098. do { \
  8099. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8100. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8101. } while (0)
  8102. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8103. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8104. /**
  8105. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8106. *
  8107. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8108. *
  8109. * |31 24|23 |15 8|7 2|1|0|
  8110. * |----------------+----------------+----------------+----------------|
  8111. * | reserved | pdev_id | msg_type |
  8112. * |---------------------------------+----------------+----------------|
  8113. * | reserved |E|F|
  8114. * |---------------------------------+----------------+----------------|
  8115. * Where E = Configure the target to provide the 3-tuple hash value in
  8116. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8117. * F = Configure the target to provide the 3-tuple hash value in
  8118. * flow_id_toeplitz field of rx_msdu_start tlv
  8119. *
  8120. * The following field definitions describe the format of the 3 tuple hash value
  8121. * message sent from the host to target as part of initialization sequence.
  8122. *
  8123. * Header fields:
  8124. * dword0 - b'7:0 - msg_type: This will be set to
  8125. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8126. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8127. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8128. * specified pdev's LMAC ring.
  8129. * b'31:16 - reserved : Reserved for future use
  8130. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8131. * b'1 - toeplitz_hash_2_or_4_field_enable
  8132. * b'31:2 - reserved : Reserved for future use
  8133. * ---------+------+----------------------------------------------------------
  8134. * bit1 | bit0 | Functionality
  8135. * ---------+------+----------------------------------------------------------
  8136. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8137. * | | in flow_id_toeplitz field
  8138. * ---------+------+----------------------------------------------------------
  8139. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8140. * | | in toeplitz_hash_2_or_4 field
  8141. * ---------+------+----------------------------------------------------------
  8142. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8143. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8144. * ---------+------+----------------------------------------------------------
  8145. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8146. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8147. * | | toeplitz_hash_2_or_4 field
  8148. *----------------------------------------------------------------------------
  8149. */
  8150. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8151. A_UINT32 msg_type :8,
  8152. pdev_id :8,
  8153. reserved0 :16;
  8154. A_UINT32 flow_id_toeplitz_field_enable :1,
  8155. toeplitz_hash_2_or_4_field_enable :1,
  8156. reserved1 :30;
  8157. } POSTPACK;
  8158. /* DWORD0 : pdev_id configuration Macros */
  8159. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8160. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8161. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8162. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8163. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8164. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8165. do { \
  8166. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8167. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8168. } while (0)
  8169. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8170. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8171. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8172. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8173. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8174. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8175. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8176. do { \
  8177. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8178. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8179. } while (0)
  8180. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8181. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8182. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8183. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8184. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8185. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8186. do { \
  8187. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8188. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8189. } while (0)
  8190. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8191. /**
  8192. * @brief host --> target Host PA Address Size
  8193. *
  8194. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8195. *
  8196. * @details
  8197. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8198. * provide the physical start address and size of each of the memory
  8199. * areas within host DDR that the target FW may need to access.
  8200. *
  8201. * For example, the host can use this message to allow the target FW
  8202. * to set up access to the host's pools of TQM link descriptors.
  8203. * The message would appear as follows:
  8204. *
  8205. * |31 24|23 16|15 8|7 0|
  8206. * |----------------+----------------+----------------+----------------|
  8207. * | reserved | num_entries | msg_type |
  8208. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8209. * | mem area 0 size |
  8210. * |----------------+----------------+----------------+----------------|
  8211. * | mem area 0 physical_address_lo |
  8212. * |----------------+----------------+----------------+----------------|
  8213. * | mem area 0 physical_address_hi |
  8214. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8215. * | mem area 1 size |
  8216. * |----------------+----------------+----------------+----------------|
  8217. * | mem area 1 physical_address_lo |
  8218. * |----------------+----------------+----------------+----------------|
  8219. * | mem area 1 physical_address_hi |
  8220. * |----------------+----------------+----------------+----------------|
  8221. * ...
  8222. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8223. * | mem area N size |
  8224. * |----------------+----------------+----------------+----------------|
  8225. * | mem area N physical_address_lo |
  8226. * |----------------+----------------+----------------+----------------|
  8227. * | mem area N physical_address_hi |
  8228. * |----------------+----------------+----------------+----------------|
  8229. *
  8230. * The message is interpreted as follows:
  8231. * dword0 - b'0:7 - msg_type: This will be set to
  8232. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8233. * b'8:15 - number_entries: Indicated the number of host memory
  8234. * areas specified within the remainder of the message
  8235. * b'16:31 - reserved.
  8236. * dword1 - b'0:31 - memory area 0 size in bytes
  8237. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8238. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8239. * and similar for memory area 1 through memory area N.
  8240. */
  8241. PREPACK struct htt_h2t_host_paddr_size {
  8242. A_UINT32 msg_type: 8,
  8243. num_entries: 8,
  8244. reserved: 16;
  8245. } POSTPACK;
  8246. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8247. A_UINT32 size;
  8248. A_UINT32 physical_address_lo;
  8249. A_UINT32 physical_address_hi;
  8250. } POSTPACK;
  8251. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8252. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8253. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8254. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8255. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8256. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8257. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8258. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8259. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8260. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8261. do { \
  8262. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8263. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8264. } while (0)
  8265. /**
  8266. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8267. *
  8268. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8269. *
  8270. * @details
  8271. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8272. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8273. *
  8274. * The message would appear as follows:
  8275. *
  8276. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8277. * |---------------------------------+---+---+----------+-+-----------|
  8278. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8279. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8280. *
  8281. *
  8282. * The message is interpreted as follows:
  8283. * dword0 - b'0:7 - msg_type: This will be set to
  8284. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8285. * b'8 - override bit to drive MSDUs to PPE ring
  8286. * b'9:13 - REO destination ring indication
  8287. * b'14 - Multi buffer msdu override enable bit
  8288. * b'15 - Intra BSS override
  8289. * b'16 - Decap raw override
  8290. * b'17 - Decap Native wifi override
  8291. * b'18 - IP frag override
  8292. * b'19:31 - reserved
  8293. */
  8294. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8295. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8296. override: 1,
  8297. reo_destination_indication: 5,
  8298. multi_buffer_msdu_override_en: 1,
  8299. intra_bss_override: 1,
  8300. decap_raw_override: 1,
  8301. decap_nwifi_override: 1,
  8302. ip_frag_override: 1,
  8303. reserved: 13;
  8304. } POSTPACK;
  8305. /* DWORD 0: Override */
  8306. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8307. #define HTT_PPE_CFG_OVERRIDE_S 8
  8308. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8309. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8310. HTT_PPE_CFG_OVERRIDE_S)
  8311. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8312. do { \
  8313. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8314. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8315. } while (0)
  8316. /* DWORD 0: REO Destination Indication*/
  8317. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8318. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8319. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8320. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8321. HTT_PPE_CFG_REO_DEST_IND_S)
  8322. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8323. do { \
  8324. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8325. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8326. } while (0)
  8327. /* DWORD 0: Multi buffer MSDU override */
  8328. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8329. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8330. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8331. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8332. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8333. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8334. do { \
  8335. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8336. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8337. } while (0)
  8338. /* DWORD 0: Intra BSS override */
  8339. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8340. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8341. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8342. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8343. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8344. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8345. do { \
  8346. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8347. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8348. } while (0)
  8349. /* DWORD 0: Decap RAW override */
  8350. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8351. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8352. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8353. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8354. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8355. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8356. do { \
  8357. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8358. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8359. } while (0)
  8360. /* DWORD 0: Decap NWIFI override */
  8361. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8362. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8363. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8364. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8365. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8366. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8367. do { \
  8368. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8369. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8370. } while (0)
  8371. /* DWORD 0: IP frag override */
  8372. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8373. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8374. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8375. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8376. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8377. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8378. do { \
  8379. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8380. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8381. } while (0)
  8382. /*
  8383. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8384. *
  8385. * @details
  8386. * The following field definitions describe the format of the HTT host
  8387. * to target FW VDEV TX RX stats retrieve message.
  8388. * The message specifies the type of stats the host wants to retrieve.
  8389. *
  8390. * |31 27|26 25|24 17|16|15 8|7 0|
  8391. * |-----------------------------------------------------------|
  8392. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8393. * |-----------------------------------------------------------|
  8394. * | vdev_id lower bitmask |
  8395. * |-----------------------------------------------------------|
  8396. * | vdev_id upper bitmask |
  8397. * |-----------------------------------------------------------|
  8398. * Header fields:
  8399. * Where:
  8400. * dword0 - b'7:0 - msg_type: This will be set to
  8401. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8402. * b'15:8 - pdev id
  8403. * b'16(E) - Enable/Disable the vdev HW stats
  8404. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8405. * b'25:26(R) - Reset stats bits
  8406. * 0: don't reset stats
  8407. * 1: reset stats once
  8408. * 2: reset stats at the start of each periodic interval
  8409. * b'27:31 - reserved for future use
  8410. * dword1 - b'0:31 - vdev_id lower bitmask
  8411. * dword2 - b'0:31 - vdev_id upper bitmask
  8412. */
  8413. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8414. A_UINT32 msg_type :8,
  8415. pdev_id :8,
  8416. enable :1,
  8417. periodic_interval :8,
  8418. reset_stats_bits :2,
  8419. reserved0 :5;
  8420. A_UINT32 vdev_id_lower_bitmask;
  8421. A_UINT32 vdev_id_upper_bitmask;
  8422. } POSTPACK;
  8423. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8424. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8425. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8426. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8427. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8428. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8429. do { \
  8430. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8431. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8432. } while (0)
  8433. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8434. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8435. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8436. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8437. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8438. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8439. do { \
  8440. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8441. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8442. } while (0)
  8443. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8444. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8445. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8446. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8447. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8448. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8449. do { \
  8450. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8451. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8452. } while (0)
  8453. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8454. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8455. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8456. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8457. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8458. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8459. do { \
  8460. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8461. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8462. } while (0)
  8463. /*
  8464. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8465. *
  8466. * @details
  8467. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8468. * the default MSDU queues for one of the TIDs within the specified peer
  8469. * to the specified service class.
  8470. * The TID is indirectly specified - each service class is associated
  8471. * with a TID. All default MSDU queues for this peer-TID will be
  8472. * linked to the service class in question.
  8473. *
  8474. * |31 16|15 8|7 0|
  8475. * |------------------------------+--------------+--------------|
  8476. * | peer ID | svc class ID | msg type |
  8477. * |------------------------------------------------------------|
  8478. * Header fields:
  8479. * dword0 - b'7:0 - msg_type: This will be set to
  8480. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8481. * b'15:8 - service class ID
  8482. * b'31:16 - peer ID
  8483. */
  8484. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8485. A_UINT32 msg_type :8,
  8486. svc_class_id :8,
  8487. peer_id :16;
  8488. } POSTPACK;
  8489. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8490. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8491. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8492. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8493. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8494. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8495. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8496. do { \
  8497. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8498. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8499. } while (0)
  8500. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8501. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8502. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8503. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8504. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8505. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8506. do { \
  8507. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8508. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8509. } while (0)
  8510. /*
  8511. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8512. *
  8513. * @details
  8514. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8515. * remove the linkage of the specified peer-TID's MSDU queues to
  8516. * service classes.
  8517. *
  8518. * |31 16|15 8|7 0|
  8519. * |------------------------------+--------------+--------------|
  8520. * | peer ID | svc class ID | msg type |
  8521. * |------------------------------------------------------------|
  8522. * Header fields:
  8523. * dword0 - b'7:0 - msg_type: This will be set to
  8524. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8525. * b'15:8 - service class ID
  8526. * b'31:16 - peer ID
  8527. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8528. * value for peer ID indicates that the target should
  8529. * apply the UNMAP_REQ to all peers.
  8530. */
  8531. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8532. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8533. A_UINT32 msg_type :8,
  8534. svc_class_id :8,
  8535. peer_id :16;
  8536. } POSTPACK;
  8537. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8538. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8539. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8540. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8541. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8542. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8543. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8544. do { \
  8545. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8546. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8547. } while (0)
  8548. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8549. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8550. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8551. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8552. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8553. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8554. do { \
  8555. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8556. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8557. } while (0)
  8558. /*
  8559. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8560. *
  8561. * @details
  8562. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8563. * request the target to report what service class the default MSDU queues
  8564. * of the specified TIDs within the peer are linked to.
  8565. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8566. * to report what service class (if any) the default MSDU queues for
  8567. * each of the specified TIDs are linked to.
  8568. *
  8569. * |31 16|15 8|7 1| 0|
  8570. * |------------------------------+--------------+--------------|
  8571. * | peer ID | TID mask | msg type |
  8572. * |------------------------------------------------------------|
  8573. * | reserved |ETO|
  8574. * |------------------------------------------------------------|
  8575. * Header fields:
  8576. * dword0 - b'7:0 - msg_type: This will be set to
  8577. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8578. * b'15:8 - TID mask
  8579. * b'31:16 - peer ID
  8580. * dword1 - b'0 - "Existing Tids Only" flag
  8581. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8582. * message generated by this REQ will only show the
  8583. * mapping for TIDs that actually exist in the target's
  8584. * peer object.
  8585. * Any TIDs that are covered by a MAP_REQ but which
  8586. * do not actually exist will be shown as being
  8587. * unmapped (i.e. svc class ID 0xff).
  8588. * If this flag is cleared, the MAP_REPORT_CONF message
  8589. * will consider not only the mapping of TIDs currently
  8590. * existing in the peer, but also the mapping that will
  8591. * be applied for any TID objects created within this
  8592. * peer in the future.
  8593. * b'31:1 - reserved for future use
  8594. */
  8595. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8596. A_UINT32 msg_type :8,
  8597. tid_mask :8,
  8598. peer_id :16;
  8599. A_UINT32 existing_tids_only:1,
  8600. reserved :31;
  8601. } POSTPACK;
  8602. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8603. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8604. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8605. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8606. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8607. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8608. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8609. do { \
  8610. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8611. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8612. } while (0)
  8613. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8614. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8615. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8616. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8617. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8618. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8619. do { \
  8620. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8621. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8622. } while (0)
  8623. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8624. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8625. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8626. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8627. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8628. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8629. do { \
  8630. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8631. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8632. } while (0)
  8633. /**
  8634. * @brief Format of shared memory between Host and Target
  8635. * for UMAC hang recovery feature messaging.
  8636. * @details
  8637. * This is shared memory between Host and Target allocated
  8638. * and used in chips where UMAC hang recovery feature is supported.
  8639. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8640. * then host interprets it as a new message from target.
  8641. * Host clears that particular read bit in t2h_msg after each read
  8642. * operation. It is vice versa for h2t_msg. At any given point
  8643. * of time there is expected to be only one bit set
  8644. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8645. *
  8646. * The message is interpreted as follows:
  8647. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8648. * added for debuggability purpose.
  8649. * dword1 - b'0 - do_pre_reset
  8650. * b'1 - do_post_reset_start
  8651. * b'2 - do_post_reset_complete
  8652. * b'3:31 - rsvd_t2h
  8653. * dword2 - b'0 - pre_reset_done
  8654. * b'1 - post_reset_start_done
  8655. * b'2 - post_reset_complete_done
  8656. * b'3:31 - rsvd_h2t
  8657. */
  8658. PREPACK typedef struct {
  8659. /** Magic number added for debuggability. */
  8660. A_UINT32 magic_num;
  8661. union {
  8662. /*
  8663. * BIT [0] :- T2H msg to do pre-reset
  8664. * BIT [1] :- T2H msg to do post-reset start
  8665. * BIT [2] :- T2H msg to do post-reset complete
  8666. * BIT [31 : 3] :- reserved
  8667. */
  8668. A_UINT32 t2h_msg;
  8669. struct {
  8670. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8671. do_post_reset_start : 1, /* BIT [1] */
  8672. do_post_reset_complete : 1, /* BIT [2] */
  8673. rsvd_t2h : 29; /* BIT [31 : 3] */
  8674. };
  8675. };
  8676. union {
  8677. /*
  8678. * BIT [0] :- H2T msg to send pre-reset done
  8679. * BIT [1] :- H2T msg to send post-reset start done
  8680. * BIT [2] :- H2T msg to send post-reset complete done
  8681. * BIT [31 : 3] :- reserved
  8682. */
  8683. A_UINT32 h2t_msg;
  8684. struct {
  8685. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8686. post_reset_start_done : 1, /* BIT [1] */
  8687. post_reset_complete_done : 1, /* BIT [2] */
  8688. rsvd_h2t : 29; /* BIT [31 : 3] */
  8689. };
  8690. };
  8691. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8692. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8693. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8694. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8695. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8696. /* dword1 - b'0 - do_pre_reset */
  8697. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8698. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8699. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8700. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8701. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8702. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8703. do { \
  8704. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8705. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8706. } while (0)
  8707. /* dword1 - b'1 - do_post_reset_start */
  8708. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8709. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8710. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8711. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8712. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8713. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8714. do { \
  8715. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8716. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8717. } while (0)
  8718. /* dword1 - b'2 - do_post_reset_complete */
  8719. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8720. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8721. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8722. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8723. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8724. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8725. do { \
  8726. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8727. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8728. } while (0)
  8729. /* dword2 - b'0 - pre_reset_done */
  8730. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8731. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8732. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8733. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8734. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8735. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8736. do { \
  8737. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8738. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8739. } while (0)
  8740. /* dword2 - b'1 - post_reset_start_done */
  8741. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8742. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8743. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8744. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8745. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8746. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8747. do { \
  8748. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8749. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8750. } while (0)
  8751. /* dword2 - b'2 - post_reset_complete_done */
  8752. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8753. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8754. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8755. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8756. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8757. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8758. do { \
  8759. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8760. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8761. } while (0)
  8762. /**
  8763. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8764. *
  8765. * @details
  8766. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8767. * by the host to provide prerequisite info to target for the UMAC hang
  8768. * recovery feature.
  8769. * The info sent in this H2T message are T2H message method, H2T message
  8770. * method, T2H MSI interrupt number and physical start address, size of
  8771. * the shared memory (refers to the shared memory dedicated for messaging
  8772. * between host and target when the DUT is in UMAC hang recovery mode).
  8773. * This H2T message is expected to be only sent if the WMI service bit
  8774. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8775. *
  8776. * |31 16|15 12|11 8|7 0|
  8777. * |-------------------------------+--------------+--------------+------------|
  8778. * | reserved |h2t msg method|t2h msg method| msg_type |
  8779. * |--------------------------------------------------------------------------|
  8780. * | t2h msi interrupt number |
  8781. * |--------------------------------------------------------------------------|
  8782. * | shared memory area size |
  8783. * |--------------------------------------------------------------------------|
  8784. * | shared memory area physical address low |
  8785. * |--------------------------------------------------------------------------|
  8786. * | shared memory area physical address high |
  8787. * |--------------------------------------------------------------------------|
  8788. *
  8789. * The message is interpreted as follows:
  8790. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8791. * b'8:11 - t2h_msg_method: indicates method to be used for
  8792. * T2H communication in UMAC hang recovery mode.
  8793. * Value zero indicates MSI interrupt (default method).
  8794. * Refer to htt_umac_hang_recovery_msg_method enum.
  8795. * b'12:15 - h2t_msg_method: indicates method to be used for
  8796. * H2T communication in UMAC hang recovery mode.
  8797. * Value zero indicates polling by target for this h2t msg
  8798. * during UMAC hang recovery mode.
  8799. * Refer to htt_umac_hang_recovery_msg_method enum.
  8800. * b'16:31 - reserved.
  8801. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8802. * T2H communication in UMAC hang recovery mode.
  8803. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8804. * only when in UMAC hang recovery mode.
  8805. * This refers to size in bytes.
  8806. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8807. * of the shared memory dedicated for messaging only when
  8808. * in UMAC hang recovery mode.
  8809. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8810. * of the shared memory dedicated for messaging only when
  8811. * in UMAC hang recovery mode.
  8812. */
  8813. /* t2h_msg_method and h2t_msg_method */
  8814. enum htt_umac_hang_recovery_msg_method {
  8815. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8816. };
  8817. PREPACK typedef struct {
  8818. A_UINT32 msg_type : 8,
  8819. t2h_msg_method : 4,
  8820. h2t_msg_method : 4,
  8821. reserved : 16;
  8822. A_UINT32 t2h_msi_data;
  8823. /* size bytes and physical address of shared memory. */
  8824. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8825. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8826. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8827. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8828. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8829. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8830. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8831. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8832. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8833. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8834. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8835. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8836. do { \
  8837. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8838. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8839. } while (0)
  8840. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8841. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8842. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8843. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8844. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8845. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8846. do { \
  8847. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8848. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8849. } while (0)
  8850. /*=== target -> host messages ===============================================*/
  8851. enum htt_t2h_msg_type {
  8852. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8853. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8854. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8855. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8856. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8857. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8858. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8859. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8860. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8861. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8862. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8863. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8864. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8865. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8866. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8867. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8868. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8869. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8870. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8871. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8872. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8873. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8874. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8875. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8876. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8877. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8878. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8879. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8880. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8881. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8882. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8883. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8884. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8885. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8886. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8887. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8888. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8889. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8890. /* TX_OFFLOAD_DELIVER_IND:
  8891. * Forward the target's locally-generated packets to the host,
  8892. * to provide to the monitor mode interface.
  8893. */
  8894. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8895. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8896. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8897. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8898. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8899. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8900. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8901. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8902. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8903. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8904. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8905. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8906. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8907. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8908. HTT_T2H_MSG_TYPE_TEST,
  8909. /* keep this last */
  8910. HTT_T2H_NUM_MSGS
  8911. };
  8912. /*
  8913. * HTT target to host message type -
  8914. * stored in bits 7:0 of the first word of the message
  8915. */
  8916. #define HTT_T2H_MSG_TYPE_M 0xff
  8917. #define HTT_T2H_MSG_TYPE_S 0
  8918. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8919. do { \
  8920. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8921. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8922. } while (0)
  8923. #define HTT_T2H_MSG_TYPE_GET(word) \
  8924. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8925. /**
  8926. * @brief target -> host version number confirmation message definition
  8927. *
  8928. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8929. *
  8930. * |31 24|23 16|15 8|7 0|
  8931. * |----------------+----------------+----------------+----------------|
  8932. * | reserved | major number | minor number | msg type |
  8933. * |-------------------------------------------------------------------|
  8934. * : option request TLV (optional) |
  8935. * :...................................................................:
  8936. *
  8937. * The VER_CONF message may consist of a single 4-byte word, or may be
  8938. * extended with TLVs that specify HTT options selected by the target.
  8939. * The following option TLVs may be appended to the VER_CONF message:
  8940. * - LL_BUS_ADDR_SIZE
  8941. * - HL_SUPPRESS_TX_COMPL_IND
  8942. * - MAX_TX_QUEUE_GROUPS
  8943. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8944. * may be appended to the VER_CONF message (but only one TLV of each type).
  8945. *
  8946. * Header fields:
  8947. * - MSG_TYPE
  8948. * Bits 7:0
  8949. * Purpose: identifies this as a version number confirmation message
  8950. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8951. * - VER_MINOR
  8952. * Bits 15:8
  8953. * Purpose: Specify the minor number of the HTT message library version
  8954. * in use by the target firmware.
  8955. * The minor number specifies the specific revision within a range
  8956. * of fundamentally compatible HTT message definition revisions.
  8957. * Compatible revisions involve adding new messages or perhaps
  8958. * adding new fields to existing messages, in a backwards-compatible
  8959. * manner.
  8960. * Incompatible revisions involve changing the message type values,
  8961. * or redefining existing messages.
  8962. * Value: minor number
  8963. * - VER_MAJOR
  8964. * Bits 15:8
  8965. * Purpose: Specify the major number of the HTT message library version
  8966. * in use by the target firmware.
  8967. * The major number specifies the family of minor revisions that are
  8968. * fundamentally compatible with each other, but not with prior or
  8969. * later families.
  8970. * Value: major number
  8971. */
  8972. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8973. #define HTT_VER_CONF_MINOR_S 8
  8974. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8975. #define HTT_VER_CONF_MAJOR_S 16
  8976. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8977. do { \
  8978. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8979. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8980. } while (0)
  8981. #define HTT_VER_CONF_MINOR_GET(word) \
  8982. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8983. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8984. do { \
  8985. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8986. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8987. } while (0)
  8988. #define HTT_VER_CONF_MAJOR_GET(word) \
  8989. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8990. #define HTT_VER_CONF_BYTES 4
  8991. /**
  8992. * @brief - target -> host HTT Rx In order indication message
  8993. *
  8994. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8995. *
  8996. * @details
  8997. *
  8998. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8999. * |----------------+-------------------+---------------------+---------------|
  9000. * | peer ID | P| F| O| ext TID | msg type |
  9001. * |--------------------------------------------------------------------------|
  9002. * | MSDU count | Reserved | vdev id |
  9003. * |--------------------------------------------------------------------------|
  9004. * | MSDU 0 bus address (bits 31:0) |
  9005. #if HTT_PADDR64
  9006. * | MSDU 0 bus address (bits 63:32) |
  9007. #endif
  9008. * |--------------------------------------------------------------------------|
  9009. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9010. * |--------------------------------------------------------------------------|
  9011. * | MSDU 1 bus address (bits 31:0) |
  9012. #if HTT_PADDR64
  9013. * | MSDU 1 bus address (bits 63:32) |
  9014. #endif
  9015. * |--------------------------------------------------------------------------|
  9016. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9017. * |--------------------------------------------------------------------------|
  9018. */
  9019. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9020. *
  9021. * @details
  9022. * bits
  9023. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9024. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9025. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9026. * | | frag | | | | fail |chksum fail|
  9027. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9028. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9029. */
  9030. struct htt_rx_in_ord_paddr_ind_hdr_t
  9031. {
  9032. A_UINT32 /* word 0 */
  9033. msg_type: 8,
  9034. ext_tid: 5,
  9035. offload: 1,
  9036. frag: 1,
  9037. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9038. peer_id: 16;
  9039. A_UINT32 /* word 1 */
  9040. vap_id: 8,
  9041. /* NOTE:
  9042. * This reserved_1 field is not truly reserved - certain targets use
  9043. * this field internally to store debug information, and do not zero
  9044. * out the contents of the field before uploading the message to the
  9045. * host. Thus, any host-target communication supported by this field
  9046. * is limited to using values that are never used by the debug
  9047. * information stored by certain targets in the reserved_1 field.
  9048. * In particular, the targets in question don't use the value 0x3
  9049. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9050. * so this previously-unused value within these bits is available to
  9051. * use as the host / target PKT_CAPTURE_MODE flag.
  9052. */
  9053. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9054. /* if pkt_capture_mode == 0x3, host should
  9055. * send rx frames to monitor mode interface
  9056. */
  9057. msdu_cnt: 16;
  9058. };
  9059. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9060. {
  9061. A_UINT32 dma_addr;
  9062. A_UINT32
  9063. length: 16,
  9064. fw_desc: 8,
  9065. msdu_info:8;
  9066. };
  9067. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9068. {
  9069. A_UINT32 dma_addr_lo;
  9070. A_UINT32 dma_addr_hi;
  9071. A_UINT32
  9072. length: 16,
  9073. fw_desc: 8,
  9074. msdu_info:8;
  9075. };
  9076. #if HTT_PADDR64
  9077. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9078. #else
  9079. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9080. #endif
  9081. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9082. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9083. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9084. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9085. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9086. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9087. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9088. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9089. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9090. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9091. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9092. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9093. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9094. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9095. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9096. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9097. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9098. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9099. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9100. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9101. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9102. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9103. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9104. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9105. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9106. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9107. /* for systems using 64-bit format for bus addresses */
  9108. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9109. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9110. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9111. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9112. /* for systems using 32-bit format for bus addresses */
  9113. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9114. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9115. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9116. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9117. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9118. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9119. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9120. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9121. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9122. do { \
  9123. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9124. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9125. } while (0)
  9126. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9127. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9128. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9129. do { \
  9130. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9131. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9132. } while (0)
  9133. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9134. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9135. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9136. do { \
  9137. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9138. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9139. } while (0)
  9140. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9141. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9142. /*
  9143. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9144. * deliver the rx frames to the monitor mode interface.
  9145. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9146. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9147. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9148. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9149. */
  9150. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9151. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9152. do { \
  9153. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9154. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9155. } while (0)
  9156. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9157. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9158. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9159. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9160. do { \
  9161. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9162. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9163. } while (0)
  9164. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9165. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9166. /* for systems using 64-bit format for bus addresses */
  9167. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9168. do { \
  9169. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9170. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9171. } while (0)
  9172. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9173. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9174. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9175. do { \
  9176. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9177. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9178. } while (0)
  9179. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9180. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9181. /* for systems using 32-bit format for bus addresses */
  9182. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9183. do { \
  9184. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9185. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9186. } while (0)
  9187. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9188. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9189. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9190. do { \
  9191. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9192. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9193. } while (0)
  9194. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9195. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9196. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9197. do { \
  9198. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9199. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9200. } while (0)
  9201. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9202. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9203. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9204. do { \
  9205. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9206. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9207. } while (0)
  9208. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9209. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9210. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9211. do { \
  9212. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9213. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9214. } while (0)
  9215. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9216. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9217. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9218. do { \
  9219. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9220. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9221. } while (0)
  9222. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9223. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9224. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9225. do { \
  9226. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9227. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9228. } while (0)
  9229. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9230. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9231. /* definitions used within target -> host rx indication message */
  9232. PREPACK struct htt_rx_ind_hdr_prefix_t
  9233. {
  9234. A_UINT32 /* word 0 */
  9235. msg_type: 8,
  9236. ext_tid: 5,
  9237. release_valid: 1,
  9238. flush_valid: 1,
  9239. reserved0: 1,
  9240. peer_id: 16;
  9241. A_UINT32 /* word 1 */
  9242. flush_start_seq_num: 6,
  9243. flush_end_seq_num: 6,
  9244. release_start_seq_num: 6,
  9245. release_end_seq_num: 6,
  9246. num_mpdu_ranges: 8;
  9247. } POSTPACK;
  9248. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9249. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9250. #define HTT_TGT_RSSI_INVALID 0x80
  9251. PREPACK struct htt_rx_ppdu_desc_t
  9252. {
  9253. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9254. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9255. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9256. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9257. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9258. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9259. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9260. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9261. A_UINT32 /* word 0 */
  9262. rssi_cmb: 8,
  9263. timestamp_submicrosec: 8,
  9264. phy_err_code: 8,
  9265. phy_err: 1,
  9266. legacy_rate: 4,
  9267. legacy_rate_sel: 1,
  9268. end_valid: 1,
  9269. start_valid: 1;
  9270. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9271. union {
  9272. A_UINT32 /* word 1 */
  9273. rssi0_pri20: 8,
  9274. rssi0_ext20: 8,
  9275. rssi0_ext40: 8,
  9276. rssi0_ext80: 8;
  9277. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9278. } u0;
  9279. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9280. union {
  9281. A_UINT32 /* word 2 */
  9282. rssi1_pri20: 8,
  9283. rssi1_ext20: 8,
  9284. rssi1_ext40: 8,
  9285. rssi1_ext80: 8;
  9286. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9287. } u1;
  9288. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9289. union {
  9290. A_UINT32 /* word 3 */
  9291. rssi2_pri20: 8,
  9292. rssi2_ext20: 8,
  9293. rssi2_ext40: 8,
  9294. rssi2_ext80: 8;
  9295. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9296. } u2;
  9297. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9298. union {
  9299. A_UINT32 /* word 4 */
  9300. rssi3_pri20: 8,
  9301. rssi3_ext20: 8,
  9302. rssi3_ext40: 8,
  9303. rssi3_ext80: 8;
  9304. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9305. } u3;
  9306. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9307. A_UINT32 tsf32; /* word 5 */
  9308. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9309. A_UINT32 timestamp_microsec; /* word 6 */
  9310. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9311. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9312. A_UINT32 /* word 7 */
  9313. vht_sig_a1: 24,
  9314. preamble_type: 8;
  9315. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9316. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9317. A_UINT32 /* word 8 */
  9318. vht_sig_a2: 24,
  9319. /* sa_ant_matrix
  9320. * For cases where a single rx chain has options to be connected to
  9321. * different rx antennas, show which rx antennas were in use during
  9322. * receipt of a given PPDU.
  9323. * This sa_ant_matrix provides a bitmask of the antennas used while
  9324. * receiving this frame.
  9325. */
  9326. sa_ant_matrix: 8;
  9327. } POSTPACK;
  9328. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9329. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9330. PREPACK struct htt_rx_ind_hdr_suffix_t
  9331. {
  9332. A_UINT32 /* word 0 */
  9333. fw_rx_desc_bytes: 16,
  9334. reserved0: 16;
  9335. } POSTPACK;
  9336. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9337. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9338. PREPACK struct htt_rx_ind_hdr_t
  9339. {
  9340. struct htt_rx_ind_hdr_prefix_t prefix;
  9341. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9342. struct htt_rx_ind_hdr_suffix_t suffix;
  9343. } POSTPACK;
  9344. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9345. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9346. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9347. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9348. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9349. /*
  9350. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9351. * the offset into the HTT rx indication message at which the
  9352. * FW rx PPDU descriptor resides
  9353. */
  9354. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9355. /*
  9356. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9357. * the offset into the HTT rx indication message at which the
  9358. * header suffix (FW rx MSDU byte count) resides
  9359. */
  9360. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9361. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9362. /*
  9363. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9364. * the offset into the HTT rx indication message at which the per-MSDU
  9365. * information starts
  9366. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9367. * per-MSDU information portion of the message. The per-MSDU info itself
  9368. * starts at byte 12.
  9369. */
  9370. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9371. /**
  9372. * @brief target -> host rx indication message definition
  9373. *
  9374. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9375. *
  9376. * @details
  9377. * The following field definitions describe the format of the rx indication
  9378. * message sent from the target to the host.
  9379. * The message consists of three major sections:
  9380. * 1. a fixed-length header
  9381. * 2. a variable-length list of firmware rx MSDU descriptors
  9382. * 3. one or more 4-octet MPDU range information elements
  9383. * The fixed length header itself has two sub-sections
  9384. * 1. the message meta-information, including identification of the
  9385. * sender and type of the received data, and a 4-octet flush/release IE
  9386. * 2. the firmware rx PPDU descriptor
  9387. *
  9388. * The format of the message is depicted below.
  9389. * in this depiction, the following abbreviations are used for information
  9390. * elements within the message:
  9391. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9392. * elements associated with the PPDU start are valid.
  9393. * Specifically, the following fields are valid only if SV is set:
  9394. * RSSI (all variants), L, legacy rate, preamble type, service,
  9395. * VHT-SIG-A
  9396. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9397. * elements associated with the PPDU end are valid.
  9398. * Specifically, the following fields are valid only if EV is set:
  9399. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9400. * - L - Legacy rate selector - if legacy rates are used, this flag
  9401. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9402. * (L == 0) PHY.
  9403. * - P - PHY error flag - boolean indication of whether the rx frame had
  9404. * a PHY error
  9405. *
  9406. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9407. * |----------------+-------------------+---------------------+---------------|
  9408. * | peer ID | |RV|FV| ext TID | msg type |
  9409. * |--------------------------------------------------------------------------|
  9410. * | num | release | release | flush | flush |
  9411. * | MPDU | end | start | end | start |
  9412. * | ranges | seq num | seq num | seq num | seq num |
  9413. * |==========================================================================|
  9414. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9415. * |V|V| | rate | | | timestamp | RSSI |
  9416. * |--------------------------------------------------------------------------|
  9417. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9418. * |--------------------------------------------------------------------------|
  9419. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9420. * |--------------------------------------------------------------------------|
  9421. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9422. * |--------------------------------------------------------------------------|
  9423. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9424. * |--------------------------------------------------------------------------|
  9425. * | TSF LSBs |
  9426. * |--------------------------------------------------------------------------|
  9427. * | microsec timestamp |
  9428. * |--------------------------------------------------------------------------|
  9429. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9430. * |--------------------------------------------------------------------------|
  9431. * | service | HT-SIG / VHT-SIG-A2 |
  9432. * |==========================================================================|
  9433. * | reserved | FW rx desc bytes |
  9434. * |--------------------------------------------------------------------------|
  9435. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9436. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9437. * |--------------------------------------------------------------------------|
  9438. * : : :
  9439. * |--------------------------------------------------------------------------|
  9440. * | alignment | MSDU Rx |
  9441. * | padding | desc Bn |
  9442. * |--------------------------------------------------------------------------|
  9443. * | reserved | MPDU range status | MPDU count |
  9444. * |--------------------------------------------------------------------------|
  9445. * : reserved : MPDU range status : MPDU count :
  9446. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9447. *
  9448. * Header fields:
  9449. * - MSG_TYPE
  9450. * Bits 7:0
  9451. * Purpose: identifies this as an rx indication message
  9452. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9453. * - EXT_TID
  9454. * Bits 12:8
  9455. * Purpose: identify the traffic ID of the rx data, including
  9456. * special "extended" TID values for multicast, broadcast, and
  9457. * non-QoS data frames
  9458. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9459. * - FLUSH_VALID (FV)
  9460. * Bit 13
  9461. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9462. * is valid
  9463. * Value:
  9464. * 1 -> flush IE is valid and needs to be processed
  9465. * 0 -> flush IE is not valid and should be ignored
  9466. * - REL_VALID (RV)
  9467. * Bit 13
  9468. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9469. * is valid
  9470. * Value:
  9471. * 1 -> release IE is valid and needs to be processed
  9472. * 0 -> release IE is not valid and should be ignored
  9473. * - PEER_ID
  9474. * Bits 31:16
  9475. * Purpose: Identify, by ID, which peer sent the rx data
  9476. * Value: ID of the peer who sent the rx data
  9477. * - FLUSH_SEQ_NUM_START
  9478. * Bits 5:0
  9479. * Purpose: Indicate the start of a series of MPDUs to flush
  9480. * Not all MPDUs within this series are necessarily valid - the host
  9481. * must check each sequence number within this range to see if the
  9482. * corresponding MPDU is actually present.
  9483. * This field is only valid if the FV bit is set.
  9484. * Value:
  9485. * The sequence number for the first MPDUs to check to flush.
  9486. * The sequence number is masked by 0x3f.
  9487. * - FLUSH_SEQ_NUM_END
  9488. * Bits 11:6
  9489. * Purpose: Indicate the end of a series of MPDUs to flush
  9490. * Value:
  9491. * The sequence number one larger than the sequence number of the
  9492. * last MPDU to check to flush.
  9493. * The sequence number is masked by 0x3f.
  9494. * Not all MPDUs within this series are necessarily valid - the host
  9495. * must check each sequence number within this range to see if the
  9496. * corresponding MPDU is actually present.
  9497. * This field is only valid if the FV bit is set.
  9498. * - REL_SEQ_NUM_START
  9499. * Bits 17:12
  9500. * Purpose: Indicate the start of a series of MPDUs to release.
  9501. * All MPDUs within this series are present and valid - the host
  9502. * need not check each sequence number within this range to see if
  9503. * the corresponding MPDU is actually present.
  9504. * This field is only valid if the RV bit is set.
  9505. * Value:
  9506. * The sequence number for the first MPDUs to check to release.
  9507. * The sequence number is masked by 0x3f.
  9508. * - REL_SEQ_NUM_END
  9509. * Bits 23:18
  9510. * Purpose: Indicate the end of a series of MPDUs to release.
  9511. * Value:
  9512. * The sequence number one larger than the sequence number of the
  9513. * last MPDU to check to release.
  9514. * The sequence number is masked by 0x3f.
  9515. * All MPDUs within this series are present and valid - the host
  9516. * need not check each sequence number within this range to see if
  9517. * the corresponding MPDU is actually present.
  9518. * This field is only valid if the RV bit is set.
  9519. * - NUM_MPDU_RANGES
  9520. * Bits 31:24
  9521. * Purpose: Indicate how many ranges of MPDUs are present.
  9522. * Each MPDU range consists of a series of contiguous MPDUs within the
  9523. * rx frame sequence which all have the same MPDU status.
  9524. * Value: 1-63 (typically a small number, like 1-3)
  9525. *
  9526. * Rx PPDU descriptor fields:
  9527. * - RSSI_CMB
  9528. * Bits 7:0
  9529. * Purpose: Combined RSSI from all active rx chains, across the active
  9530. * bandwidth.
  9531. * Value: RSSI dB units w.r.t. noise floor
  9532. * - TIMESTAMP_SUBMICROSEC
  9533. * Bits 15:8
  9534. * Purpose: high-resolution timestamp
  9535. * Value:
  9536. * Sub-microsecond time of PPDU reception.
  9537. * This timestamp ranges from [0,MAC clock MHz).
  9538. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9539. * to form a high-resolution, large range rx timestamp.
  9540. * - PHY_ERR_CODE
  9541. * Bits 23:16
  9542. * Purpose:
  9543. * If the rx frame processing resulted in a PHY error, indicate what
  9544. * type of rx PHY error occurred.
  9545. * Value:
  9546. * This field is valid if the "P" (PHY_ERR) flag is set.
  9547. * TBD: document/specify the values for this field
  9548. * - PHY_ERR
  9549. * Bit 24
  9550. * Purpose: indicate whether the rx PPDU had a PHY error
  9551. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9552. * - LEGACY_RATE
  9553. * Bits 28:25
  9554. * Purpose:
  9555. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9556. * specify which rate was used.
  9557. * Value:
  9558. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9559. * flag.
  9560. * If LEGACY_RATE_SEL is 0:
  9561. * 0x8: OFDM 48 Mbps
  9562. * 0x9: OFDM 24 Mbps
  9563. * 0xA: OFDM 12 Mbps
  9564. * 0xB: OFDM 6 Mbps
  9565. * 0xC: OFDM 54 Mbps
  9566. * 0xD: OFDM 36 Mbps
  9567. * 0xE: OFDM 18 Mbps
  9568. * 0xF: OFDM 9 Mbps
  9569. * If LEGACY_RATE_SEL is 1:
  9570. * 0x8: CCK 11 Mbps long preamble
  9571. * 0x9: CCK 5.5 Mbps long preamble
  9572. * 0xA: CCK 2 Mbps long preamble
  9573. * 0xB: CCK 1 Mbps long preamble
  9574. * 0xC: CCK 11 Mbps short preamble
  9575. * 0xD: CCK 5.5 Mbps short preamble
  9576. * 0xE: CCK 2 Mbps short preamble
  9577. * - LEGACY_RATE_SEL
  9578. * Bit 29
  9579. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9580. * Value:
  9581. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9582. * used a legacy rate.
  9583. * 0 -> OFDM, 1 -> CCK
  9584. * - END_VALID
  9585. * Bit 30
  9586. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9587. * the start of the PPDU are valid. Specifically, the following
  9588. * fields are only valid if END_VALID is set:
  9589. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9590. * TIMESTAMP_SUBMICROSEC
  9591. * Value:
  9592. * 0 -> rx PPDU desc end fields are not valid
  9593. * 1 -> rx PPDU desc end fields are valid
  9594. * - START_VALID
  9595. * Bit 31
  9596. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9597. * the end of the PPDU are valid. Specifically, the following
  9598. * fields are only valid if START_VALID is set:
  9599. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9600. * VHT-SIG-A
  9601. * Value:
  9602. * 0 -> rx PPDU desc start fields are not valid
  9603. * 1 -> rx PPDU desc start fields are valid
  9604. * - RSSI0_PRI20
  9605. * Bits 7:0
  9606. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9607. * Value: RSSI dB units w.r.t. noise floor
  9608. *
  9609. * - RSSI0_EXT20
  9610. * Bits 7:0
  9611. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9612. * (if the rx bandwidth was >= 40 MHz)
  9613. * Value: RSSI dB units w.r.t. noise floor
  9614. * - RSSI0_EXT40
  9615. * Bits 7:0
  9616. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9617. * (if the rx bandwidth was >= 80 MHz)
  9618. * Value: RSSI dB units w.r.t. noise floor
  9619. * - RSSI0_EXT80
  9620. * Bits 7:0
  9621. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9622. * (if the rx bandwidth was >= 160 MHz)
  9623. * Value: RSSI dB units w.r.t. noise floor
  9624. *
  9625. * - RSSI1_PRI20
  9626. * Bits 7:0
  9627. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9628. * Value: RSSI dB units w.r.t. noise floor
  9629. * - RSSI1_EXT20
  9630. * Bits 7:0
  9631. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9632. * (if the rx bandwidth was >= 40 MHz)
  9633. * Value: RSSI dB units w.r.t. noise floor
  9634. * - RSSI1_EXT40
  9635. * Bits 7:0
  9636. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9637. * (if the rx bandwidth was >= 80 MHz)
  9638. * Value: RSSI dB units w.r.t. noise floor
  9639. * - RSSI1_EXT80
  9640. * Bits 7:0
  9641. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9642. * (if the rx bandwidth was >= 160 MHz)
  9643. * Value: RSSI dB units w.r.t. noise floor
  9644. *
  9645. * - RSSI2_PRI20
  9646. * Bits 7:0
  9647. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9648. * Value: RSSI dB units w.r.t. noise floor
  9649. * - RSSI2_EXT20
  9650. * Bits 7:0
  9651. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9652. * (if the rx bandwidth was >= 40 MHz)
  9653. * Value: RSSI dB units w.r.t. noise floor
  9654. * - RSSI2_EXT40
  9655. * Bits 7:0
  9656. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9657. * (if the rx bandwidth was >= 80 MHz)
  9658. * Value: RSSI dB units w.r.t. noise floor
  9659. * - RSSI2_EXT80
  9660. * Bits 7:0
  9661. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9662. * (if the rx bandwidth was >= 160 MHz)
  9663. * Value: RSSI dB units w.r.t. noise floor
  9664. *
  9665. * - RSSI3_PRI20
  9666. * Bits 7:0
  9667. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9668. * Value: RSSI dB units w.r.t. noise floor
  9669. * - RSSI3_EXT20
  9670. * Bits 7:0
  9671. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9672. * (if the rx bandwidth was >= 40 MHz)
  9673. * Value: RSSI dB units w.r.t. noise floor
  9674. * - RSSI3_EXT40
  9675. * Bits 7:0
  9676. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9677. * (if the rx bandwidth was >= 80 MHz)
  9678. * Value: RSSI dB units w.r.t. noise floor
  9679. * - RSSI3_EXT80
  9680. * Bits 7:0
  9681. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9682. * (if the rx bandwidth was >= 160 MHz)
  9683. * Value: RSSI dB units w.r.t. noise floor
  9684. *
  9685. * - TSF32
  9686. * Bits 31:0
  9687. * Purpose: specify the time the rx PPDU was received, in TSF units
  9688. * Value: 32 LSBs of the TSF
  9689. * - TIMESTAMP_MICROSEC
  9690. * Bits 31:0
  9691. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9692. * Value: PPDU rx time, in microseconds
  9693. * - VHT_SIG_A1
  9694. * Bits 23:0
  9695. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9696. * from the rx PPDU
  9697. * Value:
  9698. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9699. * VHT-SIG-A1 data.
  9700. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9701. * first 24 bits of the HT-SIG data.
  9702. * Otherwise, this field is invalid.
  9703. * Refer to the the 802.11 protocol for the definition of the
  9704. * HT-SIG and VHT-SIG-A1 fields
  9705. * - VHT_SIG_A2
  9706. * Bits 23:0
  9707. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9708. * from the rx PPDU
  9709. * Value:
  9710. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9711. * VHT-SIG-A2 data.
  9712. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9713. * last 24 bits of the HT-SIG data.
  9714. * Otherwise, this field is invalid.
  9715. * Refer to the the 802.11 protocol for the definition of the
  9716. * HT-SIG and VHT-SIG-A2 fields
  9717. * - PREAMBLE_TYPE
  9718. * Bits 31:24
  9719. * Purpose: indicate the PHY format of the received burst
  9720. * Value:
  9721. * 0x4: Legacy (OFDM/CCK)
  9722. * 0x8: HT
  9723. * 0x9: HT with TxBF
  9724. * 0xC: VHT
  9725. * 0xD: VHT with TxBF
  9726. * - SERVICE
  9727. * Bits 31:24
  9728. * Purpose: TBD
  9729. * Value: TBD
  9730. *
  9731. * Rx MSDU descriptor fields:
  9732. * - FW_RX_DESC_BYTES
  9733. * Bits 15:0
  9734. * Purpose: Indicate how many bytes in the Rx indication are used for
  9735. * FW Rx descriptors
  9736. *
  9737. * Payload fields:
  9738. * - MPDU_COUNT
  9739. * Bits 7:0
  9740. * Purpose: Indicate how many sequential MPDUs share the same status.
  9741. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9742. * - MPDU_STATUS
  9743. * Bits 15:8
  9744. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9745. * received successfully.
  9746. * Value:
  9747. * 0x1: success
  9748. * 0x2: FCS error
  9749. * 0x3: duplicate error
  9750. * 0x4: replay error
  9751. * 0x5: invalid peer
  9752. */
  9753. /* header fields */
  9754. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9755. #define HTT_RX_IND_EXT_TID_S 8
  9756. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9757. #define HTT_RX_IND_FLUSH_VALID_S 13
  9758. #define HTT_RX_IND_REL_VALID_M 0x4000
  9759. #define HTT_RX_IND_REL_VALID_S 14
  9760. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9761. #define HTT_RX_IND_PEER_ID_S 16
  9762. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9763. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9764. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9765. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9766. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9767. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9768. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9769. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9770. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9771. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9772. /* rx PPDU descriptor fields */
  9773. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9774. #define HTT_RX_IND_RSSI_CMB_S 0
  9775. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9776. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9777. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9778. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9779. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9780. #define HTT_RX_IND_PHY_ERR_S 24
  9781. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9782. #define HTT_RX_IND_LEGACY_RATE_S 25
  9783. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9784. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9785. #define HTT_RX_IND_END_VALID_M 0x40000000
  9786. #define HTT_RX_IND_END_VALID_S 30
  9787. #define HTT_RX_IND_START_VALID_M 0x80000000
  9788. #define HTT_RX_IND_START_VALID_S 31
  9789. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9790. #define HTT_RX_IND_RSSI_PRI20_S 0
  9791. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9792. #define HTT_RX_IND_RSSI_EXT20_S 8
  9793. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9794. #define HTT_RX_IND_RSSI_EXT40_S 16
  9795. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9796. #define HTT_RX_IND_RSSI_EXT80_S 24
  9797. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9798. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9799. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9800. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9801. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9802. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9803. #define HTT_RX_IND_SERVICE_M 0xff000000
  9804. #define HTT_RX_IND_SERVICE_S 24
  9805. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9806. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9807. /* rx MSDU descriptor fields */
  9808. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9809. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9810. /* payload fields */
  9811. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9812. #define HTT_RX_IND_MPDU_COUNT_S 0
  9813. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9814. #define HTT_RX_IND_MPDU_STATUS_S 8
  9815. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9816. do { \
  9817. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9818. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9819. } while (0)
  9820. #define HTT_RX_IND_EXT_TID_GET(word) \
  9821. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9822. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9823. do { \
  9824. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9825. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9826. } while (0)
  9827. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9828. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9829. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9830. do { \
  9831. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9832. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9833. } while (0)
  9834. #define HTT_RX_IND_REL_VALID_GET(word) \
  9835. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9836. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9837. do { \
  9838. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9839. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9840. } while (0)
  9841. #define HTT_RX_IND_PEER_ID_GET(word) \
  9842. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9843. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9844. do { \
  9845. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9846. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9847. } while (0)
  9848. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9849. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9850. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9851. do { \
  9852. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9853. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9854. } while (0)
  9855. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9856. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9857. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9858. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9859. do { \
  9860. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9861. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9862. } while (0)
  9863. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9864. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9865. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9866. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9867. do { \
  9868. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9869. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9870. } while (0)
  9871. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9872. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9873. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9874. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9875. do { \
  9876. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9877. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9878. } while (0)
  9879. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9880. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9881. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9882. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9883. do { \
  9884. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9885. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9886. } while (0)
  9887. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9888. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9889. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9890. /* FW rx PPDU descriptor fields */
  9891. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9892. do { \
  9893. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9894. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9895. } while (0)
  9896. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9897. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9898. HTT_RX_IND_RSSI_CMB_S)
  9899. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9900. do { \
  9901. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9902. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9903. } while (0)
  9904. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9905. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9906. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9907. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9908. do { \
  9909. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9910. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9911. } while (0)
  9912. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9913. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9914. HTT_RX_IND_PHY_ERR_CODE_S)
  9915. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9916. do { \
  9917. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9918. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9919. } while (0)
  9920. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9921. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9922. HTT_RX_IND_PHY_ERR_S)
  9923. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9924. do { \
  9925. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9926. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9927. } while (0)
  9928. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9929. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9930. HTT_RX_IND_LEGACY_RATE_S)
  9931. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9932. do { \
  9933. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9934. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9935. } while (0)
  9936. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9937. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9938. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9939. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9940. do { \
  9941. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9942. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9943. } while (0)
  9944. #define HTT_RX_IND_END_VALID_GET(word) \
  9945. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9946. HTT_RX_IND_END_VALID_S)
  9947. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9948. do { \
  9949. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9950. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9951. } while (0)
  9952. #define HTT_RX_IND_START_VALID_GET(word) \
  9953. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9954. HTT_RX_IND_START_VALID_S)
  9955. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9956. do { \
  9957. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9958. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9959. } while (0)
  9960. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9961. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9962. HTT_RX_IND_RSSI_PRI20_S)
  9963. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9964. do { \
  9965. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9966. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9967. } while (0)
  9968. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9969. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9970. HTT_RX_IND_RSSI_EXT20_S)
  9971. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9972. do { \
  9973. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9974. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9975. } while (0)
  9976. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9977. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9978. HTT_RX_IND_RSSI_EXT40_S)
  9979. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9980. do { \
  9981. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9982. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9983. } while (0)
  9984. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9985. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9986. HTT_RX_IND_RSSI_EXT80_S)
  9987. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9988. do { \
  9989. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9990. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9991. } while (0)
  9992. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9993. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9994. HTT_RX_IND_VHT_SIG_A1_S)
  9995. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9996. do { \
  9997. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9998. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9999. } while (0)
  10000. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10001. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10002. HTT_RX_IND_VHT_SIG_A2_S)
  10003. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10004. do { \
  10005. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10006. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10007. } while (0)
  10008. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10009. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10010. HTT_RX_IND_PREAMBLE_TYPE_S)
  10011. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10012. do { \
  10013. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10014. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10015. } while (0)
  10016. #define HTT_RX_IND_SERVICE_GET(word) \
  10017. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10018. HTT_RX_IND_SERVICE_S)
  10019. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10020. do { \
  10021. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10022. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10023. } while (0)
  10024. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10025. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10026. HTT_RX_IND_SA_ANT_MATRIX_S)
  10027. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10028. do { \
  10029. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10030. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10031. } while (0)
  10032. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10033. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10034. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10035. do { \
  10036. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10037. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10038. } while (0)
  10039. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10040. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10041. #define HTT_RX_IND_HL_BYTES \
  10042. (HTT_RX_IND_HDR_BYTES + \
  10043. 4 /* single FW rx MSDU descriptor */ + \
  10044. 4 /* single MPDU range information element */)
  10045. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10046. /* Could we use one macro entry? */
  10047. #define HTT_WORD_SET(word, field, value) \
  10048. do { \
  10049. HTT_CHECK_SET_VAL(field, value); \
  10050. (word) |= ((value) << field ## _S); \
  10051. } while (0)
  10052. #define HTT_WORD_GET(word, field) \
  10053. (((word) & field ## _M) >> field ## _S)
  10054. PREPACK struct hl_htt_rx_ind_base {
  10055. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10056. } POSTPACK;
  10057. /*
  10058. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10059. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10060. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10061. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10062. * htt_rx_ind_hl_rx_desc_t.
  10063. */
  10064. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10065. struct htt_rx_ind_hl_rx_desc_t {
  10066. A_UINT8 ver;
  10067. A_UINT8 len;
  10068. struct {
  10069. A_UINT8
  10070. first_msdu: 1,
  10071. last_msdu: 1,
  10072. c3_failed: 1,
  10073. c4_failed: 1,
  10074. ipv6: 1,
  10075. tcp: 1,
  10076. udp: 1,
  10077. reserved: 1;
  10078. } flags;
  10079. /* NOTE: no reserved space - don't append any new fields here */
  10080. };
  10081. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10082. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10083. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10084. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10085. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10086. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10087. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10088. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10089. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10090. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10091. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10092. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10093. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10094. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10095. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10096. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10097. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10098. /* This structure is used in HL, the basic descriptor information
  10099. * used by host. the structure is translated by FW from HW desc
  10100. * or generated by FW. But in HL monitor mode, the host would use
  10101. * the same structure with LL.
  10102. */
  10103. PREPACK struct hl_htt_rx_desc_base {
  10104. A_UINT32
  10105. seq_num:12,
  10106. encrypted:1,
  10107. chan_info_present:1,
  10108. resv0:2,
  10109. mcast_bcast:1,
  10110. fragment:1,
  10111. key_id_oct:8,
  10112. resv1:6;
  10113. A_UINT32
  10114. pn_31_0;
  10115. union {
  10116. struct {
  10117. A_UINT16 pn_47_32;
  10118. A_UINT16 pn_63_48;
  10119. } pn16;
  10120. A_UINT32 pn_63_32;
  10121. } u0;
  10122. A_UINT32
  10123. pn_95_64;
  10124. A_UINT32
  10125. pn_127_96;
  10126. } POSTPACK;
  10127. /*
  10128. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10129. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10130. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10131. * Please see htt_chan_change_t for description of the fields.
  10132. */
  10133. PREPACK struct htt_chan_info_t
  10134. {
  10135. A_UINT32 primary_chan_center_freq_mhz: 16,
  10136. contig_chan1_center_freq_mhz: 16;
  10137. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10138. phy_mode: 8,
  10139. reserved: 8;
  10140. } POSTPACK;
  10141. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10142. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10143. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10144. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10145. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10146. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10147. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10148. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10149. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10150. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10151. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10152. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10153. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10154. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10155. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10156. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10157. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10158. /* Channel information */
  10159. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10160. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10161. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10162. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10163. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10164. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10165. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10166. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10167. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10168. do { \
  10169. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10170. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10171. } while (0)
  10172. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10173. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10174. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10175. do { \
  10176. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10177. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10178. } while (0)
  10179. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10180. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10181. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10182. do { \
  10183. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10184. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10185. } while (0)
  10186. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10187. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10188. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10189. do { \
  10190. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10191. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10192. } while (0)
  10193. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10194. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10195. /*
  10196. * @brief target -> host message definition for FW offloaded pkts
  10197. *
  10198. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10199. *
  10200. * @details
  10201. * The following field definitions describe the format of the firmware
  10202. * offload deliver message sent from the target to the host.
  10203. *
  10204. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10205. *
  10206. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10207. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10208. * | reserved_1 | msg type |
  10209. * |--------------------------------------------------------------------------|
  10210. * | phy_timestamp_l32 |
  10211. * |--------------------------------------------------------------------------|
  10212. * | WORD2 (see below) |
  10213. * |--------------------------------------------------------------------------|
  10214. * | seqno | framectrl |
  10215. * |--------------------------------------------------------------------------|
  10216. * | reserved_3 | vdev_id | tid_num|
  10217. * |--------------------------------------------------------------------------|
  10218. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10219. * |--------------------------------------------------------------------------|
  10220. *
  10221. * where:
  10222. * STAT = status
  10223. * F = format (802.3 vs. 802.11)
  10224. *
  10225. * definition for word 2
  10226. *
  10227. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10228. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10229. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10230. * |--------------------------------------------------------------------------|
  10231. *
  10232. * where:
  10233. * PR = preamble
  10234. * BF = beamformed
  10235. */
  10236. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10237. {
  10238. A_UINT32 /* word 0 */
  10239. msg_type:8, /* [ 7: 0] */
  10240. reserved_1:24; /* [31: 8] */
  10241. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10242. A_UINT32 /* word 2 */
  10243. /* preamble:
  10244. * 0-OFDM,
  10245. * 1-CCk,
  10246. * 2-HT,
  10247. * 3-VHT
  10248. */
  10249. preamble: 2, /* [1:0] */
  10250. /* mcs:
  10251. * In case of HT preamble interpret
  10252. * MCS along with NSS.
  10253. * Valid values for HT are 0 to 7.
  10254. * HT mcs 0 with NSS 2 is mcs 8.
  10255. * Valid values for VHT are 0 to 9.
  10256. */
  10257. mcs: 4, /* [5:2] */
  10258. /* rate:
  10259. * This is applicable only for
  10260. * CCK and OFDM preamble type
  10261. * rate 0: OFDM 48 Mbps,
  10262. * 1: OFDM 24 Mbps,
  10263. * 2: OFDM 12 Mbps
  10264. * 3: OFDM 6 Mbps
  10265. * 4: OFDM 54 Mbps
  10266. * 5: OFDM 36 Mbps
  10267. * 6: OFDM 18 Mbps
  10268. * 7: OFDM 9 Mbps
  10269. * rate 0: CCK 11 Mbps Long
  10270. * 1: CCK 5.5 Mbps Long
  10271. * 2: CCK 2 Mbps Long
  10272. * 3: CCK 1 Mbps Long
  10273. * 4: CCK 11 Mbps Short
  10274. * 5: CCK 5.5 Mbps Short
  10275. * 6: CCK 2 Mbps Short
  10276. */
  10277. rate : 3, /* [ 8: 6] */
  10278. rssi : 8, /* [16: 9] units=dBm */
  10279. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10280. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10281. stbc : 1, /* [22] */
  10282. sgi : 1, /* [23] */
  10283. ldpc : 1, /* [24] */
  10284. beamformed: 1, /* [25] */
  10285. reserved_2: 6; /* [31:26] */
  10286. A_UINT32 /* word 3 */
  10287. framectrl:16, /* [15: 0] */
  10288. seqno:16; /* [31:16] */
  10289. A_UINT32 /* word 4 */
  10290. tid_num:5, /* [ 4: 0] actual TID number */
  10291. vdev_id:8, /* [12: 5] */
  10292. reserved_3:19; /* [31:13] */
  10293. A_UINT32 /* word 5 */
  10294. /* status:
  10295. * 0: tx_ok
  10296. * 1: retry
  10297. * 2: drop
  10298. * 3: filtered
  10299. * 4: abort
  10300. * 5: tid delete
  10301. * 6: sw abort
  10302. * 7: dropped by peer migration
  10303. */
  10304. status:3, /* [2:0] */
  10305. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10306. tx_mpdu_bytes:16, /* [19:4] */
  10307. /* Indicates retry count of offloaded/local generated Data tx frames */
  10308. tx_retry_cnt:6, /* [25:20] */
  10309. reserved_4:6; /* [31:26] */
  10310. } POSTPACK;
  10311. /* FW offload deliver ind message header fields */
  10312. /* DWORD one */
  10313. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10314. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10315. /* DWORD two */
  10316. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10317. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10318. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10319. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10320. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10321. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10322. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10323. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10324. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10325. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10326. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10327. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10328. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10329. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10330. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10331. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10332. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10333. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10334. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10335. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10336. /* DWORD three*/
  10337. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10338. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10339. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10340. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10341. /* DWORD four */
  10342. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10343. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10344. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10345. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10346. /* DWORD five */
  10347. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10348. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10349. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10350. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10351. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10352. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10353. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10354. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10355. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10356. do { \
  10357. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10358. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10359. } while (0)
  10360. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10361. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10362. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10363. do { \
  10364. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10365. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10366. } while (0)
  10367. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10368. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10369. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10370. do { \
  10371. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10372. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10373. } while (0)
  10374. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10375. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10376. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10377. do { \
  10378. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10379. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10380. } while (0)
  10381. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10382. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10383. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10384. do { \
  10385. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10386. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10387. } while (0)
  10388. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10389. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10390. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10391. do { \
  10392. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10393. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10394. } while (0)
  10395. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10396. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10397. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10398. do { \
  10399. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10400. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10401. } while (0)
  10402. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10403. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10404. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10405. do { \
  10406. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10407. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10408. } while (0)
  10409. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10410. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10411. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10412. do { \
  10413. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10414. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10415. } while (0)
  10416. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10417. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10418. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10419. do { \
  10420. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10421. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10422. } while (0)
  10423. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10424. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10425. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10426. do { \
  10427. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10428. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10429. } while (0)
  10430. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10431. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10432. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10433. do { \
  10434. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10435. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10436. } while (0)
  10437. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10438. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10439. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10440. do { \
  10441. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10442. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10443. } while (0)
  10444. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10445. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10446. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10447. do { \
  10448. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10449. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10450. } while (0)
  10451. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10452. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10453. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10454. do { \
  10455. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10456. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10457. } while (0)
  10458. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10459. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10460. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10461. do { \
  10462. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10463. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10464. } while (0)
  10465. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10466. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10467. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10468. do { \
  10469. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10470. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10471. } while (0)
  10472. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10473. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10474. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10475. do { \
  10476. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10477. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10478. } while (0)
  10479. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10480. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10481. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10482. do { \
  10483. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10484. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10485. } while (0)
  10486. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10487. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10488. /*
  10489. * @brief target -> host rx reorder flush message definition
  10490. *
  10491. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10492. *
  10493. * @details
  10494. * The following field definitions describe the format of the rx flush
  10495. * message sent from the target to the host.
  10496. * The message consists of a 4-octet header, followed by one or more
  10497. * 4-octet payload information elements.
  10498. *
  10499. * |31 24|23 8|7 0|
  10500. * |--------------------------------------------------------------|
  10501. * | TID | peer ID | msg type |
  10502. * |--------------------------------------------------------------|
  10503. * | seq num end | seq num start | MPDU status | reserved |
  10504. * |--------------------------------------------------------------|
  10505. * First DWORD:
  10506. * - MSG_TYPE
  10507. * Bits 7:0
  10508. * Purpose: identifies this as an rx flush message
  10509. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10510. * - PEER_ID
  10511. * Bits 23:8 (only bits 18:8 actually used)
  10512. * Purpose: identify which peer's rx data is being flushed
  10513. * Value: (rx) peer ID
  10514. * - TID
  10515. * Bits 31:24 (only bits 27:24 actually used)
  10516. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10517. * Value: traffic identifier
  10518. * Second DWORD:
  10519. * - MPDU_STATUS
  10520. * Bits 15:8
  10521. * Purpose:
  10522. * Indicate whether the flushed MPDUs should be discarded or processed.
  10523. * Value:
  10524. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10525. * stages of rx processing
  10526. * other: discard the MPDUs
  10527. * It is anticipated that flush messages will always have
  10528. * MPDU status == 1, but the status flag is included for
  10529. * flexibility.
  10530. * - SEQ_NUM_START
  10531. * Bits 23:16
  10532. * Purpose:
  10533. * Indicate the start of a series of consecutive MPDUs being flushed.
  10534. * Not all MPDUs within this range are necessarily valid - the host
  10535. * must check each sequence number within this range to see if the
  10536. * corresponding MPDU is actually present.
  10537. * Value:
  10538. * The sequence number for the first MPDU in the sequence.
  10539. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10540. * - SEQ_NUM_END
  10541. * Bits 30:24
  10542. * Purpose:
  10543. * Indicate the end of a series of consecutive MPDUs being flushed.
  10544. * Value:
  10545. * The sequence number one larger than the sequence number of the
  10546. * last MPDU being flushed.
  10547. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10548. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10549. * are to be released for further rx processing.
  10550. * Not all MPDUs within this range are necessarily valid - the host
  10551. * must check each sequence number within this range to see if the
  10552. * corresponding MPDU is actually present.
  10553. */
  10554. /* first DWORD */
  10555. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10556. #define HTT_RX_FLUSH_PEER_ID_S 8
  10557. #define HTT_RX_FLUSH_TID_M 0xff000000
  10558. #define HTT_RX_FLUSH_TID_S 24
  10559. /* second DWORD */
  10560. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10561. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10562. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10563. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10564. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10565. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10566. #define HTT_RX_FLUSH_BYTES 8
  10567. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10568. do { \
  10569. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10570. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10571. } while (0)
  10572. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10573. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10574. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10575. do { \
  10576. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10577. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10578. } while (0)
  10579. #define HTT_RX_FLUSH_TID_GET(word) \
  10580. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10581. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10582. do { \
  10583. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10584. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10585. } while (0)
  10586. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10587. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10588. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10589. do { \
  10590. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10591. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10592. } while (0)
  10593. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10594. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10595. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10596. do { \
  10597. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10598. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10599. } while (0)
  10600. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10601. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10602. /*
  10603. * @brief target -> host rx pn check indication message
  10604. *
  10605. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10606. *
  10607. * @details
  10608. * The following field definitions describe the format of the Rx PN check
  10609. * indication message sent from the target to the host.
  10610. * The message consists of a 4-octet header, followed by the start and
  10611. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10612. * IE is one octet containing the sequence number that failed the PN
  10613. * check.
  10614. *
  10615. * |31 24|23 8|7 0|
  10616. * |--------------------------------------------------------------|
  10617. * | TID | peer ID | msg type |
  10618. * |--------------------------------------------------------------|
  10619. * | Reserved | PN IE count | seq num end | seq num start|
  10620. * |--------------------------------------------------------------|
  10621. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10622. * |--------------------------------------------------------------|
  10623. * First DWORD:
  10624. * - MSG_TYPE
  10625. * Bits 7:0
  10626. * Purpose: Identifies this as an rx pn check indication message
  10627. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10628. * - PEER_ID
  10629. * Bits 23:8 (only bits 18:8 actually used)
  10630. * Purpose: identify which peer
  10631. * Value: (rx) peer ID
  10632. * - TID
  10633. * Bits 31:24 (only bits 27:24 actually used)
  10634. * Purpose: identify traffic identifier
  10635. * Value: traffic identifier
  10636. * Second DWORD:
  10637. * - SEQ_NUM_START
  10638. * Bits 7:0
  10639. * Purpose:
  10640. * Indicates the starting sequence number of the MPDU in this
  10641. * series of MPDUs that went though PN check.
  10642. * Value:
  10643. * The sequence number for the first MPDU in the sequence.
  10644. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10645. * - SEQ_NUM_END
  10646. * Bits 15:8
  10647. * Purpose:
  10648. * Indicates the ending sequence number of the MPDU in this
  10649. * series of MPDUs that went though PN check.
  10650. * Value:
  10651. * The sequence number one larger then the sequence number of the last
  10652. * MPDU being flushed.
  10653. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10654. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10655. * for invalid PN numbers and are ready to be released for further processing.
  10656. * Not all MPDUs within this range are necessarily valid - the host
  10657. * must check each sequence number within this range to see if the
  10658. * corresponding MPDU is actually present.
  10659. * - PN_IE_COUNT
  10660. * Bits 23:16
  10661. * Purpose:
  10662. * Used to determine the variable number of PN information elements in this
  10663. * message
  10664. *
  10665. * PN information elements:
  10666. * - PN_IE_x-
  10667. * Purpose:
  10668. * Each PN information element contains the sequence number of the MPDU that
  10669. * has failed the target PN check.
  10670. * Value:
  10671. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10672. * that failed the PN check.
  10673. */
  10674. /* first DWORD */
  10675. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10676. #define HTT_RX_PN_IND_PEER_ID_S 8
  10677. #define HTT_RX_PN_IND_TID_M 0xff000000
  10678. #define HTT_RX_PN_IND_TID_S 24
  10679. /* second DWORD */
  10680. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10681. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10682. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10683. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10684. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10685. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10686. #define HTT_RX_PN_IND_BYTES 8
  10687. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10688. do { \
  10689. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10690. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10691. } while (0)
  10692. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10693. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10694. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10695. do { \
  10696. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10697. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10698. } while (0)
  10699. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10700. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10701. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10702. do { \
  10703. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10704. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10705. } while (0)
  10706. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10707. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10708. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10709. do { \
  10710. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10711. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10712. } while (0)
  10713. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10714. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10715. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10716. do { \
  10717. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10718. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10719. } while (0)
  10720. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10721. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10722. /*
  10723. * @brief target -> host rx offload deliver message for LL system
  10724. *
  10725. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10726. *
  10727. * @details
  10728. * In a low latency system this message is sent whenever the offload
  10729. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10730. * The DMA of the actual packets into host memory is done before sending out
  10731. * this message. This message indicates only how many MSDUs to reap. The
  10732. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10733. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10734. * DMA'd by the MAC directly into host memory these packets do not contain
  10735. * the MAC descriptors in the header portion of the packet. Instead they contain
  10736. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10737. * message, the packets are delivered directly to the NW stack without going
  10738. * through the regular reorder buffering and PN checking path since it has
  10739. * already been done in target.
  10740. *
  10741. * |31 24|23 16|15 8|7 0|
  10742. * |-----------------------------------------------------------------------|
  10743. * | Total MSDU count | reserved | msg type |
  10744. * |-----------------------------------------------------------------------|
  10745. *
  10746. * @brief target -> host rx offload deliver message for HL system
  10747. *
  10748. * @details
  10749. * In a high latency system this message is sent whenever the offload manager
  10750. * flushes out the packets it has coalesced in its coalescing buffer. The
  10751. * actual packets are also carried along with this message. When the host
  10752. * receives this message, it is expected to deliver these packets to the NW
  10753. * stack directly instead of routing them through the reorder buffering and
  10754. * PN checking path since it has already been done in target.
  10755. *
  10756. * |31 24|23 16|15 8|7 0|
  10757. * |-----------------------------------------------------------------------|
  10758. * | Total MSDU count | reserved | msg type |
  10759. * |-----------------------------------------------------------------------|
  10760. * | peer ID | MSDU length |
  10761. * |-----------------------------------------------------------------------|
  10762. * | MSDU payload | FW Desc | tid | vdev ID |
  10763. * |-----------------------------------------------------------------------|
  10764. * | MSDU payload contd. |
  10765. * |-----------------------------------------------------------------------|
  10766. * | peer ID | MSDU length |
  10767. * |-----------------------------------------------------------------------|
  10768. * | MSDU payload | FW Desc | tid | vdev ID |
  10769. * |-----------------------------------------------------------------------|
  10770. * | MSDU payload contd. |
  10771. * |-----------------------------------------------------------------------|
  10772. *
  10773. */
  10774. /* first DWORD */
  10775. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10776. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10777. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10778. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10779. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10780. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10781. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10782. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10783. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10784. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10785. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10786. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10787. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10788. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10789. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10790. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10791. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10792. do { \
  10793. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10794. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10795. } while (0)
  10796. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10797. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10798. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10799. do { \
  10800. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10801. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10802. } while (0)
  10803. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10804. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10805. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10806. do { \
  10807. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10808. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10809. } while (0)
  10810. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10811. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10812. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10813. do { \
  10814. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10815. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10816. } while (0)
  10817. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10818. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10819. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10820. do { \
  10821. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10822. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10823. } while (0)
  10824. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10825. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10826. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10827. do { \
  10828. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10829. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10830. } while (0)
  10831. /**
  10832. * @brief target -> host rx peer map/unmap message definition
  10833. *
  10834. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10835. *
  10836. * @details
  10837. * The following diagram shows the format of the rx peer map message sent
  10838. * from the target to the host. This layout assumes the target operates
  10839. * as little-endian.
  10840. *
  10841. * This message always contains a SW peer ID. The main purpose of the
  10842. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10843. * with, so that the host can use that peer ID to determine which peer
  10844. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10845. * other purposes, such as identifying during tx completions which peer
  10846. * the tx frames in question were transmitted to.
  10847. *
  10848. * In certain generations of chips, the peer map message also contains
  10849. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10850. * to identify which peer the frame needs to be forwarded to (i.e. the
  10851. * peer assocated with the Destination MAC Address within the packet),
  10852. * and particularly which vdev needs to transmit the frame (for cases
  10853. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10854. * meaning as AST_INDEX_0.
  10855. * This DA-based peer ID that is provided for certain rx frames
  10856. * (the rx frames that need to be re-transmitted as tx frames)
  10857. * is the ID that the HW uses for referring to the peer in question,
  10858. * rather than the peer ID that the SW+FW use to refer to the peer.
  10859. *
  10860. *
  10861. * |31 24|23 16|15 8|7 0|
  10862. * |-----------------------------------------------------------------------|
  10863. * | SW peer ID | VDEV ID | msg type |
  10864. * |-----------------------------------------------------------------------|
  10865. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10866. * |-----------------------------------------------------------------------|
  10867. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10868. * |-----------------------------------------------------------------------|
  10869. *
  10870. *
  10871. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10872. *
  10873. * The following diagram shows the format of the rx peer unmap message sent
  10874. * from the target to the host.
  10875. *
  10876. * |31 24|23 16|15 8|7 0|
  10877. * |-----------------------------------------------------------------------|
  10878. * | SW peer ID | VDEV ID | msg type |
  10879. * |-----------------------------------------------------------------------|
  10880. *
  10881. * The following field definitions describe the format of the rx peer map
  10882. * and peer unmap messages sent from the target to the host.
  10883. * - MSG_TYPE
  10884. * Bits 7:0
  10885. * Purpose: identifies this as an rx peer map or peer unmap message
  10886. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10887. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10888. * - VDEV_ID
  10889. * Bits 15:8
  10890. * Purpose: Indicates which virtual device the peer is associated
  10891. * with.
  10892. * Value: vdev ID (used in the host to look up the vdev object)
  10893. * - PEER_ID (a.k.a. SW_PEER_ID)
  10894. * Bits 31:16
  10895. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10896. * freeing (unmap)
  10897. * Value: (rx) peer ID
  10898. * - MAC_ADDR_L32 (peer map only)
  10899. * Bits 31:0
  10900. * Purpose: Identifies which peer node the peer ID is for.
  10901. * Value: lower 4 bytes of peer node's MAC address
  10902. * - MAC_ADDR_U16 (peer map only)
  10903. * Bits 15:0
  10904. * Purpose: Identifies which peer node the peer ID is for.
  10905. * Value: upper 2 bytes of peer node's MAC address
  10906. * - HW_PEER_ID
  10907. * Bits 31:16
  10908. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10909. * address, so for rx frames marked for rx --> tx forwarding, the
  10910. * host can determine from the HW peer ID provided as meta-data with
  10911. * the rx frame which peer the frame is supposed to be forwarded to.
  10912. * Value: ID used by the MAC HW to identify the peer
  10913. */
  10914. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10915. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10916. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10917. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10918. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10919. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10920. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10921. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10922. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10923. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10924. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10925. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10926. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10927. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10928. do { \
  10929. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10930. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10931. } while (0)
  10932. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10933. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10934. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10935. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10936. do { \
  10937. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10938. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10939. } while (0)
  10940. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10941. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10942. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10943. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10944. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10945. do { \
  10946. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10947. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10948. } while (0)
  10949. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10950. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10951. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10952. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10953. #define HTT_RX_PEER_MAP_BYTES 12
  10954. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10955. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10956. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10957. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10958. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10959. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10960. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10961. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10962. #define HTT_RX_PEER_UNMAP_BYTES 4
  10963. /**
  10964. * @brief target -> host rx peer map V2 message definition
  10965. *
  10966. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10967. *
  10968. * @details
  10969. * The following diagram shows the format of the rx peer map v2 message sent
  10970. * from the target to the host. This layout assumes the target operates
  10971. * as little-endian.
  10972. *
  10973. * This message always contains a SW peer ID. The main purpose of the
  10974. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10975. * with, so that the host can use that peer ID to determine which peer
  10976. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10977. * other purposes, such as identifying during tx completions which peer
  10978. * the tx frames in question were transmitted to.
  10979. *
  10980. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10981. * is used during rx --> tx frame forwarding to identify which peer the
  10982. * frame needs to be forwarded to (i.e. the peer assocated with the
  10983. * Destination MAC Address within the packet), and particularly which vdev
  10984. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10985. * This DA-based peer ID that is provided for certain rx frames
  10986. * (the rx frames that need to be re-transmitted as tx frames)
  10987. * is the ID that the HW uses for referring to the peer in question,
  10988. * rather than the peer ID that the SW+FW use to refer to the peer.
  10989. *
  10990. * The HW peer id here is the same meaning as AST_INDEX_0.
  10991. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10992. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10993. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10994. * AST is valid.
  10995. *
  10996. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10997. * |-------------------------------------------------------------------------|
  10998. * | SW peer ID | VDEV ID | msg type |
  10999. * |-------------------------------------------------------------------------|
  11000. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11001. * |-------------------------------------------------------------------------|
  11002. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11003. * |-------------------------------------------------------------------------|
  11004. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11005. * |-------------------------------------------------------------------------|
  11006. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11007. * |-------------------------------------------------------------------------|
  11008. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11009. * |-------------------------------------------------------------------------|
  11010. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11011. * |-------------------------------------------------------------------------|
  11012. * | Reserved_2 |
  11013. * |-------------------------------------------------------------------------|
  11014. * Where:
  11015. * NH = Next Hop
  11016. * ASTVM = AST valid mask
  11017. * OA = on-chip AST valid bit
  11018. * ASTFM = AST flow mask
  11019. *
  11020. * The following field definitions describe the format of the rx peer map v2
  11021. * messages sent from the target to the host.
  11022. * - MSG_TYPE
  11023. * Bits 7:0
  11024. * Purpose: identifies this as an rx peer map v2 message
  11025. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11026. * - VDEV_ID
  11027. * Bits 15:8
  11028. * Purpose: Indicates which virtual device the peer is associated with.
  11029. * Value: vdev ID (used in the host to look up the vdev object)
  11030. * - SW_PEER_ID
  11031. * Bits 31:16
  11032. * Purpose: The peer ID (index) that WAL is allocating
  11033. * Value: (rx) peer ID
  11034. * - MAC_ADDR_L32
  11035. * Bits 31:0
  11036. * Purpose: Identifies which peer node the peer ID is for.
  11037. * Value: lower 4 bytes of peer node's MAC address
  11038. * - MAC_ADDR_U16
  11039. * Bits 15:0
  11040. * Purpose: Identifies which peer node the peer ID is for.
  11041. * Value: upper 2 bytes of peer node's MAC address
  11042. * - HW_PEER_ID / AST_INDEX_0
  11043. * Bits 31:16
  11044. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11045. * address, so for rx frames marked for rx --> tx forwarding, the
  11046. * host can determine from the HW peer ID provided as meta-data with
  11047. * the rx frame which peer the frame is supposed to be forwarded to.
  11048. * Value: ID used by the MAC HW to identify the peer
  11049. * - AST_HASH_VALUE
  11050. * Bits 15:0
  11051. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11052. * override feature.
  11053. * - NEXT_HOP
  11054. * Bit 16
  11055. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11056. * (Wireless Distribution System).
  11057. * - AST_VALID_MASK
  11058. * Bits 19:17
  11059. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11060. * - ONCHIP_AST_VALID_FLAG
  11061. * Bit 20
  11062. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11063. * is valid.
  11064. * - AST_INDEX_1
  11065. * Bits 15:0
  11066. * Purpose: indicate the second AST index for this peer
  11067. * - AST_0_FLOW_MASK
  11068. * Bits 19:16
  11069. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11070. * - AST_1_FLOW_MASK
  11071. * Bits 23:20
  11072. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11073. * - AST_2_FLOW_MASK
  11074. * Bits 27:24
  11075. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11076. * - AST_3_FLOW_MASK
  11077. * Bits 31:28
  11078. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11079. * - AST_INDEX_2
  11080. * Bits 15:0
  11081. * Purpose: indicate the third AST index for this peer
  11082. * - TID_VALID_HI_PRI
  11083. * Bits 23:16
  11084. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11085. * - TID_VALID_LOW_PRI
  11086. * Bits 31:24
  11087. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11088. * - AST_INDEX_3
  11089. * Bits 15:0
  11090. * Purpose: indicate the fourth AST index for this peer
  11091. * - ONCHIP_AST_IDX / RESERVED
  11092. * Bits 31:16
  11093. * Purpose: This field is valid only when split AST feature is enabled.
  11094. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11095. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11096. * address, this ast_idx is used for LMAC modules for RXPCU.
  11097. * Value: ID used by the LMAC HW to identify the peer
  11098. */
  11099. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11100. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11101. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11102. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11103. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11104. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11105. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11106. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11107. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11108. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11109. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11110. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11111. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11112. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11113. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11114. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11115. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11116. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11117. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11118. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11119. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11120. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11121. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11122. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11123. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11124. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11125. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11126. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11127. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11128. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11129. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11130. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11131. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11132. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11133. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11134. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11135. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11136. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11137. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11138. do { \
  11139. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11140. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11141. } while (0)
  11142. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11143. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11144. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11145. do { \
  11146. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11147. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11148. } while (0)
  11149. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11150. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11151. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11152. do { \
  11153. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11154. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11155. } while (0)
  11156. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11157. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11158. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11159. do { \
  11160. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11161. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11162. } while (0)
  11163. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11164. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11165. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11166. do { \
  11167. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11168. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11169. } while (0)
  11170. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11171. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11172. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11173. do { \
  11174. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11175. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11176. } while (0)
  11177. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11178. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11179. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11180. do { \
  11181. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11182. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11183. } while (0)
  11184. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11185. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11186. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11187. do { \
  11188. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11189. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11190. } while (0)
  11191. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11192. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11193. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11194. do { \
  11195. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11196. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11197. } while (0)
  11198. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11199. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11200. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11201. do { \
  11202. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11203. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11204. } while (0)
  11205. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11206. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11207. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11208. do { \
  11209. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11210. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11211. } while (0)
  11212. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11213. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11214. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11215. do { \
  11216. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11217. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11218. } while (0)
  11219. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11220. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11221. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11222. do { \
  11223. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11224. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11225. } while (0)
  11226. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11227. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11228. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11229. do { \
  11230. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11231. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11232. } while (0)
  11233. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11234. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11235. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11236. do { \
  11237. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11238. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11239. } while (0)
  11240. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11241. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11242. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11243. do { \
  11244. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11245. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11246. } while (0)
  11247. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11248. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11249. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11250. do { \
  11251. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11252. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11253. } while (0)
  11254. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11255. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11256. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11257. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11258. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11259. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11260. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11261. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11262. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11263. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11264. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11265. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11266. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11267. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11268. /**
  11269. * @brief target -> host rx peer map V3 message definition
  11270. *
  11271. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11272. *
  11273. * @details
  11274. * The following diagram shows the format of the rx peer map v3 message sent
  11275. * from the target to the host.
  11276. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11277. * This layout assumes the target operates as little-endian.
  11278. *
  11279. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11280. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11281. * | SW peer ID | VDEV ID | msg type |
  11282. * |-----------------+--------------------+-----------------+-----------------|
  11283. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11284. * |-----------------+--------------------+-----------------+-----------------|
  11285. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11286. * |-----------------+--------+-----------+-----------------+-----------------|
  11287. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11288. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11289. * | (8bits) | | (4bits) | |
  11290. * |-----------------+--------+--+--+--+--------------------------------------|
  11291. * | RESERVED |E |O | | |
  11292. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11293. * | |V |V | | |
  11294. * |-----------------+--------------------+-----------------------------------|
  11295. * | HTT_MSDU_IDX_ | RESERVED | |
  11296. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11297. * | (8bits) | | |
  11298. * |-----------------+--------------------+-----------------------------------|
  11299. * | Reserved_2 |
  11300. * |--------------------------------------------------------------------------|
  11301. * | Reserved_3 |
  11302. * |--------------------------------------------------------------------------|
  11303. *
  11304. * Where:
  11305. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11306. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11307. * NH = Next Hop
  11308. * The following field definitions describe the format of the rx peer map v3
  11309. * messages sent from the target to the host.
  11310. * - MSG_TYPE
  11311. * Bits 7:0
  11312. * Purpose: identifies this as a peer map v3 message
  11313. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11314. * - VDEV_ID
  11315. * Bits 15:8
  11316. * Purpose: Indicates which virtual device the peer is associated with.
  11317. * - SW_PEER_ID
  11318. * Bits 31:16
  11319. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11320. * - MAC_ADDR_L32
  11321. * Bits 31:0
  11322. * Purpose: Identifies which peer node the peer ID is for.
  11323. * Value: lower 4 bytes of peer node's MAC address
  11324. * - MAC_ADDR_U16
  11325. * Bits 15:0
  11326. * Purpose: Identifies which peer node the peer ID is for.
  11327. * Value: upper 2 bytes of peer node's MAC address
  11328. * - MULTICAST_SW_PEER_ID
  11329. * Bits 31:16
  11330. * Purpose: The multicast peer ID (index)
  11331. * Value: set to HTT_INVALID_PEER if not valid
  11332. * - HW_PEER_ID / AST_INDEX
  11333. * Bits 15:0
  11334. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11335. * address, so for rx frames marked for rx --> tx forwarding, the
  11336. * host can determine from the HW peer ID provided as meta-data with
  11337. * the rx frame which peer the frame is supposed to be forwarded to.
  11338. * - CACHE_SET_NUM
  11339. * Bits 19:16
  11340. * Purpose: Cache Set Number for AST_INDEX
  11341. * Cache set number that should be used to cache the index based
  11342. * search results, for address and flow search.
  11343. * This value should be equal to LSB 4 bits of the hash value
  11344. * of match data, in case of search index points to an entry which
  11345. * may be used in content based search also. The value can be
  11346. * anything when the entry pointed by search index will not be
  11347. * used for content based search.
  11348. * - HTT_MSDU_IDX_VALID_MASK
  11349. * Bits 31:24
  11350. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11351. * - ONCHIP_AST_IDX / RESERVED
  11352. * Bits 15:0
  11353. * Purpose: This field is valid only when split AST feature is enabled.
  11354. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11355. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11356. * address, this ast_idx is used for LMAC modules for RXPCU.
  11357. * - NEXT_HOP
  11358. * Bits 16
  11359. * Purpose: Flag indicates next_hop AST entry used for WDS
  11360. * (Wireless Distribution System).
  11361. * - ONCHIP_AST_VALID
  11362. * Bits 17
  11363. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11364. * - EXT_AST_VALID
  11365. * Bits 18
  11366. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11367. * - EXT_AST_INDEX
  11368. * Bits 15:0
  11369. * Purpose: This field describes Extended AST index
  11370. * Valid if EXT_AST_VALID flag set
  11371. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11372. * Bits 31:24
  11373. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11374. */
  11375. /* dword 0 */
  11376. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11377. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11378. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11379. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11380. /* dword 1 */
  11381. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11382. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11383. /* dword 2 */
  11384. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11385. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11386. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11387. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11388. /* dword 3 */
  11389. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11390. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11391. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11392. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11393. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11394. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11395. /* dword 4 */
  11396. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11397. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11398. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11399. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11400. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11401. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11402. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11403. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11404. /* dword 5 */
  11405. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11406. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11407. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11408. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11409. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11410. do { \
  11411. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11412. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11413. } while (0)
  11414. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11415. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11416. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11417. do { \
  11418. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11419. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11420. } while (0)
  11421. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11422. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11423. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11424. do { \
  11425. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11426. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11427. } while (0)
  11428. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11429. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11430. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11431. do { \
  11432. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11433. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11434. } while (0)
  11435. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11436. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11437. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11438. do { \
  11439. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11440. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11441. } while (0)
  11442. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11443. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11444. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11445. do { \
  11446. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11447. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11448. } while (0)
  11449. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11450. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11451. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11452. do { \
  11453. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11454. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11455. } while (0)
  11456. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11457. (((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)
  11458. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11459. do { \
  11460. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11461. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11462. } while (0)
  11463. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11464. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11465. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11466. do { \
  11467. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11468. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11469. } while (0)
  11470. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11471. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11472. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11473. do { \
  11474. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11475. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11476. } while (0)
  11477. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11478. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11479. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11480. do { \
  11481. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11482. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11483. } while (0)
  11484. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11485. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11486. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11487. do { \
  11488. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11489. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11490. } while (0)
  11491. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11492. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11493. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11494. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11495. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11496. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11497. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11498. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11499. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11500. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11501. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11502. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11503. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11504. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11505. /**
  11506. * @brief target -> host rx peer unmap V2 message definition
  11507. *
  11508. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11509. *
  11510. * The following diagram shows the format of the rx peer unmap message sent
  11511. * from the target to the host.
  11512. *
  11513. * |31 24|23 16|15 8|7 0|
  11514. * |-----------------------------------------------------------------------|
  11515. * | SW peer ID | VDEV ID | msg type |
  11516. * |-----------------------------------------------------------------------|
  11517. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11518. * |-----------------------------------------------------------------------|
  11519. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11520. * |-----------------------------------------------------------------------|
  11521. * | Peer Delete Duration |
  11522. * |-----------------------------------------------------------------------|
  11523. * | Reserved_0 | WDS Free Count |
  11524. * |-----------------------------------------------------------------------|
  11525. * | Reserved_1 |
  11526. * |-----------------------------------------------------------------------|
  11527. * | Reserved_2 |
  11528. * |-----------------------------------------------------------------------|
  11529. *
  11530. *
  11531. * The following field definitions describe the format of the rx peer unmap
  11532. * messages sent from the target to the host.
  11533. * - MSG_TYPE
  11534. * Bits 7:0
  11535. * Purpose: identifies this as an rx peer unmap v2 message
  11536. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11537. * - VDEV_ID
  11538. * Bits 15:8
  11539. * Purpose: Indicates which virtual device the peer is associated
  11540. * with.
  11541. * Value: vdev ID (used in the host to look up the vdev object)
  11542. * - SW_PEER_ID
  11543. * Bits 31:16
  11544. * Purpose: The peer ID (index) that WAL is freeing
  11545. * Value: (rx) peer ID
  11546. * - MAC_ADDR_L32
  11547. * Bits 31:0
  11548. * Purpose: Identifies which peer node the peer ID is for.
  11549. * Value: lower 4 bytes of peer node's MAC address
  11550. * - MAC_ADDR_U16
  11551. * Bits 15:0
  11552. * Purpose: Identifies which peer node the peer ID is for.
  11553. * Value: upper 2 bytes of peer node's MAC address
  11554. * - NEXT_HOP
  11555. * Bits 16
  11556. * Purpose: Bit indicates next_hop AST entry used for WDS
  11557. * (Wireless Distribution System).
  11558. * - PEER_DELETE_DURATION
  11559. * Bits 31:0
  11560. * Purpose: Time taken to delete peer, in msec,
  11561. * Used for monitoring / debugging PEER delete response delay
  11562. * - PEER_WDS_FREE_COUNT
  11563. * Bits 15:0
  11564. * Purpose: Count of WDS entries deleted associated to peer deleted
  11565. */
  11566. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11567. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11568. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11569. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11570. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11571. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11572. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11573. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11574. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11575. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11576. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11577. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11578. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11579. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11580. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11581. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11582. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11583. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11584. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11585. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11586. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11587. do { \
  11588. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11589. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11590. } while (0)
  11591. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11592. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11593. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11594. do { \
  11595. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11596. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11597. } while (0)
  11598. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11599. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11600. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11601. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11602. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11603. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11604. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11605. /**
  11606. * @brief target -> host rx peer mlo map message definition
  11607. *
  11608. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11609. *
  11610. * @details
  11611. * The following diagram shows the format of the rx mlo peer map message sent
  11612. * from the target to the host. This layout assumes the target operates
  11613. * as little-endian.
  11614. *
  11615. * MCC:
  11616. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11617. *
  11618. * WIN:
  11619. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11620. * It will be sent on the Assoc Link.
  11621. *
  11622. * This message always contains a MLO peer ID. The main purpose of the
  11623. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11624. * with, so that the host can use that MLO peer ID to determine which peer
  11625. * transmitted the rx frame.
  11626. *
  11627. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11628. * |-------------------------------------------------------------------------|
  11629. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11630. * |-------------------------------------------------------------------------|
  11631. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11632. * |-------------------------------------------------------------------------|
  11633. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11634. * |-------------------------------------------------------------------------|
  11635. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11636. * |-------------------------------------------------------------------------|
  11637. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11638. * |-------------------------------------------------------------------------|
  11639. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11640. * |-------------------------------------------------------------------------|
  11641. * |RSVD |
  11642. * |-------------------------------------------------------------------------|
  11643. * |RSVD |
  11644. * |-------------------------------------------------------------------------|
  11645. * | htt_tlv_hdr_t |
  11646. * |-------------------------------------------------------------------------|
  11647. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11648. * |-------------------------------------------------------------------------|
  11649. * | htt_tlv_hdr_t |
  11650. * |-------------------------------------------------------------------------|
  11651. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11652. * |-------------------------------------------------------------------------|
  11653. * | htt_tlv_hdr_t |
  11654. * |-------------------------------------------------------------------------|
  11655. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11656. * |-------------------------------------------------------------------------|
  11657. *
  11658. * Where:
  11659. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11660. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11661. * V (valid) - 1 Bit Bit17
  11662. * CHIPID - 3 Bits
  11663. * TIDMASK - 8 Bits
  11664. * CACHE_SET_NUM - 8 Bits
  11665. *
  11666. * The following field definitions describe the format of the rx MLO peer map
  11667. * messages sent from the target to the host.
  11668. * - MSG_TYPE
  11669. * Bits 7:0
  11670. * Purpose: identifies this as an rx mlo peer map message
  11671. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11672. *
  11673. * - MLO_PEER_ID
  11674. * Bits 23:8
  11675. * Purpose: The MLO peer ID (index).
  11676. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11677. * Value: MLO peer ID
  11678. *
  11679. * - NUMLINK
  11680. * Bits: 26:24 (3Bits)
  11681. * Purpose: Indicate the max number of logical links supported per client.
  11682. * Value: number of logical links
  11683. *
  11684. * - PRC
  11685. * Bits: 29:27 (3Bits)
  11686. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11687. * if there is migration of the primary chip.
  11688. * Value: Primary REO CHIPID
  11689. *
  11690. * - MAC_ADDR_L32
  11691. * Bits 31:0
  11692. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11693. * Value: lower 4 bytes of peer node's MAC address
  11694. *
  11695. * - MAC_ADDR_U16
  11696. * Bits 15:0
  11697. * Purpose: Identifies which peer node the peer ID is for.
  11698. * Value: upper 2 bytes of peer node's MAC address
  11699. *
  11700. * - PRIMARY_TCL_AST_IDX
  11701. * Bits 15:0
  11702. * Purpose: Primary TCL AST index for this peer.
  11703. *
  11704. * - V
  11705. * 1 Bit Position 16
  11706. * Purpose: If the ast idx is valid.
  11707. *
  11708. * - CHIPID
  11709. * Bits 19:17
  11710. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11711. *
  11712. * - TIDMASK
  11713. * Bits 27:20
  11714. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11715. *
  11716. * - CACHE_SET_NUM
  11717. * Bits 31:28
  11718. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11719. * Cache set number that should be used to cache the index based
  11720. * search results, for address and flow search.
  11721. * This value should be equal to LSB four bits of the hash value
  11722. * of match data, in case of search index points to an entry which
  11723. * may be used in content based search also. The value can be
  11724. * anything when the entry pointed by search index will not be
  11725. * used for content based search.
  11726. *
  11727. * - htt_tlv_hdr_t
  11728. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11729. *
  11730. * Bits 11:0
  11731. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11732. *
  11733. * Bits 23:12
  11734. * Purpose: Length, Length of the value that follows the header
  11735. *
  11736. * Bits 31:28
  11737. * Purpose: Reserved.
  11738. *
  11739. *
  11740. * - SW_PEER_ID
  11741. * Bits 15:0
  11742. * Purpose: The peer ID (index) that WAL is allocating
  11743. * Value: (rx) peer ID
  11744. *
  11745. * - VDEV_ID
  11746. * Bits 23:16
  11747. * Purpose: Indicates which virtual device the peer is associated with.
  11748. * Value: vdev ID (used in the host to look up the vdev object)
  11749. *
  11750. * - CHIPID
  11751. * Bits 26:24
  11752. * Purpose: Indicates which Chip id the peer is associated with.
  11753. * Value: chip ID (Provided by Host as part of QMI exchange)
  11754. */
  11755. typedef enum {
  11756. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11757. } MLO_PEER_MAP_TLV_TAG_ID;
  11758. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11759. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11760. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11761. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11762. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11763. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11764. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11765. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11766. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11767. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11768. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11769. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11770. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11771. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11772. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11773. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11774. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11775. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11776. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11777. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11778. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11779. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11780. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11781. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11782. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11783. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11784. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11785. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11786. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11787. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11788. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11789. do { \
  11790. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11791. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11792. } while (0)
  11793. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11794. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11795. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11796. do { \
  11797. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11798. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11799. } while (0)
  11800. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11801. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11802. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11803. do { \
  11804. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11805. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11806. } while (0)
  11807. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11808. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11809. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11810. do { \
  11811. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11812. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11813. } while (0)
  11814. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11815. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11816. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11817. do { \
  11818. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11819. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11820. } while (0)
  11821. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11822. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11823. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11824. do { \
  11825. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11826. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11827. } while (0)
  11828. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11829. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11830. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11831. do { \
  11832. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11833. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11834. } while (0)
  11835. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11836. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11837. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11838. do { \
  11839. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11840. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11841. } while (0)
  11842. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11843. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11844. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11845. do { \
  11846. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11847. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11848. } while (0)
  11849. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11850. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11851. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11852. do { \
  11853. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11854. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11855. } while (0)
  11856. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11857. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11858. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11859. do { \
  11860. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11861. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11862. } while (0)
  11863. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11864. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11865. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11866. do { \
  11867. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11868. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11869. } while (0)
  11870. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11871. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11872. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11873. do { \
  11874. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11875. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11876. } while (0)
  11877. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11878. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11879. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11880. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11881. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11882. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11883. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11884. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11885. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11886. *
  11887. * The following diagram shows the format of the rx mlo peer unmap message sent
  11888. * from the target to the host.
  11889. *
  11890. * |31 24|23 16|15 8|7 0|
  11891. * |-----------------------------------------------------------------------|
  11892. * | RSVD_24_31 | MLO peer ID | msg type |
  11893. * |-----------------------------------------------------------------------|
  11894. */
  11895. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11896. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11897. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11898. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11899. /**
  11900. * @brief target -> host message specifying security parameters
  11901. *
  11902. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11903. *
  11904. * @details
  11905. * The following diagram shows the format of the security specification
  11906. * message sent from the target to the host.
  11907. * This security specification message tells the host whether a PN check is
  11908. * necessary on rx data frames, and if so, how large the PN counter is.
  11909. * This message also tells the host about the security processing to apply
  11910. * to defragmented rx frames - specifically, whether a Message Integrity
  11911. * Check is required, and the Michael key to use.
  11912. *
  11913. * |31 24|23 16|15|14 8|7 0|
  11914. * |-----------------------------------------------------------------------|
  11915. * | peer ID | U| security type | msg type |
  11916. * |-----------------------------------------------------------------------|
  11917. * | Michael Key K0 |
  11918. * |-----------------------------------------------------------------------|
  11919. * | Michael Key K1 |
  11920. * |-----------------------------------------------------------------------|
  11921. * | WAPI RSC Low0 |
  11922. * |-----------------------------------------------------------------------|
  11923. * | WAPI RSC Low1 |
  11924. * |-----------------------------------------------------------------------|
  11925. * | WAPI RSC Hi0 |
  11926. * |-----------------------------------------------------------------------|
  11927. * | WAPI RSC Hi1 |
  11928. * |-----------------------------------------------------------------------|
  11929. *
  11930. * The following field definitions describe the format of the security
  11931. * indication message sent from the target to the host.
  11932. * - MSG_TYPE
  11933. * Bits 7:0
  11934. * Purpose: identifies this as a security specification message
  11935. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11936. * - SEC_TYPE
  11937. * Bits 14:8
  11938. * Purpose: specifies which type of security applies to the peer
  11939. * Value: htt_sec_type enum value
  11940. * - UNICAST
  11941. * Bit 15
  11942. * Purpose: whether this security is applied to unicast or multicast data
  11943. * Value: 1 -> unicast, 0 -> multicast
  11944. * - PEER_ID
  11945. * Bits 31:16
  11946. * Purpose: The ID number for the peer the security specification is for
  11947. * Value: peer ID
  11948. * - MICHAEL_KEY_K0
  11949. * Bits 31:0
  11950. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11951. * Value: Michael Key K0 (if security type is TKIP)
  11952. * - MICHAEL_KEY_K1
  11953. * Bits 31:0
  11954. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11955. * Value: Michael Key K1 (if security type is TKIP)
  11956. * - WAPI_RSC_LOW0
  11957. * Bits 31:0
  11958. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11959. * Value: WAPI RSC Low0 (if security type is WAPI)
  11960. * - WAPI_RSC_LOW1
  11961. * Bits 31:0
  11962. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11963. * Value: WAPI RSC Low1 (if security type is WAPI)
  11964. * - WAPI_RSC_HI0
  11965. * Bits 31:0
  11966. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11967. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11968. * - WAPI_RSC_HI1
  11969. * Bits 31:0
  11970. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11971. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11972. */
  11973. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11974. #define HTT_SEC_IND_SEC_TYPE_S 8
  11975. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11976. #define HTT_SEC_IND_UNICAST_S 15
  11977. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11978. #define HTT_SEC_IND_PEER_ID_S 16
  11979. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11980. do { \
  11981. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11982. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11983. } while (0)
  11984. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11985. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11986. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11987. do { \
  11988. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11989. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11990. } while (0)
  11991. #define HTT_SEC_IND_UNICAST_GET(word) \
  11992. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11993. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11994. do { \
  11995. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11996. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11997. } while (0)
  11998. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11999. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12000. #define HTT_SEC_IND_BYTES 28
  12001. /**
  12002. * @brief target -> host rx ADDBA / DELBA message definitions
  12003. *
  12004. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12005. *
  12006. * @details
  12007. * The following diagram shows the format of the rx ADDBA message sent
  12008. * from the target to the host:
  12009. *
  12010. * |31 20|19 16|15 8|7 0|
  12011. * |---------------------------------------------------------------------|
  12012. * | peer ID | TID | window size | msg type |
  12013. * |---------------------------------------------------------------------|
  12014. *
  12015. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12016. *
  12017. * The following diagram shows the format of the rx DELBA message sent
  12018. * from the target to the host:
  12019. *
  12020. * |31 20|19 16|15 10|9 8|7 0|
  12021. * |---------------------------------------------------------------------|
  12022. * | peer ID | TID | window size | IR| msg type |
  12023. * |---------------------------------------------------------------------|
  12024. *
  12025. * The following field definitions describe the format of the rx ADDBA
  12026. * and DELBA messages sent from the target to the host.
  12027. * - MSG_TYPE
  12028. * Bits 7:0
  12029. * Purpose: identifies this as an rx ADDBA or DELBA message
  12030. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12031. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12032. * - IR (initiator / recipient)
  12033. * Bits 9:8 (DELBA only)
  12034. * Purpose: specify whether the DELBA handshake was initiated by the
  12035. * local STA/AP, or by the peer STA/AP
  12036. * Value:
  12037. * 0 - unspecified
  12038. * 1 - initiator (a.k.a. originator)
  12039. * 2 - recipient (a.k.a. responder)
  12040. * 3 - unused / reserved
  12041. * - WIN_SIZE
  12042. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12043. * Purpose: Specifies the length of the block ack window (max = 64).
  12044. * Value:
  12045. * block ack window length specified by the received ADDBA/DELBA
  12046. * management message.
  12047. * - TID
  12048. * Bits 19:16
  12049. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12050. * Value:
  12051. * TID specified by the received ADDBA or DELBA management message.
  12052. * - PEER_ID
  12053. * Bits 31:20
  12054. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12055. * Value:
  12056. * ID (hash value) used by the host for fast, direct lookup of
  12057. * host SW peer info, including rx reorder states.
  12058. */
  12059. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12060. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12061. #define HTT_RX_ADDBA_TID_M 0xf0000
  12062. #define HTT_RX_ADDBA_TID_S 16
  12063. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12064. #define HTT_RX_ADDBA_PEER_ID_S 20
  12065. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12066. do { \
  12067. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12068. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12069. } while (0)
  12070. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12071. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12072. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12073. do { \
  12074. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12075. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12076. } while (0)
  12077. #define HTT_RX_ADDBA_TID_GET(word) \
  12078. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12079. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12080. do { \
  12081. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12082. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12083. } while (0)
  12084. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12085. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12086. #define HTT_RX_ADDBA_BYTES 4
  12087. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12088. #define HTT_RX_DELBA_INITIATOR_S 8
  12089. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12090. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12091. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12092. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12093. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12094. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12095. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12096. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12097. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12098. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12099. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12100. do { \
  12101. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12102. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12103. } while (0)
  12104. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12105. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12106. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12107. do { \
  12108. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12109. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12110. } while (0)
  12111. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12112. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12113. #define HTT_RX_DELBA_BYTES 4
  12114. /**
  12115. * @brief tx queue group information element definition
  12116. *
  12117. * @details
  12118. * The following diagram shows the format of the tx queue group
  12119. * information element, which can be included in target --> host
  12120. * messages to specify the number of tx "credits" (tx descriptors
  12121. * for LL, or tx buffers for HL) available to a particular group
  12122. * of host-side tx queues, and which host-side tx queues belong to
  12123. * the group.
  12124. *
  12125. * |31|30 24|23 16|15|14|13 0|
  12126. * |------------------------------------------------------------------------|
  12127. * | X| reserved | tx queue grp ID | A| S| credit count |
  12128. * |------------------------------------------------------------------------|
  12129. * | vdev ID mask | AC mask |
  12130. * |------------------------------------------------------------------------|
  12131. *
  12132. * The following definitions describe the fields within the tx queue group
  12133. * information element:
  12134. * - credit_count
  12135. * Bits 13:1
  12136. * Purpose: specify how many tx credits are available to the tx queue group
  12137. * Value: An absolute or relative, positive or negative credit value
  12138. * The 'A' bit specifies whether the value is absolute or relative.
  12139. * The 'S' bit specifies whether the value is positive or negative.
  12140. * A negative value can only be relative, not absolute.
  12141. * An absolute value replaces any prior credit value the host has for
  12142. * the tx queue group in question.
  12143. * A relative value is added to the prior credit value the host has for
  12144. * the tx queue group in question.
  12145. * - sign
  12146. * Bit 14
  12147. * Purpose: specify whether the credit count is positive or negative
  12148. * Value: 0 -> positive, 1 -> negative
  12149. * - absolute
  12150. * Bit 15
  12151. * Purpose: specify whether the credit count is absolute or relative
  12152. * Value: 0 -> relative, 1 -> absolute
  12153. * - txq_group_id
  12154. * Bits 23:16
  12155. * Purpose: indicate which tx queue group's credit and/or membership are
  12156. * being specified
  12157. * Value: 0 to max_tx_queue_groups-1
  12158. * - reserved
  12159. * Bits 30:16
  12160. * Value: 0x0
  12161. * - eXtension
  12162. * Bit 31
  12163. * Purpose: specify whether another tx queue group info element follows
  12164. * Value: 0 -> no more tx queue group information elements
  12165. * 1 -> another tx queue group information element immediately follows
  12166. * - ac_mask
  12167. * Bits 15:0
  12168. * Purpose: specify which Access Categories belong to the tx queue group
  12169. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12170. * the tx queue group.
  12171. * The AC bit-mask values are obtained by left-shifting by the
  12172. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12173. * - vdev_id_mask
  12174. * Bits 31:16
  12175. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12176. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12177. * belong to the tx queue group.
  12178. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12179. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12180. */
  12181. PREPACK struct htt_txq_group {
  12182. A_UINT32
  12183. credit_count: 14,
  12184. sign: 1,
  12185. absolute: 1,
  12186. tx_queue_group_id: 8,
  12187. reserved0: 7,
  12188. extension: 1;
  12189. A_UINT32
  12190. ac_mask: 16,
  12191. vdev_id_mask: 16;
  12192. } POSTPACK;
  12193. /* first word */
  12194. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12195. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12196. #define HTT_TXQ_GROUP_SIGN_S 14
  12197. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12198. #define HTT_TXQ_GROUP_ABS_S 15
  12199. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12200. #define HTT_TXQ_GROUP_ID_S 16
  12201. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12202. #define HTT_TXQ_GROUP_EXT_S 31
  12203. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12204. /* second word */
  12205. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12206. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12207. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12208. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12209. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12210. do { \
  12211. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12212. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12213. } while (0)
  12214. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12215. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12216. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12217. do { \
  12218. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12219. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12220. } while (0)
  12221. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12222. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12223. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12224. do { \
  12225. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12226. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12227. } while (0)
  12228. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12229. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12230. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12231. do { \
  12232. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12233. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12234. } while (0)
  12235. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12236. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12237. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12238. do { \
  12239. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12240. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12241. } while (0)
  12242. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12243. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12244. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12245. do { \
  12246. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12247. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12248. } while (0)
  12249. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12250. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12251. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12252. do { \
  12253. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12254. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12255. } while (0)
  12256. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12257. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12258. /**
  12259. * @brief target -> host TX completion indication message definition
  12260. *
  12261. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12262. *
  12263. * @details
  12264. * The following diagram shows the format of the TX completion indication sent
  12265. * from the target to the host
  12266. *
  12267. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12268. * |-------------------------------------------------------------------|
  12269. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12270. * |-------------------------------------------------------------------|
  12271. * payload:| MSDU1 ID | MSDU0 ID |
  12272. * |-------------------------------------------------------------------|
  12273. * : MSDU3 ID | MSDU2 ID :
  12274. * |-------------------------------------------------------------------|
  12275. * | struct htt_tx_compl_ind_append_retries |
  12276. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12277. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12278. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12279. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12280. * |-------------------------------------------------------------------|
  12281. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12282. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12283. * | MSDU0 tx_tsf64_low |
  12284. * |-------------------------------------------------------------------|
  12285. * | MSDU0 tx_tsf64_high |
  12286. * |-------------------------------------------------------------------|
  12287. * | MSDU1 tx_tsf64_low |
  12288. * |-------------------------------------------------------------------|
  12289. * | MSDU1 tx_tsf64_high |
  12290. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12291. * | phy_timestamp |
  12292. * |-------------------------------------------------------------------|
  12293. * | rate specs (see below) |
  12294. * |-------------------------------------------------------------------|
  12295. * | seqctrl | framectrl |
  12296. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12297. * Where:
  12298. * A0 = append (a.k.a. append0)
  12299. * A1 = append1
  12300. * TP = MSDU tx power presence
  12301. * A2 = append2
  12302. * A3 = append3
  12303. * A4 = append4
  12304. *
  12305. * The following field definitions describe the format of the TX completion
  12306. * indication sent from the target to the host
  12307. * Header fields:
  12308. * - msg_type
  12309. * Bits 7:0
  12310. * Purpose: identifies this as HTT TX completion indication
  12311. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12312. * - status
  12313. * Bits 10:8
  12314. * Purpose: the TX completion status of payload fragmentations descriptors
  12315. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12316. * - tid
  12317. * Bits 14:11
  12318. * Purpose: the tid associated with those fragmentation descriptors. It is
  12319. * valid or not, depending on the tid_invalid bit.
  12320. * Value: 0 to 15
  12321. * - tid_invalid
  12322. * Bits 15:15
  12323. * Purpose: this bit indicates whether the tid field is valid or not
  12324. * Value: 0 indicates valid; 1 indicates invalid
  12325. * - num
  12326. * Bits 23:16
  12327. * Purpose: the number of payload in this indication
  12328. * Value: 1 to 255
  12329. * - append (a.k.a. append0)
  12330. * Bits 24:24
  12331. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12332. * the number of tx retries for one MSDU at the end of this message
  12333. * Value: 0 indicates no appending; 1 indicates appending
  12334. * - append1
  12335. * Bits 25:25
  12336. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12337. * contains the timestamp info for each TX msdu id in payload.
  12338. * The order of the timestamps matches the order of the MSDU IDs.
  12339. * Note that a big-endian host needs to account for the reordering
  12340. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12341. * conversion) when determining which tx timestamp corresponds to
  12342. * which MSDU ID.
  12343. * Value: 0 indicates no appending; 1 indicates appending
  12344. * - msdu_tx_power_presence
  12345. * Bits 26:26
  12346. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12347. * for each MSDU referenced by the TX_COMPL_IND message.
  12348. * The tx power is reported in 0.5 dBm units.
  12349. * The order of the per-MSDU tx power reports matches the order
  12350. * of the MSDU IDs.
  12351. * Note that a big-endian host needs to account for the reordering
  12352. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12353. * conversion) when determining which Tx Power corresponds to
  12354. * which MSDU ID.
  12355. * Value: 0 indicates MSDU tx power reports are not appended,
  12356. * 1 indicates MSDU tx power reports are appended
  12357. * - append2
  12358. * Bits 27:27
  12359. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12360. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12361. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12362. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12363. * for each MSDU, for convenience.
  12364. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12365. * this append2 bit is set).
  12366. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12367. * dB above the noise floor.
  12368. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12369. * 1 indicates MSDU ACK RSSI values are appended.
  12370. * - append3
  12371. * Bits 28:28
  12372. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12373. * contains the tx tsf info based on wlan global TSF for
  12374. * each TX msdu id in payload.
  12375. * The order of the tx tsf matches the order of the MSDU IDs.
  12376. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12377. * values to indicate the the lower 32 bits and higher 32 bits of
  12378. * the tx tsf.
  12379. * The tx_tsf64 here represents the time MSDU was acked and the
  12380. * tx_tsf64 has microseconds units.
  12381. * Value: 0 indicates no appending; 1 indicates appending
  12382. * - append4
  12383. * Bits 29:29
  12384. * Purpose: Indicate whether data frame control fields and fields required
  12385. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12386. * message. The order of the this message matches the order of
  12387. * the MSDU IDs.
  12388. * Value: 0 indicates frame control fields and fields required for
  12389. * radio tap header values are not appended,
  12390. * 1 indicates frame control fields and fields required for
  12391. * radio tap header values are appended.
  12392. * Payload fields:
  12393. * - hmsdu_id
  12394. * Bits 15:0
  12395. * Purpose: this ID is used to track the Tx buffer in host
  12396. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12397. */
  12398. PREPACK struct htt_tx_data_hdr_information {
  12399. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12400. A_UINT32 /* word 1 */
  12401. /* preamble:
  12402. * 0-OFDM,
  12403. * 1-CCk,
  12404. * 2-HT,
  12405. * 3-VHT
  12406. */
  12407. preamble: 2, /* [1:0] */
  12408. /* mcs:
  12409. * In case of HT preamble interpret
  12410. * MCS along with NSS.
  12411. * Valid values for HT are 0 to 7.
  12412. * HT mcs 0 with NSS 2 is mcs 8.
  12413. * Valid values for VHT are 0 to 9.
  12414. */
  12415. mcs: 4, /* [5:2] */
  12416. /* rate:
  12417. * This is applicable only for
  12418. * CCK and OFDM preamble type
  12419. * rate 0: OFDM 48 Mbps,
  12420. * 1: OFDM 24 Mbps,
  12421. * 2: OFDM 12 Mbps
  12422. * 3: OFDM 6 Mbps
  12423. * 4: OFDM 54 Mbps
  12424. * 5: OFDM 36 Mbps
  12425. * 6: OFDM 18 Mbps
  12426. * 7: OFDM 9 Mbps
  12427. * rate 0: CCK 11 Mbps Long
  12428. * 1: CCK 5.5 Mbps Long
  12429. * 2: CCK 2 Mbps Long
  12430. * 3: CCK 1 Mbps Long
  12431. * 4: CCK 11 Mbps Short
  12432. * 5: CCK 5.5 Mbps Short
  12433. * 6: CCK 2 Mbps Short
  12434. */
  12435. rate : 3, /* [ 8: 6] */
  12436. rssi : 8, /* [16: 9] units=dBm */
  12437. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12438. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12439. stbc : 1, /* [22] */
  12440. sgi : 1, /* [23] */
  12441. ldpc : 1, /* [24] */
  12442. beamformed: 1, /* [25] */
  12443. /* tx_retry_cnt:
  12444. * Indicates retry count of data tx frames provided by the host.
  12445. */
  12446. tx_retry_cnt: 6; /* [31:26] */
  12447. A_UINT32 /* word 2 */
  12448. framectrl:16, /* [15: 0] */
  12449. seqno:16; /* [31:16] */
  12450. } POSTPACK;
  12451. #define HTT_TX_COMPL_IND_STATUS_S 8
  12452. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12453. #define HTT_TX_COMPL_IND_TID_S 11
  12454. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12455. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12456. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12457. #define HTT_TX_COMPL_IND_NUM_S 16
  12458. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12459. #define HTT_TX_COMPL_IND_APPEND_S 24
  12460. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12461. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12462. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12463. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12464. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12465. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12466. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12467. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12468. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12469. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12470. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12471. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12472. do { \
  12473. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12474. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12475. } while (0)
  12476. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12477. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12478. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12479. do { \
  12480. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12481. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12482. } while (0)
  12483. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12484. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12485. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12486. do { \
  12487. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12488. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12489. } while (0)
  12490. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12491. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12492. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12493. do { \
  12494. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12495. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12496. } while (0)
  12497. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12498. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12499. HTT_TX_COMPL_IND_TID_INV_S)
  12500. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12501. do { \
  12502. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12503. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12504. } while (0)
  12505. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12506. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12507. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12508. do { \
  12509. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12510. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12511. } while (0)
  12512. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12513. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12514. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12515. do { \
  12516. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12517. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12518. } while (0)
  12519. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12520. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12521. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12522. do { \
  12523. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12524. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12525. } while (0)
  12526. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12527. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12528. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12529. do { \
  12530. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12531. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12532. } while (0)
  12533. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12534. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12535. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12536. do { \
  12537. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12538. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12539. } while (0)
  12540. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12541. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12542. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12543. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12544. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12545. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12546. #define HTT_TX_COMPL_IND_STAT_OK 0
  12547. /* DISCARD:
  12548. * current meaning:
  12549. * MSDUs were queued for transmission but filtered by HW or SW
  12550. * without any over the air attempts
  12551. * legacy meaning (HL Rome):
  12552. * MSDUs were discarded by the target FW without any over the air
  12553. * attempts due to lack of space
  12554. */
  12555. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12556. /* NO_ACK:
  12557. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12558. */
  12559. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12560. /* POSTPONE:
  12561. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12562. * be downloaded again later (in the appropriate order), when they are
  12563. * deliverable.
  12564. */
  12565. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12566. /*
  12567. * The PEER_DEL tx completion status is used for HL cases
  12568. * where the peer the frame is for has been deleted.
  12569. * The host has already discarded its copy of the frame, but
  12570. * it still needs the tx completion to restore its credit.
  12571. */
  12572. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12573. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12574. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12575. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12576. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12577. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12578. PREPACK struct htt_tx_compl_ind_base {
  12579. A_UINT32 hdr;
  12580. A_UINT16 payload[1/*or more*/];
  12581. } POSTPACK;
  12582. PREPACK struct htt_tx_compl_ind_append_retries {
  12583. A_UINT16 msdu_id;
  12584. A_UINT8 tx_retries;
  12585. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12586. 0: this is the last append_retries struct */
  12587. } POSTPACK;
  12588. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12589. A_UINT32 timestamp[1/*or more*/];
  12590. } POSTPACK;
  12591. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12592. A_UINT32 tx_tsf64_low;
  12593. A_UINT32 tx_tsf64_high;
  12594. } POSTPACK;
  12595. /* htt_tx_data_hdr_information payload extension fields: */
  12596. /* DWORD zero */
  12597. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12598. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12599. /* DWORD one */
  12600. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12601. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12602. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12603. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12604. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12605. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12606. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12607. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12608. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12609. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12610. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12611. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12612. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12613. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12614. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12615. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12616. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12617. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12618. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12619. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12620. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12621. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12622. /* DWORD two */
  12623. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12624. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12625. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12626. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12627. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12628. do { \
  12629. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12630. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12631. } while (0)
  12632. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12633. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12634. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12635. do { \
  12636. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12637. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12638. } while (0)
  12639. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12640. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12641. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12642. do { \
  12643. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12644. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12645. } while (0)
  12646. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12647. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12648. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12649. do { \
  12650. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12651. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12652. } while (0)
  12653. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12654. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12655. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12656. do { \
  12657. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12658. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12659. } while (0)
  12660. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12661. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12662. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12663. do { \
  12664. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12665. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12666. } while (0)
  12667. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12668. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12669. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12670. do { \
  12671. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12672. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12673. } while (0)
  12674. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12675. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12676. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12677. do { \
  12678. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12679. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12680. } while (0)
  12681. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12682. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12683. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12684. do { \
  12685. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12686. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12687. } while (0)
  12688. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12689. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12690. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12691. do { \
  12692. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12693. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12694. } while (0)
  12695. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12696. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12697. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12698. do { \
  12699. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12700. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12701. } while (0)
  12702. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12703. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12704. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12705. do { \
  12706. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12707. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12708. } while (0)
  12709. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12710. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12711. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12712. do { \
  12713. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12714. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12715. } while (0)
  12716. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12717. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12718. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12719. do { \
  12720. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12721. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12722. } while (0)
  12723. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12724. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12725. /**
  12726. * @brief target -> host rate-control update indication message
  12727. *
  12728. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12729. *
  12730. * @details
  12731. * The following diagram shows the format of the RC Update message
  12732. * sent from the target to the host, while processing the tx-completion
  12733. * of a transmitted PPDU.
  12734. *
  12735. * |31 24|23 16|15 8|7 0|
  12736. * |-------------------------------------------------------------|
  12737. * | peer ID | vdev ID | msg_type |
  12738. * |-------------------------------------------------------------|
  12739. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12740. * |-------------------------------------------------------------|
  12741. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12742. * |-------------------------------------------------------------|
  12743. * | : |
  12744. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12745. * | : |
  12746. * |-------------------------------------------------------------|
  12747. * | : |
  12748. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12749. * | : |
  12750. * |-------------------------------------------------------------|
  12751. * : :
  12752. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12753. *
  12754. */
  12755. typedef struct {
  12756. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12757. A_UINT32 rate_code_flags;
  12758. A_UINT32 flags; /* Encodes information such as excessive
  12759. retransmission, aggregate, some info
  12760. from .11 frame control,
  12761. STBC, LDPC, (SGI and Tx Chain Mask
  12762. are encoded in ptx_rc->flags field),
  12763. AMPDU truncation (BT/time based etc.),
  12764. RTS/CTS attempt */
  12765. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12766. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12767. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12768. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12769. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12770. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12771. } HTT_RC_TX_DONE_PARAMS;
  12772. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12773. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12774. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12775. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12776. #define HTT_RC_UPDATE_VDEVID_S 8
  12777. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12778. #define HTT_RC_UPDATE_PEERID_S 16
  12779. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12780. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12781. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12782. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12783. do { \
  12784. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12785. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12786. } while (0)
  12787. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12788. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12789. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12790. do { \
  12791. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12792. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12793. } while (0)
  12794. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12795. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12796. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12797. do { \
  12798. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12799. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12800. } while (0)
  12801. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12802. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12803. /**
  12804. * @brief target -> host rx fragment indication message definition
  12805. *
  12806. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12807. *
  12808. * @details
  12809. * The following field definitions describe the format of the rx fragment
  12810. * indication message sent from the target to the host.
  12811. * The rx fragment indication message shares the format of the
  12812. * rx indication message, but not all fields from the rx indication message
  12813. * are relevant to the rx fragment indication message.
  12814. *
  12815. *
  12816. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12817. * |-----------+-------------------+---------------------+-------------|
  12818. * | peer ID | |FV| ext TID | msg type |
  12819. * |-------------------------------------------------------------------|
  12820. * | | flush | flush |
  12821. * | | end | start |
  12822. * | | seq num | seq num |
  12823. * |-------------------------------------------------------------------|
  12824. * | reserved | FW rx desc bytes |
  12825. * |-------------------------------------------------------------------|
  12826. * | | FW MSDU Rx |
  12827. * | | desc B0 |
  12828. * |-------------------------------------------------------------------|
  12829. * Header fields:
  12830. * - MSG_TYPE
  12831. * Bits 7:0
  12832. * Purpose: identifies this as an rx fragment indication message
  12833. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12834. * - EXT_TID
  12835. * Bits 12:8
  12836. * Purpose: identify the traffic ID of the rx data, including
  12837. * special "extended" TID values for multicast, broadcast, and
  12838. * non-QoS data frames
  12839. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12840. * - FLUSH_VALID (FV)
  12841. * Bit 13
  12842. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12843. * is valid
  12844. * Value:
  12845. * 1 -> flush IE is valid and needs to be processed
  12846. * 0 -> flush IE is not valid and should be ignored
  12847. * - PEER_ID
  12848. * Bits 31:16
  12849. * Purpose: Identify, by ID, which peer sent the rx data
  12850. * Value: ID of the peer who sent the rx data
  12851. * - FLUSH_SEQ_NUM_START
  12852. * Bits 5:0
  12853. * Purpose: Indicate the start of a series of MPDUs to flush
  12854. * Not all MPDUs within this series are necessarily valid - the host
  12855. * must check each sequence number within this range to see if the
  12856. * corresponding MPDU is actually present.
  12857. * This field is only valid if the FV bit is set.
  12858. * Value:
  12859. * The sequence number for the first MPDUs to check to flush.
  12860. * The sequence number is masked by 0x3f.
  12861. * - FLUSH_SEQ_NUM_END
  12862. * Bits 11:6
  12863. * Purpose: Indicate the end of a series of MPDUs to flush
  12864. * Value:
  12865. * The sequence number one larger than the sequence number of the
  12866. * last MPDU to check to flush.
  12867. * The sequence number is masked by 0x3f.
  12868. * Not all MPDUs within this series are necessarily valid - the host
  12869. * must check each sequence number within this range to see if the
  12870. * corresponding MPDU is actually present.
  12871. * This field is only valid if the FV bit is set.
  12872. * Rx descriptor fields:
  12873. * - FW_RX_DESC_BYTES
  12874. * Bits 15:0
  12875. * Purpose: Indicate how many bytes in the Rx indication are used for
  12876. * FW Rx descriptors
  12877. * Value: 1
  12878. */
  12879. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12880. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12881. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12882. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12883. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12884. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12885. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12886. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12887. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12888. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12889. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12890. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12891. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12892. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12893. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12894. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12895. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12896. #define HTT_RX_FRAG_IND_BYTES \
  12897. (4 /* msg hdr */ + \
  12898. 4 /* flush spec */ + \
  12899. 4 /* (unused) FW rx desc bytes spec */ + \
  12900. 4 /* FW rx desc */)
  12901. /**
  12902. * @brief target -> host test message definition
  12903. *
  12904. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12905. *
  12906. * @details
  12907. * The following field definitions describe the format of the test
  12908. * message sent from the target to the host.
  12909. * The message consists of a 4-octet header, followed by a variable
  12910. * number of 32-bit integer values, followed by a variable number
  12911. * of 8-bit character values.
  12912. *
  12913. * |31 16|15 8|7 0|
  12914. * |-----------------------------------------------------------|
  12915. * | num chars | num ints | msg type |
  12916. * |-----------------------------------------------------------|
  12917. * | int 0 |
  12918. * |-----------------------------------------------------------|
  12919. * | int 1 |
  12920. * |-----------------------------------------------------------|
  12921. * | ... |
  12922. * |-----------------------------------------------------------|
  12923. * | char 3 | char 2 | char 1 | char 0 |
  12924. * |-----------------------------------------------------------|
  12925. * | | | ... | char 4 |
  12926. * |-----------------------------------------------------------|
  12927. * - MSG_TYPE
  12928. * Bits 7:0
  12929. * Purpose: identifies this as a test message
  12930. * Value: HTT_MSG_TYPE_TEST
  12931. * - NUM_INTS
  12932. * Bits 15:8
  12933. * Purpose: indicate how many 32-bit integers follow the message header
  12934. * - NUM_CHARS
  12935. * Bits 31:16
  12936. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12937. */
  12938. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12939. #define HTT_RX_TEST_NUM_INTS_S 8
  12940. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12941. #define HTT_RX_TEST_NUM_CHARS_S 16
  12942. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12943. do { \
  12944. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12945. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12946. } while (0)
  12947. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12948. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12949. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12950. do { \
  12951. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12952. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12953. } while (0)
  12954. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12955. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12956. /**
  12957. * @brief target -> host packet log message
  12958. *
  12959. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12960. *
  12961. * @details
  12962. * The following field definitions describe the format of the packet log
  12963. * message sent from the target to the host.
  12964. * The message consists of a 4-octet header,followed by a variable number
  12965. * of 32-bit character values.
  12966. *
  12967. * |31 16|15 12|11 10|9 8|7 0|
  12968. * |------------------------------------------------------------------|
  12969. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12970. * |------------------------------------------------------------------|
  12971. * | payload |
  12972. * |------------------------------------------------------------------|
  12973. * - MSG_TYPE
  12974. * Bits 7:0
  12975. * Purpose: identifies this as a pktlog message
  12976. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12977. * - mac_id
  12978. * Bits 9:8
  12979. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12980. * Value: 0-3
  12981. * - pdev_id
  12982. * Bits 11:10
  12983. * Purpose: pdev_id
  12984. * Value: 0-3
  12985. * 0 (for rings at SOC level),
  12986. * 1/2/3 PDEV -> 0/1/2
  12987. * - payload_size
  12988. * Bits 31:16
  12989. * Purpose: explicitly specify the payload size
  12990. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12991. */
  12992. PREPACK struct htt_pktlog_msg {
  12993. A_UINT32 header;
  12994. A_UINT32 payload[1/* or more */];
  12995. } POSTPACK;
  12996. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12997. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12998. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12999. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13000. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13001. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13002. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13003. do { \
  13004. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13005. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13006. } while (0)
  13007. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13008. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13009. HTT_T2H_PKTLOG_MAC_ID_S)
  13010. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13011. do { \
  13012. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13013. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13014. } while (0)
  13015. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13016. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13017. HTT_T2H_PKTLOG_PDEV_ID_S)
  13018. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13019. do { \
  13020. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13021. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13022. } while (0)
  13023. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13024. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13025. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13026. /*
  13027. * Rx reorder statistics
  13028. * NB: all the fields must be defined in 4 octets size.
  13029. */
  13030. struct rx_reorder_stats {
  13031. /* Non QoS MPDUs received */
  13032. A_UINT32 deliver_non_qos;
  13033. /* MPDUs received in-order */
  13034. A_UINT32 deliver_in_order;
  13035. /* Flush due to reorder timer expired */
  13036. A_UINT32 deliver_flush_timeout;
  13037. /* Flush due to move out of window */
  13038. A_UINT32 deliver_flush_oow;
  13039. /* Flush due to DELBA */
  13040. A_UINT32 deliver_flush_delba;
  13041. /* MPDUs dropped due to FCS error */
  13042. A_UINT32 fcs_error;
  13043. /* MPDUs dropped due to monitor mode non-data packet */
  13044. A_UINT32 mgmt_ctrl;
  13045. /* Unicast-data MPDUs dropped due to invalid peer */
  13046. A_UINT32 invalid_peer;
  13047. /* MPDUs dropped due to duplication (non aggregation) */
  13048. A_UINT32 dup_non_aggr;
  13049. /* MPDUs dropped due to processed before */
  13050. A_UINT32 dup_past;
  13051. /* MPDUs dropped due to duplicate in reorder queue */
  13052. A_UINT32 dup_in_reorder;
  13053. /* Reorder timeout happened */
  13054. A_UINT32 reorder_timeout;
  13055. /* invalid bar ssn */
  13056. A_UINT32 invalid_bar_ssn;
  13057. /* reorder reset due to bar ssn */
  13058. A_UINT32 ssn_reset;
  13059. /* Flush due to delete peer */
  13060. A_UINT32 deliver_flush_delpeer;
  13061. /* Flush due to offload*/
  13062. A_UINT32 deliver_flush_offload;
  13063. /* Flush due to out of buffer*/
  13064. A_UINT32 deliver_flush_oob;
  13065. /* MPDUs dropped due to PN check fail */
  13066. A_UINT32 pn_fail;
  13067. /* MPDUs dropped due to unable to allocate memory */
  13068. A_UINT32 store_fail;
  13069. /* Number of times the tid pool alloc succeeded */
  13070. A_UINT32 tid_pool_alloc_succ;
  13071. /* Number of times the MPDU pool alloc succeeded */
  13072. A_UINT32 mpdu_pool_alloc_succ;
  13073. /* Number of times the MSDU pool alloc succeeded */
  13074. A_UINT32 msdu_pool_alloc_succ;
  13075. /* Number of times the tid pool alloc failed */
  13076. A_UINT32 tid_pool_alloc_fail;
  13077. /* Number of times the MPDU pool alloc failed */
  13078. A_UINT32 mpdu_pool_alloc_fail;
  13079. /* Number of times the MSDU pool alloc failed */
  13080. A_UINT32 msdu_pool_alloc_fail;
  13081. /* Number of times the tid pool freed */
  13082. A_UINT32 tid_pool_free;
  13083. /* Number of times the MPDU pool freed */
  13084. A_UINT32 mpdu_pool_free;
  13085. /* Number of times the MSDU pool freed */
  13086. A_UINT32 msdu_pool_free;
  13087. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13088. A_UINT32 msdu_queued;
  13089. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13090. A_UINT32 msdu_recycled;
  13091. /* Number of MPDUs with invalid peer but A2 found in AST */
  13092. A_UINT32 invalid_peer_a2_in_ast;
  13093. /* Number of MPDUs with invalid peer but A3 found in AST */
  13094. A_UINT32 invalid_peer_a3_in_ast;
  13095. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13096. A_UINT32 invalid_peer_bmc_mpdus;
  13097. /* Number of MSDUs with err attention word */
  13098. A_UINT32 rxdesc_err_att;
  13099. /* Number of MSDUs with flag of peer_idx_invalid */
  13100. A_UINT32 rxdesc_err_peer_idx_inv;
  13101. /* Number of MSDUs with flag of peer_idx_timeout */
  13102. A_UINT32 rxdesc_err_peer_idx_to;
  13103. /* Number of MSDUs with flag of overflow */
  13104. A_UINT32 rxdesc_err_ov;
  13105. /* Number of MSDUs with flag of msdu_length_err */
  13106. A_UINT32 rxdesc_err_msdu_len;
  13107. /* Number of MSDUs with flag of mpdu_length_err */
  13108. A_UINT32 rxdesc_err_mpdu_len;
  13109. /* Number of MSDUs with flag of tkip_mic_err */
  13110. A_UINT32 rxdesc_err_tkip_mic;
  13111. /* Number of MSDUs with flag of decrypt_err */
  13112. A_UINT32 rxdesc_err_decrypt;
  13113. /* Number of MSDUs with flag of fcs_err */
  13114. A_UINT32 rxdesc_err_fcs;
  13115. /* Number of Unicast (bc_mc bit is not set in attention word)
  13116. * frames with invalid peer handler
  13117. */
  13118. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13119. /* Number of unicast frame directly (direct bit is set in attention word)
  13120. * to DUT with invalid peer handler
  13121. */
  13122. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13123. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13124. * frames with invalid peer handler
  13125. */
  13126. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13127. /* Number of MSDUs dropped due to no first MSDU flag */
  13128. A_UINT32 rxdesc_no_1st_msdu;
  13129. /* Number of MSDUs droped due to ring overflow */
  13130. A_UINT32 msdu_drop_ring_ov;
  13131. /* Number of MSDUs dropped due to FC mismatch */
  13132. A_UINT32 msdu_drop_fc_mismatch;
  13133. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13134. A_UINT32 msdu_drop_mgmt_remote_ring;
  13135. /* Number of MSDUs dropped due to errors not reported in attention word */
  13136. A_UINT32 msdu_drop_misc;
  13137. /* Number of MSDUs go to offload before reorder */
  13138. A_UINT32 offload_msdu_wal;
  13139. /* Number of data frame dropped by offload after reorder */
  13140. A_UINT32 offload_msdu_reorder;
  13141. /* Number of MPDUs with sequence number in the past and within the BA window */
  13142. A_UINT32 dup_past_within_window;
  13143. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13144. A_UINT32 dup_past_outside_window;
  13145. /* Number of MSDUs with decrypt/MIC error */
  13146. A_UINT32 rxdesc_err_decrypt_mic;
  13147. /* Number of data MSDUs received on both local and remote rings */
  13148. A_UINT32 data_msdus_on_both_rings;
  13149. /* MPDUs never filled */
  13150. A_UINT32 holes_not_filled;
  13151. };
  13152. /*
  13153. * Rx Remote buffer statistics
  13154. * NB: all the fields must be defined in 4 octets size.
  13155. */
  13156. struct rx_remote_buffer_mgmt_stats {
  13157. /* Total number of MSDUs reaped for Rx processing */
  13158. A_UINT32 remote_reaped;
  13159. /* MSDUs recycled within firmware */
  13160. A_UINT32 remote_recycled;
  13161. /* MSDUs stored by Data Rx */
  13162. A_UINT32 data_rx_msdus_stored;
  13163. /* Number of HTT indications from WAL Rx MSDU */
  13164. A_UINT32 wal_rx_ind;
  13165. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13166. A_UINT32 wal_rx_ind_unconsumed;
  13167. /* Number of HTT indications from Data Rx MSDU */
  13168. A_UINT32 data_rx_ind;
  13169. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13170. A_UINT32 data_rx_ind_unconsumed;
  13171. /* Number of HTT indications from ATHBUF */
  13172. A_UINT32 athbuf_rx_ind;
  13173. /* Number of remote buffers requested for refill */
  13174. A_UINT32 refill_buf_req;
  13175. /* Number of remote buffers filled by the host */
  13176. A_UINT32 refill_buf_rsp;
  13177. /* Number of times MAC hw_index = f/w write_index */
  13178. A_INT32 mac_no_bufs;
  13179. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13180. A_INT32 fw_indices_equal;
  13181. /* Number of times f/w finds no buffers to post */
  13182. A_INT32 host_no_bufs;
  13183. };
  13184. /*
  13185. * TXBF MU/SU packets and NDPA statistics
  13186. * NB: all the fields must be defined in 4 octets size.
  13187. */
  13188. struct rx_txbf_musu_ndpa_pkts_stats {
  13189. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13190. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13191. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13192. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13193. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13194. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13195. };
  13196. /*
  13197. * htt_dbg_stats_status -
  13198. * present - The requested stats have been delivered in full.
  13199. * This indicates that either the stats information was contained
  13200. * in its entirety within this message, or else this message
  13201. * completes the delivery of the requested stats info that was
  13202. * partially delivered through earlier STATS_CONF messages.
  13203. * partial - The requested stats have been delivered in part.
  13204. * One or more subsequent STATS_CONF messages with the same
  13205. * cookie value will be sent to deliver the remainder of the
  13206. * information.
  13207. * error - The requested stats could not be delivered, for example due
  13208. * to a shortage of memory to construct a message holding the
  13209. * requested stats.
  13210. * invalid - The requested stat type is either not recognized, or the
  13211. * target is configured to not gather the stats type in question.
  13212. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13213. * series_done - This special value indicates that no further stats info
  13214. * elements are present within a series of stats info elems
  13215. * (within a stats upload confirmation message).
  13216. */
  13217. enum htt_dbg_stats_status {
  13218. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13219. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13220. HTT_DBG_STATS_STATUS_ERROR = 2,
  13221. HTT_DBG_STATS_STATUS_INVALID = 3,
  13222. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13223. };
  13224. /**
  13225. * @brief target -> host statistics upload
  13226. *
  13227. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13228. *
  13229. * @details
  13230. * The following field definitions describe the format of the HTT target
  13231. * to host stats upload confirmation message.
  13232. * The message contains a cookie echoed from the HTT host->target stats
  13233. * upload request, which identifies which request the confirmation is
  13234. * for, and a series of tag-length-value stats information elements.
  13235. * The tag-length header for each stats info element also includes a
  13236. * status field, to indicate whether the request for the stat type in
  13237. * question was fully met, partially met, unable to be met, or invalid
  13238. * (if the stat type in question is disabled in the target).
  13239. * A special value of all 1's in this status field is used to indicate
  13240. * the end of the series of stats info elements.
  13241. *
  13242. *
  13243. * |31 16|15 8|7 5|4 0|
  13244. * |------------------------------------------------------------|
  13245. * | reserved | msg type |
  13246. * |------------------------------------------------------------|
  13247. * | cookie LSBs |
  13248. * |------------------------------------------------------------|
  13249. * | cookie MSBs |
  13250. * |------------------------------------------------------------|
  13251. * | stats entry length | reserved | S |stat type|
  13252. * |------------------------------------------------------------|
  13253. * | |
  13254. * | type-specific stats info |
  13255. * | |
  13256. * |------------------------------------------------------------|
  13257. * | stats entry length | reserved | S |stat type|
  13258. * |------------------------------------------------------------|
  13259. * | |
  13260. * | type-specific stats info |
  13261. * | |
  13262. * |------------------------------------------------------------|
  13263. * | n/a | reserved | 111 | n/a |
  13264. * |------------------------------------------------------------|
  13265. * Header fields:
  13266. * - MSG_TYPE
  13267. * Bits 7:0
  13268. * Purpose: identifies this is a statistics upload confirmation message
  13269. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13270. * - COOKIE_LSBS
  13271. * Bits 31:0
  13272. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13273. * message with its preceding host->target stats request message.
  13274. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13275. * - COOKIE_MSBS
  13276. * Bits 31:0
  13277. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13278. * message with its preceding host->target stats request message.
  13279. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13280. *
  13281. * Stats Information Element tag-length header fields:
  13282. * - STAT_TYPE
  13283. * Bits 4:0
  13284. * Purpose: identifies the type of statistics info held in the
  13285. * following information element
  13286. * Value: htt_dbg_stats_type
  13287. * - STATUS
  13288. * Bits 7:5
  13289. * Purpose: indicate whether the requested stats are present
  13290. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13291. * the completion of the stats entry series
  13292. * - LENGTH
  13293. * Bits 31:16
  13294. * Purpose: indicate the stats information size
  13295. * Value: This field specifies the number of bytes of stats information
  13296. * that follows the element tag-length header.
  13297. * It is expected but not required that this length is a multiple of
  13298. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13299. * subsequent stats entry header will begin on a 4-byte aligned
  13300. * boundary.
  13301. */
  13302. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13303. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13304. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13305. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13306. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13307. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13308. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13309. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13310. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13311. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13312. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13313. do { \
  13314. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13315. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13316. } while (0)
  13317. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13318. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13319. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13320. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13321. do { \
  13322. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13323. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13324. } while (0)
  13325. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13326. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13327. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13328. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13329. do { \
  13330. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13331. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13332. } while (0)
  13333. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13334. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13335. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13336. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13337. #define HTT_MAX_AGGR 64
  13338. #define HTT_HL_MAX_AGGR 18
  13339. /**
  13340. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13341. *
  13342. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13343. *
  13344. * @details
  13345. * The following field definitions describe the format of the HTT host
  13346. * to target frag_desc/msdu_ext bank configuration message.
  13347. * The message contains the based address and the min and max id of the
  13348. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13349. * MSDU_EXT/FRAG_DESC.
  13350. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13351. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13352. * the hardware does the mapping/translation.
  13353. *
  13354. * Total banks that can be configured is configured to 16.
  13355. *
  13356. * This should be called before any TX has be initiated by the HTT
  13357. *
  13358. * |31 16|15 8|7 5|4 0|
  13359. * |------------------------------------------------------------|
  13360. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13361. * |------------------------------------------------------------|
  13362. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13363. #if HTT_PADDR64
  13364. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13365. #endif
  13366. * |------------------------------------------------------------|
  13367. * | ... |
  13368. * |------------------------------------------------------------|
  13369. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13370. #if HTT_PADDR64
  13371. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13372. #endif
  13373. * |------------------------------------------------------------|
  13374. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13375. * |------------------------------------------------------------|
  13376. * | ... |
  13377. * |------------------------------------------------------------|
  13378. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13379. * |------------------------------------------------------------|
  13380. * Header fields:
  13381. * - MSG_TYPE
  13382. * Bits 7:0
  13383. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13384. * for systems with 64-bit format for bus addresses:
  13385. * - BANKx_BASE_ADDRESS_LO
  13386. * Bits 31:0
  13387. * Purpose: Provide a mechanism to specify the base address of the
  13388. * MSDU_EXT bank physical/bus address.
  13389. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13390. * - BANKx_BASE_ADDRESS_HI
  13391. * Bits 31:0
  13392. * Purpose: Provide a mechanism to specify the base address of the
  13393. * MSDU_EXT bank physical/bus address.
  13394. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13395. * for systems with 32-bit format for bus addresses:
  13396. * - BANKx_BASE_ADDRESS
  13397. * Bits 31:0
  13398. * Purpose: Provide a mechanism to specify the base address of the
  13399. * MSDU_EXT bank physical/bus address.
  13400. * Value: MSDU_EXT bank physical / bus address
  13401. * - BANKx_MIN_ID
  13402. * Bits 15:0
  13403. * Purpose: Provide a mechanism to specify the min index that needs to
  13404. * mapped.
  13405. * - BANKx_MAX_ID
  13406. * Bits 31:16
  13407. * Purpose: Provide a mechanism to specify the max index that needs to
  13408. * mapped.
  13409. *
  13410. */
  13411. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13412. * safe value.
  13413. * @note MAX supported banks is 16.
  13414. */
  13415. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13416. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13417. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13418. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13419. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13420. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13421. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13422. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13423. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13424. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13425. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13426. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13427. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13428. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13429. do { \
  13430. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13431. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13432. } while (0)
  13433. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13434. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13435. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13436. do { \
  13437. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13438. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13439. } while (0)
  13440. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13441. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13442. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13443. do { \
  13444. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13445. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13446. } while (0)
  13447. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13448. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13449. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13450. do { \
  13451. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13452. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13453. } while (0)
  13454. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13455. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13456. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13457. do { \
  13458. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13459. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13460. } while (0)
  13461. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13462. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13463. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13464. do { \
  13465. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13466. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13467. } while (0)
  13468. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13469. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13470. /*
  13471. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13472. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13473. * addresses are stored in a XXX-bit field.
  13474. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13475. * htt_tx_frag_desc64_bank_cfg_t structs.
  13476. */
  13477. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13478. _paddr_bits_, \
  13479. _paddr__bank_base_address_) \
  13480. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13481. /** word 0 \
  13482. * msg_type: 8, \
  13483. * pdev_id: 2, \
  13484. * swap: 1, \
  13485. * reserved0: 5, \
  13486. * num_banks: 8, \
  13487. * desc_size: 8; \
  13488. */ \
  13489. A_UINT32 word0; \
  13490. /* \
  13491. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13492. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13493. * the second A_UINT32). \
  13494. */ \
  13495. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13496. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13497. } POSTPACK
  13498. /* define htt_tx_frag_desc32_bank_cfg_t */
  13499. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13500. /* define htt_tx_frag_desc64_bank_cfg_t */
  13501. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13502. /*
  13503. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13504. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13505. */
  13506. #if HTT_PADDR64
  13507. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13508. #else
  13509. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13510. #endif
  13511. /**
  13512. * @brief target -> host HTT TX Credit total count update message definition
  13513. *
  13514. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13515. *
  13516. *|31 16|15|14 9| 8 |7 0 |
  13517. *|---------------------+--+----------+-------+----------|
  13518. *|cur htt credit delta | Q| reserved | sign | msg type |
  13519. *|------------------------------------------------------|
  13520. *
  13521. * Header fields:
  13522. * - MSG_TYPE
  13523. * Bits 7:0
  13524. * Purpose: identifies this as a htt tx credit delta update message
  13525. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13526. * - SIGN
  13527. * Bits 8
  13528. * identifies whether credit delta is positive or negative
  13529. * Value:
  13530. * - 0x0: credit delta is positive, rebalance in some buffers
  13531. * - 0x1: credit delta is negative, rebalance out some buffers
  13532. * - reserved
  13533. * Bits 14:9
  13534. * Value: 0x0
  13535. * - TXQ_GRP
  13536. * Bit 15
  13537. * Purpose: indicates whether any tx queue group information elements
  13538. * are appended to the tx credit update message
  13539. * Value: 0 -> no tx queue group information element is present
  13540. * 1 -> a tx queue group information element immediately follows
  13541. * - DELTA_COUNT
  13542. * Bits 31:16
  13543. * Purpose: Specify current htt credit delta absolute count
  13544. */
  13545. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13546. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13547. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13548. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13549. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13550. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13551. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13552. do { \
  13553. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13554. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13555. } while (0)
  13556. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13557. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13558. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13559. do { \
  13560. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13561. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13562. } while (0)
  13563. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13564. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13565. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13566. do { \
  13567. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13568. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13569. } while (0)
  13570. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13571. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13572. #define HTT_TX_CREDIT_MSG_BYTES 4
  13573. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13574. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13575. /**
  13576. * @brief HTT WDI_IPA Operation Response Message
  13577. *
  13578. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13579. *
  13580. * @details
  13581. * HTT WDI_IPA Operation Response message is sent by target
  13582. * to host confirming suspend or resume operation.
  13583. * |31 24|23 16|15 8|7 0|
  13584. * |----------------+----------------+----------------+----------------|
  13585. * | op_code | Rsvd | msg_type |
  13586. * |-------------------------------------------------------------------|
  13587. * | Rsvd | Response len |
  13588. * |-------------------------------------------------------------------|
  13589. * | |
  13590. * | Response-type specific info |
  13591. * | |
  13592. * | |
  13593. * |-------------------------------------------------------------------|
  13594. * Header fields:
  13595. * - MSG_TYPE
  13596. * Bits 7:0
  13597. * Purpose: Identifies this as WDI_IPA Operation Response message
  13598. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13599. * - OP_CODE
  13600. * Bits 31:16
  13601. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13602. * value: = enum htt_wdi_ipa_op_code
  13603. * - RSP_LEN
  13604. * Bits 16:0
  13605. * Purpose: length for the response-type specific info
  13606. * value: = length in bytes for response-type specific info
  13607. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13608. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13609. */
  13610. PREPACK struct htt_wdi_ipa_op_response_t
  13611. {
  13612. /* DWORD 0: flags and meta-data */
  13613. A_UINT32
  13614. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13615. reserved1: 8,
  13616. op_code: 16;
  13617. A_UINT32
  13618. rsp_len: 16,
  13619. reserved2: 16;
  13620. } POSTPACK;
  13621. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13622. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13623. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13624. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13625. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13626. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13627. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13628. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13629. do { \
  13630. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13631. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13632. } while (0)
  13633. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13634. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13635. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13636. do { \
  13637. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13638. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13639. } while (0)
  13640. enum htt_phy_mode {
  13641. htt_phy_mode_11a = 0,
  13642. htt_phy_mode_11g = 1,
  13643. htt_phy_mode_11b = 2,
  13644. htt_phy_mode_11g_only = 3,
  13645. htt_phy_mode_11na_ht20 = 4,
  13646. htt_phy_mode_11ng_ht20 = 5,
  13647. htt_phy_mode_11na_ht40 = 6,
  13648. htt_phy_mode_11ng_ht40 = 7,
  13649. htt_phy_mode_11ac_vht20 = 8,
  13650. htt_phy_mode_11ac_vht40 = 9,
  13651. htt_phy_mode_11ac_vht80 = 10,
  13652. htt_phy_mode_11ac_vht20_2g = 11,
  13653. htt_phy_mode_11ac_vht40_2g = 12,
  13654. htt_phy_mode_11ac_vht80_2g = 13,
  13655. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13656. htt_phy_mode_11ac_vht160 = 15,
  13657. htt_phy_mode_max,
  13658. };
  13659. /**
  13660. * @brief target -> host HTT channel change indication
  13661. *
  13662. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13663. *
  13664. * @details
  13665. * Specify when a channel change occurs.
  13666. * This allows the host to precisely determine which rx frames arrived
  13667. * on the old channel and which rx frames arrived on the new channel.
  13668. *
  13669. *|31 |7 0 |
  13670. *|-------------------------------------------+----------|
  13671. *| reserved | msg type |
  13672. *|------------------------------------------------------|
  13673. *| primary_chan_center_freq_mhz |
  13674. *|------------------------------------------------------|
  13675. *| contiguous_chan1_center_freq_mhz |
  13676. *|------------------------------------------------------|
  13677. *| contiguous_chan2_center_freq_mhz |
  13678. *|------------------------------------------------------|
  13679. *| phy_mode |
  13680. *|------------------------------------------------------|
  13681. *
  13682. * Header fields:
  13683. * - MSG_TYPE
  13684. * Bits 7:0
  13685. * Purpose: identifies this as a htt channel change indication message
  13686. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13687. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13688. * Bits 31:0
  13689. * Purpose: identify the (center of the) new 20 MHz primary channel
  13690. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13691. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13692. * Bits 31:0
  13693. * Purpose: identify the (center of the) contiguous frequency range
  13694. * comprising the new channel.
  13695. * For example, if the new channel is a 80 MHz channel extending
  13696. * 60 MHz beyond the primary channel, this field would be 30 larger
  13697. * than the primary channel center frequency field.
  13698. * Value: center frequency of the contiguous frequency range comprising
  13699. * the full channel in MHz units
  13700. * (80+80 channels also use the CONTIG_CHAN2 field)
  13701. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13702. * Bits 31:0
  13703. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13704. * within a VHT 80+80 channel.
  13705. * This field is only relevant for VHT 80+80 channels.
  13706. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13707. * channel (arbitrary value for cases besides VHT 80+80)
  13708. * - PHY_MODE
  13709. * Bits 31:0
  13710. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13711. * and band
  13712. * Value: htt_phy_mode enum value
  13713. */
  13714. PREPACK struct htt_chan_change_t
  13715. {
  13716. /* DWORD 0: flags and meta-data */
  13717. A_UINT32
  13718. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13719. reserved1: 24;
  13720. A_UINT32 primary_chan_center_freq_mhz;
  13721. A_UINT32 contig_chan1_center_freq_mhz;
  13722. A_UINT32 contig_chan2_center_freq_mhz;
  13723. A_UINT32 phy_mode;
  13724. } POSTPACK;
  13725. /*
  13726. * Due to historical / backwards-compatibility reasons, maintain the
  13727. * below htt_chan_change_msg struct definition, which needs to be
  13728. * consistent with the above htt_chan_change_t struct definition
  13729. * (aside from the htt_chan_change_t definition including the msg_type
  13730. * dword within the message, and the htt_chan_change_msg only containing
  13731. * the payload of the message that follows the msg_type dword).
  13732. */
  13733. PREPACK struct htt_chan_change_msg {
  13734. A_UINT32 chan_mhz; /* frequency in mhz */
  13735. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13736. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13737. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13738. } POSTPACK;
  13739. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13740. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13741. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13742. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13743. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13744. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13745. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13746. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13747. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13748. do { \
  13749. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13750. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13751. } while (0)
  13752. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13753. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13754. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13755. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13756. do { \
  13757. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13758. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13759. } while (0)
  13760. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13761. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13762. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13763. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13764. do { \
  13765. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13766. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13767. } while (0)
  13768. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13769. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13770. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13771. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13772. do { \
  13773. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13774. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13775. } while (0)
  13776. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13777. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13778. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13779. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13780. /**
  13781. * @brief rx offload packet error message
  13782. *
  13783. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13784. *
  13785. * @details
  13786. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13787. * of target payload like mic err.
  13788. *
  13789. * |31 24|23 16|15 8|7 0|
  13790. * |----------------+----------------+----------------+----------------|
  13791. * | tid | vdev_id | msg_sub_type | msg_type |
  13792. * |-------------------------------------------------------------------|
  13793. * : (sub-type dependent content) :
  13794. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13795. * Header fields:
  13796. * - msg_type
  13797. * Bits 7:0
  13798. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13799. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13800. * - msg_sub_type
  13801. * Bits 15:8
  13802. * Purpose: Identifies which type of rx error is reported by this message
  13803. * value: htt_rx_ofld_pkt_err_type
  13804. * - vdev_id
  13805. * Bits 23:16
  13806. * Purpose: Identifies which vdev received the erroneous rx frame
  13807. * value:
  13808. * - tid
  13809. * Bits 31:24
  13810. * Purpose: Identifies the traffic type of the rx frame
  13811. * value:
  13812. *
  13813. * - The payload fields used if the sub-type == MIC error are shown below.
  13814. * Note - MIC err is per MSDU, while PN is per MPDU.
  13815. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13816. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13817. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13818. * instead of sending separate HTT messages for each wrong MSDU within
  13819. * the MPDU.
  13820. *
  13821. * |31 24|23 16|15 8|7 0|
  13822. * |----------------+----------------+----------------+----------------|
  13823. * | Rsvd | key_id | peer_id |
  13824. * |-------------------------------------------------------------------|
  13825. * | receiver MAC addr 31:0 |
  13826. * |-------------------------------------------------------------------|
  13827. * | Rsvd | receiver MAC addr 47:32 |
  13828. * |-------------------------------------------------------------------|
  13829. * | transmitter MAC addr 31:0 |
  13830. * |-------------------------------------------------------------------|
  13831. * | Rsvd | transmitter MAC addr 47:32 |
  13832. * |-------------------------------------------------------------------|
  13833. * | PN 31:0 |
  13834. * |-------------------------------------------------------------------|
  13835. * | Rsvd | PN 47:32 |
  13836. * |-------------------------------------------------------------------|
  13837. * - peer_id
  13838. * Bits 15:0
  13839. * Purpose: identifies which peer is frame is from
  13840. * value:
  13841. * - key_id
  13842. * Bits 23:16
  13843. * Purpose: identifies key_id of rx frame
  13844. * value:
  13845. * - RA_31_0 (receiver MAC addr 31:0)
  13846. * Bits 31:0
  13847. * Purpose: identifies by MAC address which vdev received the frame
  13848. * value: MAC address lower 4 bytes
  13849. * - RA_47_32 (receiver MAC addr 47:32)
  13850. * Bits 15:0
  13851. * Purpose: identifies by MAC address which vdev received the frame
  13852. * value: MAC address upper 2 bytes
  13853. * - TA_31_0 (transmitter MAC addr 31:0)
  13854. * Bits 31:0
  13855. * Purpose: identifies by MAC address which peer transmitted the frame
  13856. * value: MAC address lower 4 bytes
  13857. * - TA_47_32 (transmitter MAC addr 47:32)
  13858. * Bits 15:0
  13859. * Purpose: identifies by MAC address which peer transmitted the frame
  13860. * value: MAC address upper 2 bytes
  13861. * - PN_31_0
  13862. * Bits 31:0
  13863. * Purpose: Identifies pn of rx frame
  13864. * value: PN lower 4 bytes
  13865. * - PN_47_32
  13866. * Bits 15:0
  13867. * Purpose: Identifies pn of rx frame
  13868. * value:
  13869. * TKIP or CCMP: PN upper 2 bytes
  13870. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13871. */
  13872. enum htt_rx_ofld_pkt_err_type {
  13873. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13874. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13875. };
  13876. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13877. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13878. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13879. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13880. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13881. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13882. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13883. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13884. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13885. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13886. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13887. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13888. do { \
  13889. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13890. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13891. } while (0)
  13892. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13893. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13894. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13895. do { \
  13896. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13897. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13898. } while (0)
  13899. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13900. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13901. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13902. do { \
  13903. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13904. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13905. } while (0)
  13906. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13907. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13908. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13909. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13910. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13911. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13912. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13913. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13914. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13915. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13916. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13917. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13918. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13919. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13920. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13921. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13922. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13923. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13924. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13925. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13926. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13927. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13928. do { \
  13929. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13930. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13931. } while (0)
  13932. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13933. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13934. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13935. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13936. do { \
  13937. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13938. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13939. } while (0)
  13940. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13941. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13942. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13943. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13944. do { \
  13945. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13946. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13947. } while (0)
  13948. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13949. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13950. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13951. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13952. do { \
  13953. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13954. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13955. } while (0)
  13956. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13957. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13958. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13959. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13960. do { \
  13961. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13962. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13963. } while (0)
  13964. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13965. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13966. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13967. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13968. do { \
  13969. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13970. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13971. } while (0)
  13972. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13973. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13974. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13975. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13976. do { \
  13977. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13978. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13979. } while (0)
  13980. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13981. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13982. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13983. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13984. do { \
  13985. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13986. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13987. } while (0)
  13988. /**
  13989. * @brief target -> host peer rate report message
  13990. *
  13991. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13992. *
  13993. * @details
  13994. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13995. * justified rate of all the peers.
  13996. *
  13997. * |31 24|23 16|15 8|7 0|
  13998. * |----------------+----------------+----------------+----------------|
  13999. * | peer_count | | msg_type |
  14000. * |-------------------------------------------------------------------|
  14001. * : Payload (variant number of peer rate report) :
  14002. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14003. * Header fields:
  14004. * - msg_type
  14005. * Bits 7:0
  14006. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14007. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14008. * - reserved
  14009. * Bits 15:8
  14010. * Purpose:
  14011. * value:
  14012. * - peer_count
  14013. * Bits 31:16
  14014. * Purpose: Specify how many peer rate report elements are present in the payload.
  14015. * value:
  14016. *
  14017. * Payload:
  14018. * There are variant number of peer rate report follow the first 32 bits.
  14019. * The peer rate report is defined as follows.
  14020. *
  14021. * |31 20|19 16|15 0|
  14022. * |-----------------------+---------+---------------------------------|-
  14023. * | reserved | phy | peer_id | \
  14024. * |-------------------------------------------------------------------| -> report #0
  14025. * | rate | /
  14026. * |-----------------------+---------+---------------------------------|-
  14027. * | reserved | phy | peer_id | \
  14028. * |-------------------------------------------------------------------| -> report #1
  14029. * | rate | /
  14030. * |-----------------------+---------+---------------------------------|-
  14031. * | reserved | phy | peer_id | \
  14032. * |-------------------------------------------------------------------| -> report #2
  14033. * | rate | /
  14034. * |-------------------------------------------------------------------|-
  14035. * : :
  14036. * : :
  14037. * : :
  14038. * :-------------------------------------------------------------------:
  14039. *
  14040. * - peer_id
  14041. * Bits 15:0
  14042. * Purpose: identify the peer
  14043. * value:
  14044. * - phy
  14045. * Bits 19:16
  14046. * Purpose: identify which phy is in use
  14047. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14048. * Please see enum htt_peer_report_phy_type for detail.
  14049. * - reserved
  14050. * Bits 31:20
  14051. * Purpose:
  14052. * value:
  14053. * - rate
  14054. * Bits 31:0
  14055. * Purpose: represent the justified rate of the peer specified by peer_id
  14056. * value:
  14057. */
  14058. enum htt_peer_rate_report_phy_type {
  14059. HTT_PEER_RATE_REPORT_11B = 0,
  14060. HTT_PEER_RATE_REPORT_11A_G,
  14061. HTT_PEER_RATE_REPORT_11N,
  14062. HTT_PEER_RATE_REPORT_11AC,
  14063. };
  14064. #define HTT_PEER_RATE_REPORT_SIZE 8
  14065. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14066. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14067. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14068. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14069. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14070. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14071. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14072. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14073. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14074. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14075. do { \
  14076. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14077. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14078. } while (0)
  14079. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14080. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14081. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14082. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14083. do { \
  14084. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14085. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14086. } while (0)
  14087. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14088. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14089. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14090. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14091. do { \
  14092. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14093. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14094. } while (0)
  14095. /**
  14096. * @brief target -> host flow pool map message
  14097. *
  14098. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14099. *
  14100. * @details
  14101. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14102. * a flow of descriptors.
  14103. *
  14104. * This message is in TLV format and indicates the parameters to be setup a
  14105. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14106. * receive descriptors from a specified pool.
  14107. *
  14108. * The message would appear as follows:
  14109. *
  14110. * |31 24|23 16|15 8|7 0|
  14111. * |----------------+----------------+----------------+----------------|
  14112. * header | reserved | num_flows | msg_type |
  14113. * |-------------------------------------------------------------------|
  14114. * | |
  14115. * : payload :
  14116. * | |
  14117. * |-------------------------------------------------------------------|
  14118. *
  14119. * The header field is one DWORD long and is interpreted as follows:
  14120. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14121. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14122. * this message
  14123. * b'16-31 - reserved: These bits are reserved for future use
  14124. *
  14125. * Payload:
  14126. * The payload would contain multiple objects of the following structure. Each
  14127. * object represents a flow.
  14128. *
  14129. * |31 24|23 16|15 8|7 0|
  14130. * |----------------+----------------+----------------+----------------|
  14131. * header | reserved | num_flows | msg_type |
  14132. * |-------------------------------------------------------------------|
  14133. * payload0| flow_type |
  14134. * |-------------------------------------------------------------------|
  14135. * | flow_id |
  14136. * |-------------------------------------------------------------------|
  14137. * | reserved0 | flow_pool_id |
  14138. * |-------------------------------------------------------------------|
  14139. * | reserved1 | flow_pool_size |
  14140. * |-------------------------------------------------------------------|
  14141. * | reserved2 |
  14142. * |-------------------------------------------------------------------|
  14143. * payload1| flow_type |
  14144. * |-------------------------------------------------------------------|
  14145. * | flow_id |
  14146. * |-------------------------------------------------------------------|
  14147. * | reserved0 | flow_pool_id |
  14148. * |-------------------------------------------------------------------|
  14149. * | reserved1 | flow_pool_size |
  14150. * |-------------------------------------------------------------------|
  14151. * | reserved2 |
  14152. * |-------------------------------------------------------------------|
  14153. * | . |
  14154. * | . |
  14155. * | . |
  14156. * |-------------------------------------------------------------------|
  14157. *
  14158. * Each payload is 5 DWORDS long and is interpreted as follows:
  14159. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14160. * this flow is associated. It can be VDEV, peer,
  14161. * or tid (AC). Based on enum htt_flow_type.
  14162. *
  14163. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14164. * object. For flow_type vdev it is set to the
  14165. * vdevid, for peer it is peerid and for tid, it is
  14166. * tid_num.
  14167. *
  14168. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14169. * in the host for this flow
  14170. * b'16:31 - reserved0: This field in reserved for the future. In case
  14171. * we have a hierarchical implementation (HCM) of
  14172. * pools, it can be used to indicate the ID of the
  14173. * parent-pool.
  14174. *
  14175. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14176. * Descriptors for this flow will be
  14177. * allocated from this pool in the host.
  14178. * b'16:31 - reserved1: This field in reserved for the future. In case
  14179. * we have a hierarchical implementation of pools,
  14180. * it can be used to indicate the max number of
  14181. * descriptors in the pool. The b'0:15 can be used
  14182. * to indicate min number of descriptors in the
  14183. * HCM scheme.
  14184. *
  14185. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14186. * we have a hierarchical implementation of pools,
  14187. * b'0:15 can be used to indicate the
  14188. * priority-based borrowing (PBB) threshold of
  14189. * the flow's pool. The b'16:31 are still left
  14190. * reserved.
  14191. */
  14192. enum htt_flow_type {
  14193. FLOW_TYPE_VDEV = 0,
  14194. /* Insert new flow types above this line */
  14195. };
  14196. PREPACK struct htt_flow_pool_map_payload_t {
  14197. A_UINT32 flow_type;
  14198. A_UINT32 flow_id;
  14199. A_UINT32 flow_pool_id:16,
  14200. reserved0:16;
  14201. A_UINT32 flow_pool_size:16,
  14202. reserved1:16;
  14203. A_UINT32 reserved2;
  14204. } POSTPACK;
  14205. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14206. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14207. (sizeof(struct htt_flow_pool_map_payload_t))
  14208. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14209. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14210. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14211. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14212. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14213. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14214. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14215. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14216. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14217. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14218. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14219. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14220. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14221. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14222. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14223. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14224. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14225. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14226. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14227. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14228. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14229. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14230. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14231. do { \
  14232. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14233. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14234. } while (0)
  14235. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14236. do { \
  14237. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14238. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14239. } while (0)
  14240. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14241. do { \
  14242. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14243. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14244. } while (0)
  14245. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14246. do { \
  14247. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14248. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14249. } while (0)
  14250. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14251. do { \
  14252. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14253. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14254. } while (0)
  14255. /**
  14256. * @brief target -> host flow pool unmap message
  14257. *
  14258. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14259. *
  14260. * @details
  14261. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14262. * down a flow of descriptors.
  14263. * This message indicates that for the flow (whose ID is provided) is wanting
  14264. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14265. * pool of descriptors from where descriptors are being allocated for this
  14266. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14267. * be unmapped by the host.
  14268. *
  14269. * The message would appear as follows:
  14270. *
  14271. * |31 24|23 16|15 8|7 0|
  14272. * |----------------+----------------+----------------+----------------|
  14273. * | reserved0 | msg_type |
  14274. * |-------------------------------------------------------------------|
  14275. * | flow_type |
  14276. * |-------------------------------------------------------------------|
  14277. * | flow_id |
  14278. * |-------------------------------------------------------------------|
  14279. * | reserved1 | flow_pool_id |
  14280. * |-------------------------------------------------------------------|
  14281. *
  14282. * The message is interpreted as follows:
  14283. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14284. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14285. * b'8:31 - reserved0: Reserved for future use
  14286. *
  14287. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14288. * this flow is associated. It can be VDEV, peer,
  14289. * or tid (AC). Based on enum htt_flow_type.
  14290. *
  14291. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14292. * object. For flow_type vdev it is set to the
  14293. * vdevid, for peer it is peerid and for tid, it is
  14294. * tid_num.
  14295. *
  14296. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14297. * used in the host for this flow
  14298. * b'16:31 - reserved0: This field in reserved for the future.
  14299. *
  14300. */
  14301. PREPACK struct htt_flow_pool_unmap_t {
  14302. A_UINT32 msg_type:8,
  14303. reserved0:24;
  14304. A_UINT32 flow_type;
  14305. A_UINT32 flow_id;
  14306. A_UINT32 flow_pool_id:16,
  14307. reserved1:16;
  14308. } POSTPACK;
  14309. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14310. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14311. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14312. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14313. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14314. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14315. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14316. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14317. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14318. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14319. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14320. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14321. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14322. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14323. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14324. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14325. do { \
  14326. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14327. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14328. } while (0)
  14329. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14330. do { \
  14331. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14332. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14333. } while (0)
  14334. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14335. do { \
  14336. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14337. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14338. } while (0)
  14339. /**
  14340. * @brief target -> host SRING setup done message
  14341. *
  14342. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14343. *
  14344. * @details
  14345. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14346. * SRNG ring setup is done
  14347. *
  14348. * This message indicates whether the last setup operation is successful.
  14349. * It will be sent to host when host set respose_required bit in
  14350. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14351. * The message would appear as follows:
  14352. *
  14353. * |31 24|23 16|15 8|7 0|
  14354. * |--------------- +----------------+----------------+----------------|
  14355. * | setup_status | ring_id | pdev_id | msg_type |
  14356. * |-------------------------------------------------------------------|
  14357. *
  14358. * The message is interpreted as follows:
  14359. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14360. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14361. * b'8:15 - pdev_id:
  14362. * 0 (for rings at SOC/UMAC level),
  14363. * 1/2/3 mac id (for rings at LMAC level)
  14364. * b'16:23 - ring_id: Identify the ring which is set up
  14365. * More details can be got from enum htt_srng_ring_id
  14366. * b'24:31 - setup_status: Indicate status of setup operation
  14367. * Refer to htt_ring_setup_status
  14368. */
  14369. PREPACK struct htt_sring_setup_done_t {
  14370. A_UINT32 msg_type: 8,
  14371. pdev_id: 8,
  14372. ring_id: 8,
  14373. setup_status: 8;
  14374. } POSTPACK;
  14375. enum htt_ring_setup_status {
  14376. htt_ring_setup_status_ok = 0,
  14377. htt_ring_setup_status_error,
  14378. };
  14379. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14380. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14381. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14382. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14383. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14384. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14385. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14386. do { \
  14387. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14388. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14389. } while (0)
  14390. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14391. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14392. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14393. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14394. HTT_SRING_SETUP_DONE_RING_ID_S)
  14395. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14396. do { \
  14397. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14398. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14399. } while (0)
  14400. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14401. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14402. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14403. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14404. HTT_SRING_SETUP_DONE_STATUS_S)
  14405. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14406. do { \
  14407. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14408. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14409. } while (0)
  14410. /**
  14411. * @brief target -> flow map flow info
  14412. *
  14413. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14414. *
  14415. * @details
  14416. * HTT TX map flow entry with tqm flow pointer
  14417. * Sent from firmware to host to add tqm flow pointer in corresponding
  14418. * flow search entry. Flow metadata is replayed back to host as part of this
  14419. * struct to enable host to find the specific flow search entry
  14420. *
  14421. * The message would appear as follows:
  14422. *
  14423. * |31 28|27 18|17 14|13 8|7 0|
  14424. * |-------+------------------------------------------+----------------|
  14425. * | rsvd0 | fse_hsh_idx | msg_type |
  14426. * |-------------------------------------------------------------------|
  14427. * | rsvd1 | tid | peer_id |
  14428. * |-------------------------------------------------------------------|
  14429. * | tqm_flow_pntr_lo |
  14430. * |-------------------------------------------------------------------|
  14431. * | tqm_flow_pntr_hi |
  14432. * |-------------------------------------------------------------------|
  14433. * | fse_meta_data |
  14434. * |-------------------------------------------------------------------|
  14435. *
  14436. * The message is interpreted as follows:
  14437. *
  14438. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14439. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14440. *
  14441. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14442. * for this flow entry
  14443. *
  14444. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14445. *
  14446. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14447. *
  14448. * dword1 - b'14:17 - tid
  14449. *
  14450. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14451. *
  14452. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14453. *
  14454. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14455. *
  14456. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14457. * given by host
  14458. */
  14459. PREPACK struct htt_tx_map_flow_info {
  14460. A_UINT32
  14461. msg_type: 8,
  14462. fse_hsh_idx: 20,
  14463. rsvd0: 4;
  14464. A_UINT32
  14465. peer_id: 14,
  14466. tid: 4,
  14467. rsvd1: 14;
  14468. A_UINT32 tqm_flow_pntr_lo;
  14469. A_UINT32 tqm_flow_pntr_hi;
  14470. struct htt_tx_flow_metadata fse_meta_data;
  14471. } POSTPACK;
  14472. /* DWORD 0 */
  14473. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14474. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14475. /* DWORD 1 */
  14476. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14477. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14478. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14479. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14480. /* DWORD 0 */
  14481. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14482. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14483. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14484. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14485. do { \
  14486. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14487. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14488. } while (0)
  14489. /* DWORD 1 */
  14490. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14491. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14492. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14493. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14494. do { \
  14495. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14496. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14497. } while (0)
  14498. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14499. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14500. HTT_TX_MAP_FLOW_INFO_TID_S)
  14501. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14502. do { \
  14503. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14504. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14505. } while (0)
  14506. /*
  14507. * htt_dbg_ext_stats_status -
  14508. * present - The requested stats have been delivered in full.
  14509. * This indicates that either the stats information was contained
  14510. * in its entirety within this message, or else this message
  14511. * completes the delivery of the requested stats info that was
  14512. * partially delivered through earlier STATS_CONF messages.
  14513. * partial - The requested stats have been delivered in part.
  14514. * One or more subsequent STATS_CONF messages with the same
  14515. * cookie value will be sent to deliver the remainder of the
  14516. * information.
  14517. * error - The requested stats could not be delivered, for example due
  14518. * to a shortage of memory to construct a message holding the
  14519. * requested stats.
  14520. * invalid - The requested stat type is either not recognized, or the
  14521. * target is configured to not gather the stats type in question.
  14522. */
  14523. enum htt_dbg_ext_stats_status {
  14524. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14525. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14526. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14527. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14528. };
  14529. /**
  14530. * @brief target -> host ppdu stats upload
  14531. *
  14532. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14533. *
  14534. * @details
  14535. * The following field definitions describe the format of the HTT target
  14536. * to host ppdu stats indication message.
  14537. *
  14538. *
  14539. * |31 16|15 12|11 10|9 8|7 0 |
  14540. * |----------------------------------------------------------------------|
  14541. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14542. * |----------------------------------------------------------------------|
  14543. * | ppdu_id |
  14544. * |----------------------------------------------------------------------|
  14545. * | Timestamp in us |
  14546. * |----------------------------------------------------------------------|
  14547. * | reserved |
  14548. * |----------------------------------------------------------------------|
  14549. * | type-specific stats info |
  14550. * | (see htt_ppdu_stats.h) |
  14551. * |----------------------------------------------------------------------|
  14552. * Header fields:
  14553. * - MSG_TYPE
  14554. * Bits 7:0
  14555. * Purpose: Identifies this is a PPDU STATS indication
  14556. * message.
  14557. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14558. * - mac_id
  14559. * Bits 9:8
  14560. * Purpose: mac_id of this ppdu_id
  14561. * Value: 0-3
  14562. * - pdev_id
  14563. * Bits 11:10
  14564. * Purpose: pdev_id of this ppdu_id
  14565. * Value: 0-3
  14566. * 0 (for rings at SOC level),
  14567. * 1/2/3 PDEV -> 0/1/2
  14568. * - payload_size
  14569. * Bits 31:16
  14570. * Purpose: total tlv size
  14571. * Value: payload_size in bytes
  14572. */
  14573. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14574. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14575. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14576. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14577. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14578. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14579. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14580. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14581. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14582. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14583. do { \
  14584. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14585. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14586. } while (0)
  14587. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14588. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14589. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14590. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14591. do { \
  14592. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14593. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14594. } while (0)
  14595. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14596. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14597. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14598. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14599. do { \
  14600. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14601. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14602. } while (0)
  14603. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14604. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14605. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14606. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14607. do { \
  14608. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14609. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14610. } while (0)
  14611. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14612. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14613. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14614. /* htt_t2h_ppdu_stats_ind_hdr_t
  14615. * This struct contains the fields within the header of the
  14616. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14617. * stats info.
  14618. * This struct assumes little-endian layout, and thus is only
  14619. * suitable for use within processors known to be little-endian
  14620. * (such as the target).
  14621. * In contrast, the above macros provide endian-portable methods
  14622. * to get and set the bitfields within this PPDU_STATS_IND header.
  14623. */
  14624. typedef struct {
  14625. A_UINT32 msg_type: 8, /* bits 7:0 */
  14626. mac_id: 2, /* bits 9:8 */
  14627. pdev_id: 2, /* bits 11:10 */
  14628. reserved1: 4, /* bits 15:12 */
  14629. payload_size: 16; /* bits 31:16 */
  14630. A_UINT32 ppdu_id;
  14631. A_UINT32 timestamp_us;
  14632. A_UINT32 reserved2;
  14633. } htt_t2h_ppdu_stats_ind_hdr_t;
  14634. /**
  14635. * @brief target -> host extended statistics upload
  14636. *
  14637. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14638. *
  14639. * @details
  14640. * The following field definitions describe the format of the HTT target
  14641. * to host stats upload confirmation message.
  14642. * The message contains a cookie echoed from the HTT host->target stats
  14643. * upload request, which identifies which request the confirmation is
  14644. * for, and a single stats can span over multiple HTT stats indication
  14645. * due to the HTT message size limitation so every HTT ext stats indication
  14646. * will have tag-length-value stats information elements.
  14647. * The tag-length header for each HTT stats IND message also includes a
  14648. * status field, to indicate whether the request for the stat type in
  14649. * question was fully met, partially met, unable to be met, or invalid
  14650. * (if the stat type in question is disabled in the target).
  14651. * A Done bit 1's indicate the end of the of stats info elements.
  14652. *
  14653. *
  14654. * |31 16|15 12|11|10 8|7 5|4 0|
  14655. * |--------------------------------------------------------------|
  14656. * | reserved | msg type |
  14657. * |--------------------------------------------------------------|
  14658. * | cookie LSBs |
  14659. * |--------------------------------------------------------------|
  14660. * | cookie MSBs |
  14661. * |--------------------------------------------------------------|
  14662. * | stats entry length | rsvd | D| S | stat type |
  14663. * |--------------------------------------------------------------|
  14664. * | type-specific stats info |
  14665. * | (see htt_stats.h) |
  14666. * |--------------------------------------------------------------|
  14667. * Header fields:
  14668. * - MSG_TYPE
  14669. * Bits 7:0
  14670. * Purpose: Identifies this is a extended statistics upload confirmation
  14671. * message.
  14672. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14673. * - COOKIE_LSBS
  14674. * Bits 31:0
  14675. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14676. * message with its preceding host->target stats request message.
  14677. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14678. * - COOKIE_MSBS
  14679. * Bits 31:0
  14680. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14681. * message with its preceding host->target stats request message.
  14682. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14683. *
  14684. * Stats Information Element tag-length header fields:
  14685. * - STAT_TYPE
  14686. * Bits 7:0
  14687. * Purpose: identifies the type of statistics info held in the
  14688. * following information element
  14689. * Value: htt_dbg_ext_stats_type
  14690. * - STATUS
  14691. * Bits 10:8
  14692. * Purpose: indicate whether the requested stats are present
  14693. * Value: htt_dbg_ext_stats_status
  14694. * - DONE
  14695. * Bits 11
  14696. * Purpose:
  14697. * Indicates the completion of the stats entry, this will be the last
  14698. * stats conf HTT segment for the requested stats type.
  14699. * Value:
  14700. * 0 -> the stats retrieval is ongoing
  14701. * 1 -> the stats retrieval is complete
  14702. * - LENGTH
  14703. * Bits 31:16
  14704. * Purpose: indicate the stats information size
  14705. * Value: This field specifies the number of bytes of stats information
  14706. * that follows the element tag-length header.
  14707. * It is expected but not required that this length is a multiple of
  14708. * 4 bytes.
  14709. */
  14710. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14711. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14712. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14713. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14714. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14715. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14716. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14717. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14718. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14719. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14720. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14721. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14722. do { \
  14723. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14724. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14725. } while (0)
  14726. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14727. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14728. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14729. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14730. do { \
  14731. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14732. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14733. } while (0)
  14734. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14735. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14736. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14737. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14738. do { \
  14739. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14740. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14741. } while (0)
  14742. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14743. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14744. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14745. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14746. do { \
  14747. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14748. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14749. } while (0)
  14750. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14751. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14752. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14753. /**
  14754. * @brief target -> host streaming statistics upload
  14755. *
  14756. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14757. *
  14758. * @details
  14759. * The following field definitions describe the format of the HTT target
  14760. * to host streaming stats upload indication message.
  14761. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14762. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14763. * use the STREAMING_STATS_REQ message to halt the target's production of
  14764. * STREAMING_STATS_IND messages.
  14765. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14766. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14767. *
  14768. * |31 8|7 0|
  14769. * |--------------------------------------------------------------|
  14770. * | reserved | msg type |
  14771. * |--------------------------------------------------------------|
  14772. * | type-specific stats info |
  14773. * | (see htt_stats.h) |
  14774. * |--------------------------------------------------------------|
  14775. * Header fields:
  14776. * - MSG_TYPE
  14777. * Bits 7:0
  14778. * Purpose: Identifies this as a streaming statistics upload indication
  14779. * message.
  14780. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14781. */
  14782. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14783. typedef enum {
  14784. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14785. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14786. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14787. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14788. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14789. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14790. /* Reserved from 128 - 255 for target internal use.*/
  14791. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14792. } HTT_PEER_TYPE;
  14793. /** macro to convert MAC address from char array to HTT word format */
  14794. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14795. (phtt_mac_addr)->mac_addr31to0 = \
  14796. (((c_macaddr)[0] << 0) | \
  14797. ((c_macaddr)[1] << 8) | \
  14798. ((c_macaddr)[2] << 16) | \
  14799. ((c_macaddr)[3] << 24)); \
  14800. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14801. } while (0)
  14802. /**
  14803. * @brief target -> host monitor mac header indication message
  14804. *
  14805. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14806. *
  14807. * @details
  14808. * The following diagram shows the format of the monitor mac header message
  14809. * sent from the target to the host.
  14810. * This message is primarily sent when promiscuous rx mode is enabled.
  14811. * One message is sent per rx PPDU.
  14812. *
  14813. * |31 24|23 16|15 8|7 0|
  14814. * |-------------------------------------------------------------|
  14815. * | peer_id | reserved0 | msg_type |
  14816. * |-------------------------------------------------------------|
  14817. * | reserved1 | num_mpdu |
  14818. * |-------------------------------------------------------------|
  14819. * | struct hw_rx_desc |
  14820. * | (see wal_rx_desc.h) |
  14821. * |-------------------------------------------------------------|
  14822. * | struct ieee80211_frame_addr4 |
  14823. * | (see ieee80211_defs.h) |
  14824. * |-------------------------------------------------------------|
  14825. * | struct ieee80211_frame_addr4 |
  14826. * | (see ieee80211_defs.h) |
  14827. * |-------------------------------------------------------------|
  14828. * | ...... |
  14829. * |-------------------------------------------------------------|
  14830. *
  14831. * Header fields:
  14832. * - msg_type
  14833. * Bits 7:0
  14834. * Purpose: Identifies this is a monitor mac header indication message.
  14835. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14836. * - peer_id
  14837. * Bits 31:16
  14838. * Purpose: Software peer id given by host during association,
  14839. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14840. * for rx PPDUs received from unassociated peers.
  14841. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14842. * - num_mpdu
  14843. * Bits 15:0
  14844. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14845. * delivered within the message.
  14846. * Value: 1 to 32
  14847. * num_mpdu is limited to a maximum value of 32, due to buffer
  14848. * size limits. For PPDUs with more than 32 MPDUs, only the
  14849. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14850. * the PPDU will be provided.
  14851. */
  14852. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14853. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14854. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14855. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14856. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14857. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14858. do { \
  14859. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14860. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14861. } while (0)
  14862. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14863. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14864. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14865. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14866. do { \
  14867. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14868. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14869. } while (0)
  14870. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14871. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14872. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14873. /**
  14874. * @brief target -> host flow pool resize Message
  14875. *
  14876. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14877. *
  14878. * @details
  14879. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14880. * the flow pool associated with the specified ID is resized
  14881. *
  14882. * The message would appear as follows:
  14883. *
  14884. * |31 16|15 8|7 0|
  14885. * |---------------------------------+----------------+----------------|
  14886. * | reserved0 | Msg type |
  14887. * |-------------------------------------------------------------------|
  14888. * | flow pool new size | flow pool ID |
  14889. * |-------------------------------------------------------------------|
  14890. *
  14891. * The message is interpreted as follows:
  14892. * b'0:7 - msg_type: This will be set to 0x21
  14893. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14894. *
  14895. * b'0:15 - flow pool ID: Existing flow pool ID
  14896. *
  14897. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14898. *
  14899. */
  14900. PREPACK struct htt_flow_pool_resize_t {
  14901. A_UINT32 msg_type:8,
  14902. reserved0:24;
  14903. A_UINT32 flow_pool_id:16,
  14904. flow_pool_new_size:16;
  14905. } POSTPACK;
  14906. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14907. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14908. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14909. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14910. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14911. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14912. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14913. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14914. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14915. do { \
  14916. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14917. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14918. } while (0)
  14919. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14920. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14921. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14922. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14923. do { \
  14924. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14925. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14926. } while (0)
  14927. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14928. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14929. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14930. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14931. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14932. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14933. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14934. /*
  14935. * The read and write indices point to the data within the host buffer.
  14936. * Because the first 4 bytes of the host buffer is used for the read index and
  14937. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14938. * The read index and write index are the byte offsets from the base of the
  14939. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14940. * Refer the ASCII text picture below.
  14941. */
  14942. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14943. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14944. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14945. /*
  14946. ***************************************************************************
  14947. *
  14948. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14949. *
  14950. ***************************************************************************
  14951. *
  14952. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14953. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14954. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14955. * written into the Host memory region mentioned below.
  14956. *
  14957. * Read index is updated by the Host. At any point of time, the read index will
  14958. * indicate the index that will next be read by the Host. The read index is
  14959. * in units of bytes offset from the base of the meta-data buffer.
  14960. *
  14961. * Write index is updated by the FW. At any point of time, the write index will
  14962. * indicate from where the FW can start writing any new data. The write index is
  14963. * in units of bytes offset from the base of the meta-data buffer.
  14964. *
  14965. * If the Host is not fast enough in reading the CFR data, any new capture data
  14966. * would be dropped if there is no space left to write the new captures.
  14967. *
  14968. * The last 4 bytes of the memory region will have the magic pattern
  14969. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14970. * not overrun the host buffer.
  14971. *
  14972. * ,--------------------. read and write indices store the
  14973. * | | byte offset from the base of the
  14974. * | ,--------+--------. meta-data buffer to the next
  14975. * | | | | location within the data buffer
  14976. * | | v v that will be read / written
  14977. * ************************************************************************
  14978. * * Read * Write * * Magic *
  14979. * * index * index * CFR data1 ...... CFR data N * pattern *
  14980. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14981. * ************************************************************************
  14982. * |<---------- data buffer ---------->|
  14983. *
  14984. * |<----------------- meta-data buffer allocated in Host ----------------|
  14985. *
  14986. * Note:
  14987. * - Considering the 4 bytes needed to store the Read index (R) and the
  14988. * Write index (W), the initial value is as follows:
  14989. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14990. * - Buffer empty condition:
  14991. * R = W
  14992. *
  14993. * Regarding CFR data format:
  14994. * --------------------------
  14995. *
  14996. * Each CFR tone is stored in HW as 16-bits with the following format:
  14997. * {bits[15:12], bits[11:6], bits[5:0]} =
  14998. * {unsigned exponent (4 bits),
  14999. * signed mantissa_real (6 bits),
  15000. * signed mantissa_imag (6 bits)}
  15001. *
  15002. * CFR_real = mantissa_real * 2^(exponent-5)
  15003. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15004. *
  15005. *
  15006. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15007. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15008. *
  15009. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15010. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15011. * .
  15012. * .
  15013. * .
  15014. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15015. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15016. */
  15017. /* Bandwidth of peer CFR captures */
  15018. typedef enum {
  15019. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15020. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15021. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15022. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15023. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15024. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15025. } HTT_PEER_CFR_CAPTURE_BW;
  15026. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15027. * was captured
  15028. */
  15029. typedef enum {
  15030. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15031. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15032. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15033. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15034. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15035. } HTT_PEER_CFR_CAPTURE_MODE;
  15036. typedef enum {
  15037. /* This message type is currently used for the below purpose:
  15038. *
  15039. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15040. * wmi_peer_cfr_capture_cmd.
  15041. * If payload_present bit is set to 0 then the associated memory region
  15042. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15043. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15044. * message; the CFR dump will be present at the end of the message,
  15045. * after the chan_phy_mode.
  15046. */
  15047. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15048. /* Always keep this last */
  15049. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15050. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15051. /**
  15052. * @brief target -> host CFR dump completion indication message definition
  15053. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15054. *
  15055. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15056. *
  15057. * @details
  15058. * The following diagram shows the format of the Channel Frequency Response
  15059. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15060. * the channel capture of a peer is copied by Firmware into the Host memory
  15061. *
  15062. * **************************************************************************
  15063. *
  15064. * Message format when the CFR capture message type is
  15065. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15066. *
  15067. * **************************************************************************
  15068. *
  15069. * |31 16|15 |8|7 0|
  15070. * |----------------------------------------------------------------|
  15071. * header: | reserved |P| msg_type |
  15072. * word 0 | | | |
  15073. * |----------------------------------------------------------------|
  15074. * payload: | cfr_capture_msg_type |
  15075. * word 1 | |
  15076. * |----------------------------------------------------------------|
  15077. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15078. * word 2 | | | | | | | | |
  15079. * |----------------------------------------------------------------|
  15080. * | mac_addr31to0 |
  15081. * word 3 | |
  15082. * |----------------------------------------------------------------|
  15083. * | unused / reserved | mac_addr47to32 |
  15084. * word 4 | | |
  15085. * |----------------------------------------------------------------|
  15086. * | index |
  15087. * word 5 | |
  15088. * |----------------------------------------------------------------|
  15089. * | length |
  15090. * word 6 | |
  15091. * |----------------------------------------------------------------|
  15092. * | timestamp |
  15093. * word 7 | |
  15094. * |----------------------------------------------------------------|
  15095. * | counter |
  15096. * word 8 | |
  15097. * |----------------------------------------------------------------|
  15098. * | chan_mhz |
  15099. * word 9 | |
  15100. * |----------------------------------------------------------------|
  15101. * | band_center_freq1 |
  15102. * word 10 | |
  15103. * |----------------------------------------------------------------|
  15104. * | band_center_freq2 |
  15105. * word 11 | |
  15106. * |----------------------------------------------------------------|
  15107. * | chan_phy_mode |
  15108. * word 12 | |
  15109. * |----------------------------------------------------------------|
  15110. * where,
  15111. * P - payload present bit (payload_present explained below)
  15112. * req_id - memory request id (mem_req_id explained below)
  15113. * S - status field (status explained below)
  15114. * capbw - capture bandwidth (capture_bw explained below)
  15115. * mode - mode of capture (mode explained below)
  15116. * sts - space time streams (sts_count explained below)
  15117. * chbw - channel bandwidth (channel_bw explained below)
  15118. * captype - capture type (cap_type explained below)
  15119. *
  15120. * The following field definitions describe the format of the CFR dump
  15121. * completion indication sent from the target to the host
  15122. *
  15123. * Header fields:
  15124. *
  15125. * Word 0
  15126. * - msg_type
  15127. * Bits 7:0
  15128. * Purpose: Identifies this as CFR TX completion indication
  15129. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15130. * - payload_present
  15131. * Bit 8
  15132. * Purpose: Identifies how CFR data is sent to host
  15133. * Value: 0 - If CFR Payload is written to host memory
  15134. * 1 - If CFR Payload is sent as part of HTT message
  15135. * (This is the requirement for SDIO/USB where it is
  15136. * not possible to write CFR data to host memory)
  15137. * - reserved
  15138. * Bits 31:9
  15139. * Purpose: Reserved
  15140. * Value: 0
  15141. *
  15142. * Payload fields:
  15143. *
  15144. * Word 1
  15145. * - cfr_capture_msg_type
  15146. * Bits 31:0
  15147. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15148. * to specify the format used for the remainder of the message
  15149. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15150. * (currently only MSG_TYPE_1 is defined)
  15151. *
  15152. * Word 2
  15153. * - mem_req_id
  15154. * Bits 6:0
  15155. * Purpose: Contain the mem request id of the region where the CFR capture
  15156. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15157. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15158. this value is invalid)
  15159. * - status
  15160. * Bit 7
  15161. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15162. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15163. * - capture_bw
  15164. * Bits 10:8
  15165. * Purpose: Carry the bandwidth of the CFR capture
  15166. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15167. * - mode
  15168. * Bits 13:11
  15169. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15170. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15171. * - sts_count
  15172. * Bits 16:14
  15173. * Purpose: Carry the number of space time streams
  15174. * Value: Number of space time streams
  15175. * - channel_bw
  15176. * Bits 19:17
  15177. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15178. * measurement
  15179. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15180. * - cap_type
  15181. * Bits 23:20
  15182. * Purpose: Carry the type of the capture
  15183. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15184. * - vdev_id
  15185. * Bits 31:24
  15186. * Purpose: Carry the virtual device id
  15187. * Value: vdev ID
  15188. *
  15189. * Word 3
  15190. * - mac_addr31to0
  15191. * Bits 31:0
  15192. * Purpose: Contain the bits 31:0 of the peer MAC address
  15193. * Value: Bits 31:0 of the peer MAC address
  15194. *
  15195. * Word 4
  15196. * - mac_addr47to32
  15197. * Bits 15:0
  15198. * Purpose: Contain the bits 47:32 of the peer MAC address
  15199. * Value: Bits 47:32 of the peer MAC address
  15200. *
  15201. * Word 5
  15202. * - index
  15203. * Bits 31:0
  15204. * Purpose: Contain the index at which this CFR dump was written in the Host
  15205. * allocated memory. This index is the number of bytes from the base address.
  15206. * Value: Index position
  15207. *
  15208. * Word 6
  15209. * - length
  15210. * Bits 31:0
  15211. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15212. * Value: Length of the CFR capture of the peer
  15213. *
  15214. * Word 7
  15215. * - timestamp
  15216. * Bits 31:0
  15217. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15218. * clock used for this timestamp is private to the target and not visible to
  15219. * the host i.e., Host can interpret only the relative timestamp deltas from
  15220. * one message to the next, but can't interpret the absolute timestamp from a
  15221. * single message.
  15222. * Value: Timestamp in microseconds
  15223. *
  15224. * Word 8
  15225. * - counter
  15226. * Bits 31:0
  15227. * Purpose: Carry the count of the current CFR capture from FW. This is
  15228. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15229. * in host memory)
  15230. * Value: Count of the current CFR capture
  15231. *
  15232. * Word 9
  15233. * - chan_mhz
  15234. * Bits 31:0
  15235. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15236. * Value: Primary 20 channel frequency
  15237. *
  15238. * Word 10
  15239. * - band_center_freq1
  15240. * Bits 31:0
  15241. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15242. * Value: Center frequency 1 in MHz
  15243. *
  15244. * Word 11
  15245. * - band_center_freq2
  15246. * Bits 31:0
  15247. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15248. * the VDEV
  15249. * 80plus80 mode
  15250. * Value: Center frequency 2 in MHz
  15251. *
  15252. * Word 12
  15253. * - chan_phy_mode
  15254. * Bits 31:0
  15255. * Purpose: Carry the phy mode of the channel, of the VDEV
  15256. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15257. */
  15258. PREPACK struct htt_cfr_dump_ind_type_1 {
  15259. A_UINT32 mem_req_id:7,
  15260. status:1,
  15261. capture_bw:3,
  15262. mode:3,
  15263. sts_count:3,
  15264. channel_bw:3,
  15265. cap_type:4,
  15266. vdev_id:8;
  15267. htt_mac_addr addr;
  15268. A_UINT32 index;
  15269. A_UINT32 length;
  15270. A_UINT32 timestamp;
  15271. A_UINT32 counter;
  15272. struct htt_chan_change_msg chan;
  15273. } POSTPACK;
  15274. PREPACK struct htt_cfr_dump_compl_ind {
  15275. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15276. union {
  15277. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15278. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15279. /* If there is a need to change the memory layout and its associated
  15280. * HTT indication format, a new CFR capture message type can be
  15281. * introduced and added into this union.
  15282. */
  15283. };
  15284. } POSTPACK;
  15285. /*
  15286. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15287. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15288. */
  15289. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15290. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15291. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15292. do { \
  15293. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15294. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15295. } while(0)
  15296. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15297. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15298. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15299. /*
  15300. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15301. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15302. */
  15303. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15304. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15305. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15306. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15307. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15308. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15309. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15310. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15311. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15312. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15313. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15314. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15315. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15316. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15317. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15318. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15319. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15320. do { \
  15321. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15322. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15323. } while (0)
  15324. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15325. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15326. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15327. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15328. do { \
  15329. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15330. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15331. } while (0)
  15332. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15333. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15334. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15335. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15336. do { \
  15337. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15338. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15339. } while (0)
  15340. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15341. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15342. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15343. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15344. do { \
  15345. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15346. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15347. } while (0)
  15348. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15349. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15350. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15351. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15352. do { \
  15353. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15354. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15355. } while (0)
  15356. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15357. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15358. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15359. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15360. do { \
  15361. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15362. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15363. } while (0)
  15364. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15365. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15366. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15367. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15368. do { \
  15369. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15370. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15371. } while (0)
  15372. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15373. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15374. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15375. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15376. do { \
  15377. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15378. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15379. } while (0)
  15380. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15381. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15382. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15383. /**
  15384. * @brief target -> host peer (PPDU) stats message
  15385. *
  15386. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15387. *
  15388. * @details
  15389. * This message is generated by FW when FW is sending stats to host
  15390. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15391. * This message is sent autonomously by the target rather than upon request
  15392. * by the host.
  15393. * The following field definitions describe the format of the HTT target
  15394. * to host peer stats indication message.
  15395. *
  15396. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15397. * or more PPDU stats records.
  15398. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15399. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15400. * then the message would start with the
  15401. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15402. * below.
  15403. *
  15404. * |31 16|15|14|13 11|10 9|8|7 0|
  15405. * |-------------------------------------------------------------|
  15406. * | reserved |MSG_TYPE |
  15407. * |-------------------------------------------------------------|
  15408. * rec 0 | TLV header |
  15409. * rec 0 |-------------------------------------------------------------|
  15410. * rec 0 | ppdu successful bytes |
  15411. * rec 0 |-------------------------------------------------------------|
  15412. * rec 0 | ppdu retry bytes |
  15413. * rec 0 |-------------------------------------------------------------|
  15414. * rec 0 | ppdu failed bytes |
  15415. * rec 0 |-------------------------------------------------------------|
  15416. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15417. * rec 0 |-------------------------------------------------------------|
  15418. * rec 0 | retried MSDUs | successful MSDUs |
  15419. * rec 0 |-------------------------------------------------------------|
  15420. * rec 0 | TX duration | failed MSDUs |
  15421. * rec 0 |-------------------------------------------------------------|
  15422. * ...
  15423. * |-------------------------------------------------------------|
  15424. * rec N | TLV header |
  15425. * rec N |-------------------------------------------------------------|
  15426. * rec N | ppdu successful bytes |
  15427. * rec N |-------------------------------------------------------------|
  15428. * rec N | ppdu retry bytes |
  15429. * rec N |-------------------------------------------------------------|
  15430. * rec N | ppdu failed bytes |
  15431. * rec N |-------------------------------------------------------------|
  15432. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15433. * rec N |-------------------------------------------------------------|
  15434. * rec N | retried MSDUs | successful MSDUs |
  15435. * rec N |-------------------------------------------------------------|
  15436. * rec N | TX duration | failed MSDUs |
  15437. * rec N |-------------------------------------------------------------|
  15438. *
  15439. * where:
  15440. * A = is A-MPDU flag
  15441. * BA = block-ack failure flags
  15442. * BW = bandwidth spec
  15443. * SG = SGI enabled spec
  15444. * S = skipped rate ctrl
  15445. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15446. *
  15447. * Header
  15448. * ------
  15449. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15450. * dword0 - b'8:31 - reserved : Reserved for future use
  15451. *
  15452. * payload include below peer_stats information
  15453. * --------------------------------------------
  15454. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15455. * @tx_success_bytes : total successful bytes in the PPDU.
  15456. * @tx_retry_bytes : total retried bytes in the PPDU.
  15457. * @tx_failed_bytes : total failed bytes in the PPDU.
  15458. * @tx_ratecode : rate code used for the PPDU.
  15459. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15460. * @ba_ack_failed : BA/ACK failed for this PPDU
  15461. * b00 -> BA received
  15462. * b01 -> BA failed once
  15463. * b10 -> BA failed twice, when HW retry is enabled.
  15464. * @bw : BW
  15465. * b00 -> 20 MHz
  15466. * b01 -> 40 MHz
  15467. * b10 -> 80 MHz
  15468. * b11 -> 160 MHz (or 80+80)
  15469. * @sg : SGI enabled
  15470. * @s : skipped ratectrl
  15471. * @peer_id : peer id
  15472. * @tx_success_msdus : successful MSDUs
  15473. * @tx_retry_msdus : retried MSDUs
  15474. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15475. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15476. */
  15477. /**
  15478. * @brief target -> host backpressure event
  15479. *
  15480. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15481. *
  15482. * @details
  15483. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15484. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15485. * This message will only be sent if the backpressure condition has existed
  15486. * continuously for an initial period (100 ms).
  15487. * Repeat messages with updated information will be sent after each
  15488. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15489. * This message indicates the ring id along with current head and tail index
  15490. * locations (i.e. write and read indices).
  15491. * The backpressure time indicates the time in ms for which continous
  15492. * backpressure has been observed in the ring.
  15493. *
  15494. * The message format is as follows:
  15495. *
  15496. * |31 24|23 16|15 8|7 0|
  15497. * |----------------+----------------+----------------+----------------|
  15498. * | ring_id | ring_type | pdev_id | msg_type |
  15499. * |-------------------------------------------------------------------|
  15500. * | tail_idx | head_idx |
  15501. * |-------------------------------------------------------------------|
  15502. * | backpressure_time_ms |
  15503. * |-------------------------------------------------------------------|
  15504. *
  15505. * The message is interpreted as follows:
  15506. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15507. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15508. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15509. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15510. the msg is for LMAC ring.
  15511. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15512. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15513. * htt_backpressure_lmac_ring_id. This represents
  15514. * the ring id for which continous backpressure is seen
  15515. *
  15516. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15517. * the ring indicated by the ring_id
  15518. *
  15519. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15520. * the ring indicated by the ring id
  15521. *
  15522. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15523. * backpressure has been seen in the ring
  15524. * indicated by the ring_id.
  15525. * Units = milliseconds
  15526. */
  15527. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15528. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15529. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15530. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15531. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15532. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15533. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15534. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15535. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15536. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15537. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15538. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15539. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15540. do { \
  15541. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15542. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15543. } while (0)
  15544. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15545. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15546. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15547. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15548. do { \
  15549. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15550. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15551. } while (0)
  15552. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15553. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15554. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15555. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15556. do { \
  15557. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15558. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15559. } while (0)
  15560. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15561. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15562. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15563. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15564. do { \
  15565. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15566. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15567. } while (0)
  15568. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15569. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15570. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15571. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15572. do { \
  15573. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15574. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15575. } while (0)
  15576. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15577. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15578. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15579. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15580. do { \
  15581. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15582. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15583. } while (0)
  15584. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15585. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15586. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15587. enum htt_backpressure_ring_type {
  15588. HTT_SW_RING_TYPE_UMAC,
  15589. HTT_SW_RING_TYPE_LMAC,
  15590. HTT_SW_RING_TYPE_MAX,
  15591. };
  15592. /* Ring id for which the message is sent to host */
  15593. enum htt_backpressure_umac_ringid {
  15594. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15595. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15596. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15597. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15598. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15599. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15600. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15601. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15602. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15603. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15604. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15605. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15606. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15607. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15608. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15609. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15610. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15611. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15612. HTT_SW_UMAC_RING_IDX_MAX,
  15613. };
  15614. enum htt_backpressure_lmac_ringid {
  15615. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15616. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15617. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15618. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15619. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15620. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15621. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15622. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15623. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15624. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15625. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15626. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15627. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15628. HTT_SW_LMAC_RING_IDX_MAX,
  15629. };
  15630. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15631. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15632. pdev_id: 8,
  15633. ring_type: 8, /* htt_backpressure_ring_type */
  15634. /*
  15635. * ring_id holds an enum value from either
  15636. * htt_backpressure_umac_ringid or
  15637. * htt_backpressure_lmac_ringid, based on
  15638. * the ring_type setting.
  15639. */
  15640. ring_id: 8;
  15641. A_UINT16 head_idx;
  15642. A_UINT16 tail_idx;
  15643. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15644. } POSTPACK;
  15645. /*
  15646. * Defines two 32 bit words that can be used by the target to indicate a per
  15647. * user RU allocation and rate information.
  15648. *
  15649. * This information is currently provided in the "sw_response_reference_ptr"
  15650. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15651. * "rx_ppdu_end_user_stats" TLV.
  15652. *
  15653. * VALID:
  15654. * The consumer of these words must explicitly check the valid bit,
  15655. * and only attempt interpretation of any of the remaining fields if
  15656. * the valid bit is set to 1.
  15657. *
  15658. * VERSION:
  15659. * The consumer of these words must also explicitly check the version bit,
  15660. * and only use the V0 definition if the VERSION field is set to 0.
  15661. *
  15662. * Version 1 is currently undefined, with the exception of the VALID and
  15663. * VERSION fields.
  15664. *
  15665. * Version 0:
  15666. *
  15667. * The fields below are duplicated per BW.
  15668. *
  15669. * The consumer must determine which BW field to use, based on the UL OFDMA
  15670. * PPDU BW indicated by HW.
  15671. *
  15672. * RU_START: RU26 start index for the user.
  15673. * Note that this is always using the RU26 index, regardless
  15674. * of the actual RU assigned to the user
  15675. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15676. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15677. *
  15678. * For example, 20MHz (the value in the top row is RU_START)
  15679. *
  15680. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15681. * RU Size 1 (52): | | | | | |
  15682. * RU Size 2 (106): | | | |
  15683. * RU Size 3 (242): | |
  15684. *
  15685. * RU_SIZE: Indicates the RU size, as defined by enum
  15686. * htt_ul_ofdma_user_info_ru_size.
  15687. *
  15688. * LDPC: LDPC enabled (if 0, BCC is used)
  15689. *
  15690. * DCM: DCM enabled
  15691. *
  15692. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15693. * |---------------------------------+--------------------------------|
  15694. * |Ver|Valid| FW internal |
  15695. * |---------------------------------+--------------------------------|
  15696. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15697. * |---------------------------------+--------------------------------|
  15698. */
  15699. enum htt_ul_ofdma_user_info_ru_size {
  15700. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15701. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15702. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15703. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15704. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15705. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15706. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15707. };
  15708. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15709. struct htt_ul_ofdma_user_info_v0 {
  15710. A_UINT32 word0;
  15711. A_UINT32 word1;
  15712. };
  15713. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15714. A_UINT32 w0_fw_rsvd:30; \
  15715. A_UINT32 w0_valid:1; \
  15716. A_UINT32 w0_version:1;
  15717. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15718. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15719. };
  15720. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15721. A_UINT32 w1_nss:3; \
  15722. A_UINT32 w1_mcs:4; \
  15723. A_UINT32 w1_ldpc:1; \
  15724. A_UINT32 w1_dcm:1; \
  15725. A_UINT32 w1_ru_start:7; \
  15726. A_UINT32 w1_ru_size:3; \
  15727. A_UINT32 w1_trig_type:4; \
  15728. A_UINT32 w1_unused:9;
  15729. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15730. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15731. };
  15732. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15733. A_UINT32 w0_fw_rsvd:27; \
  15734. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15735. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15736. 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) */
  15737. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15738. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15739. };
  15740. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15741. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15742. A_UINT32 w1_trig_type:4; \
  15743. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15744. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15745. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15746. };
  15747. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15748. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15749. union {
  15750. A_UINT32 word0;
  15751. struct {
  15752. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15753. };
  15754. };
  15755. union {
  15756. A_UINT32 word1;
  15757. struct {
  15758. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15759. };
  15760. };
  15761. } POSTPACK;
  15762. /*
  15763. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15764. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15765. * this should be picked.
  15766. */
  15767. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15768. union {
  15769. A_UINT32 word0;
  15770. struct {
  15771. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15772. };
  15773. };
  15774. union {
  15775. A_UINT32 word1;
  15776. struct {
  15777. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15778. };
  15779. };
  15780. } POSTPACK;
  15781. enum HTT_UL_OFDMA_TRIG_TYPE {
  15782. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15783. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15784. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15785. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15786. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15787. };
  15788. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15789. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15790. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15791. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15792. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15793. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15794. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15795. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15796. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15797. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15798. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15799. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15800. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15801. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15802. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15803. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15804. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15805. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15806. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15807. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15808. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15809. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15810. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15811. /*--- word 0 ---*/
  15812. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15813. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15814. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15815. do { \
  15816. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15817. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15818. } while (0)
  15819. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15820. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15821. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15822. do { \
  15823. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15824. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15825. } while (0)
  15826. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15827. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15828. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15829. do { \
  15830. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15831. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15832. } while (0)
  15833. /*--- word 1 ---*/
  15834. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15835. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15836. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15837. do { \
  15838. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15839. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15840. } while (0)
  15841. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15842. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15843. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15844. do { \
  15845. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15846. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15847. } while (0)
  15848. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15849. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15850. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15851. do { \
  15852. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15853. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15854. } while (0)
  15855. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15856. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15857. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15858. do { \
  15859. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15860. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15861. } while (0)
  15862. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15863. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15864. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15865. do { \
  15866. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15867. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15868. } while (0)
  15869. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15870. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15871. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15872. do { \
  15873. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15874. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15875. } while (0)
  15876. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15877. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15878. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15879. do { \
  15880. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15881. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15882. } while (0)
  15883. /**
  15884. * @brief target -> host channel calibration data message
  15885. *
  15886. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15887. *
  15888. * @brief host -> target channel calibration data message
  15889. *
  15890. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15891. *
  15892. * @details
  15893. * The following field definitions describe the format of the channel
  15894. * calibration data message sent from the target to the host when
  15895. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15896. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15897. * The message is defined as htt_chan_caldata_msg followed by a variable
  15898. * number of 32-bit character values.
  15899. *
  15900. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15901. * |------------------------------------------------------------------|
  15902. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15903. * |------------------------------------------------------------------|
  15904. * | payload size | mhz |
  15905. * |------------------------------------------------------------------|
  15906. * | center frequency 2 | center frequency 1 |
  15907. * |------------------------------------------------------------------|
  15908. * | check sum |
  15909. * |------------------------------------------------------------------|
  15910. * | payload |
  15911. * |------------------------------------------------------------------|
  15912. * message info field:
  15913. * - MSG_TYPE
  15914. * Bits 7:0
  15915. * Purpose: identifies this as a channel calibration data message
  15916. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15917. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15918. * - SUB_TYPE
  15919. * Bits 11:8
  15920. * Purpose: T2H: indicates whether target is providing chan cal data
  15921. * to the host to store, or requesting that the host
  15922. * download previously-stored data.
  15923. * H2T: indicates whether the host is providing the requested
  15924. * channel cal data, or if it is rejecting the data
  15925. * request because it does not have the requested data.
  15926. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15927. * - CHKSUM_VALID
  15928. * Bit 12
  15929. * Purpose: indicates if the checksum field is valid
  15930. * value:
  15931. * - FRAG
  15932. * Bit 19:16
  15933. * Purpose: indicates the fragment index for message
  15934. * value: 0 for first fragment, 1 for second fragment, ...
  15935. * - APPEND
  15936. * Bit 20
  15937. * Purpose: indicates if this is the last fragment
  15938. * value: 0 = final fragment, 1 = more fragments will be appended
  15939. *
  15940. * channel and payload size field
  15941. * - MHZ
  15942. * Bits 15:0
  15943. * Purpose: indicates the channel primary frequency
  15944. * Value:
  15945. * - PAYLOAD_SIZE
  15946. * Bits 31:16
  15947. * Purpose: indicates the bytes of calibration data in payload
  15948. * Value:
  15949. *
  15950. * center frequency field
  15951. * - CENTER FREQUENCY 1
  15952. * Bits 15:0
  15953. * Purpose: indicates the channel center frequency
  15954. * Value: channel center frequency, in MHz units
  15955. * - CENTER FREQUENCY 2
  15956. * Bits 31:16
  15957. * Purpose: indicates the secondary channel center frequency,
  15958. * only for 11acvht 80plus80 mode
  15959. * Value: secondary channel center frequeny, in MHz units, if applicable
  15960. *
  15961. * checksum field
  15962. * - CHECK_SUM
  15963. * Bits 31:0
  15964. * Purpose: check the payload data, it is just for this fragment.
  15965. * This is intended for the target to check that the channel
  15966. * calibration data returned by the host is the unmodified data
  15967. * that was previously provided to the host by the target.
  15968. * value: checksum of fragment payload
  15969. */
  15970. PREPACK struct htt_chan_caldata_msg {
  15971. /* DWORD 0: message info */
  15972. A_UINT32
  15973. msg_type: 8,
  15974. sub_type: 4 ,
  15975. chksum_valid: 1, /** 1:valid, 0:invalid */
  15976. reserved1: 3,
  15977. frag_idx: 4, /** fragment index for calibration data */
  15978. appending: 1, /** 0: no fragment appending,
  15979. * 1: extra fragment appending */
  15980. reserved2: 11;
  15981. /* DWORD 1: channel and payload size */
  15982. A_UINT32
  15983. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15984. payload_size: 16; /** unit: bytes */
  15985. /* DWORD 2: center frequency */
  15986. A_UINT32
  15987. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15988. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15989. * valid only for 11acvht 80plus80 mode */
  15990. /* DWORD 3: check sum */
  15991. A_UINT32 chksum;
  15992. /* variable length for calibration data */
  15993. A_UINT32 payload[1/* or more */];
  15994. } POSTPACK;
  15995. /* T2H SUBTYPE */
  15996. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15997. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15998. /* H2T SUBTYPE */
  15999. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16000. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16001. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16002. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16003. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16004. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16005. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16006. do { \
  16007. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16008. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16009. } while (0)
  16010. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16011. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16012. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16013. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16014. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16015. do { \
  16016. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16017. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16018. } while (0)
  16019. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16020. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16021. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16022. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16023. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16024. do { \
  16025. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16026. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16027. } while (0)
  16028. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16029. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16030. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16031. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16032. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16033. do { \
  16034. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16035. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16036. } while (0)
  16037. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16038. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16039. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16040. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16041. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16042. do { \
  16043. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16044. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16045. } while (0)
  16046. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16047. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16048. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16049. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16050. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16051. do { \
  16052. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16053. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16054. } while (0)
  16055. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16056. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16057. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16058. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16059. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16060. do { \
  16061. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16062. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16063. } while (0)
  16064. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16065. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16066. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16067. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16068. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16069. do { \
  16070. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16071. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16072. } while (0)
  16073. /**
  16074. * @brief target -> host FSE CMEM based send
  16075. *
  16076. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16077. *
  16078. * @details
  16079. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16080. * FSE placement in CMEM is enabled.
  16081. *
  16082. * This message sends the non-secure CMEM base address.
  16083. * It will be sent to host in response to message
  16084. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16085. * The message would appear as follows:
  16086. *
  16087. * |31 24|23 16|15 8|7 0|
  16088. * |----------------+----------------+----------------+----------------|
  16089. * | reserved | num_entries | msg_type |
  16090. * |----------------+----------------+----------------+----------------|
  16091. * | base_address_lo |
  16092. * |----------------+----------------+----------------+----------------|
  16093. * | base_address_hi |
  16094. * |-------------------------------------------------------------------|
  16095. *
  16096. * The message is interpreted as follows:
  16097. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16098. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16099. * b'8:15 - number_entries: Indicated the number of entries
  16100. * programmed.
  16101. * b'16:31 - reserved.
  16102. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16103. * CMEM base address
  16104. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16105. * CMEM base address
  16106. */
  16107. PREPACK struct htt_cmem_base_send_t {
  16108. A_UINT32 msg_type: 8,
  16109. num_entries: 8,
  16110. reserved: 16;
  16111. A_UINT32 base_address_lo;
  16112. A_UINT32 base_address_hi;
  16113. } POSTPACK;
  16114. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16115. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16116. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16117. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16118. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16119. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16120. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16121. do { \
  16122. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16123. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16124. } while (0)
  16125. /**
  16126. * @brief - HTT PPDU ID format
  16127. *
  16128. * @details
  16129. * The following field definitions describe the format of the PPDU ID.
  16130. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16131. *
  16132. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16133. * +--------------------------------------------------------------------------
  16134. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16135. * +--------------------------------------------------------------------------
  16136. *
  16137. * sch id :Schedule command id
  16138. * Bits [11 : 0] : monotonically increasing counter to track the
  16139. * PPDU posted to a specific transmit queue.
  16140. *
  16141. * hwq_id: Hardware Queue ID.
  16142. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16143. *
  16144. * mac_id: MAC ID
  16145. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16146. *
  16147. * seq_idx: Sequence index.
  16148. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16149. * a particular TXOP.
  16150. *
  16151. * tqm_cmd: HWSCH/TQM flag.
  16152. * Bit [23] : Always set to 0.
  16153. *
  16154. * seq_cmd_type: Sequence command type.
  16155. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16156. * Refer to enum HTT_STATS_FTYPE for values.
  16157. */
  16158. PREPACK struct htt_ppdu_id {
  16159. A_UINT32
  16160. sch_id: 12,
  16161. hwq_id: 5,
  16162. mac_id: 2,
  16163. seq_idx: 2,
  16164. reserved1: 2,
  16165. tqm_cmd: 1,
  16166. seq_cmd_type: 6,
  16167. reserved2: 2;
  16168. } POSTPACK;
  16169. #define HTT_PPDU_ID_SCH_ID_S 0
  16170. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16171. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16172. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16173. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16174. do { \
  16175. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16176. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16177. } while (0)
  16178. #define HTT_PPDU_ID_HWQ_ID_S 12
  16179. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16180. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16181. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16182. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16183. do { \
  16184. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16185. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16186. } while (0)
  16187. #define HTT_PPDU_ID_MAC_ID_S 17
  16188. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16189. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16190. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16191. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16192. do { \
  16193. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16194. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16195. } while (0)
  16196. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16197. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16198. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16199. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16200. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16201. do { \
  16202. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16203. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16204. } while (0)
  16205. #define HTT_PPDU_ID_TQM_CMD_S 23
  16206. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16207. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16208. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16209. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16210. do { \
  16211. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16212. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16213. } while (0)
  16214. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16215. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16216. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16217. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16218. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16219. do { \
  16220. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16221. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16222. } while (0)
  16223. /**
  16224. * @brief target -> RX PEER METADATA V0 format
  16225. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16226. * message from target, and will confirm to the target which peer metadata
  16227. * version to use in the wmi_init message.
  16228. *
  16229. * The following diagram shows the format of the RX PEER METADATA.
  16230. *
  16231. * |31 24|23 16|15 8|7 0|
  16232. * |-----------------------------------------------------------------------|
  16233. * | Reserved | VDEV ID | PEER ID |
  16234. * |-----------------------------------------------------------------------|
  16235. */
  16236. PREPACK struct htt_rx_peer_metadata_v0 {
  16237. A_UINT32
  16238. peer_id: 16,
  16239. vdev_id: 8,
  16240. reserved1: 8;
  16241. } POSTPACK;
  16242. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16243. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16244. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16245. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16246. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16247. do { \
  16248. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16249. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16250. } while (0)
  16251. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16252. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16253. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16254. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16255. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16256. do { \
  16257. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16258. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16259. } while (0)
  16260. /**
  16261. * @brief target -> RX PEER METADATA V1 format
  16262. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16263. * message from target, and will confirm to the target which peer metadata
  16264. * version to use in the wmi_init message.
  16265. *
  16266. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16267. *
  16268. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16269. * |-----------------------------------------------------------------------|
  16270. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16271. * |-----------------------------------------------------------------------|
  16272. */
  16273. PREPACK struct htt_rx_peer_metadata_v1 {
  16274. A_UINT32
  16275. peer_id: 13,
  16276. ml_peer_valid: 1,
  16277. reserved1: 2,
  16278. vdev_id: 8,
  16279. lmac_id: 2,
  16280. chip_id: 3,
  16281. reserved2: 3;
  16282. } POSTPACK;
  16283. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16284. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16285. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16286. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16287. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16288. do { \
  16289. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16290. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16291. } while (0)
  16292. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16293. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16294. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16295. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16296. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16297. do { \
  16298. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16299. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16300. } while (0)
  16301. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16302. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16303. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16304. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16305. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16306. do { \
  16307. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16308. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16309. } while (0)
  16310. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16311. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16312. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16313. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16314. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16315. do { \
  16316. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16317. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16318. } while (0)
  16319. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16320. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16321. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16322. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16323. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16324. do { \
  16325. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16326. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16327. } while (0)
  16328. /*
  16329. * In some systems, the host SW wants to specify priorities between
  16330. * different MSDU / flow queues within the same peer-TID.
  16331. * The below enums are used for the host to identify to the target
  16332. * which MSDU queue's priority it wants to adjust.
  16333. */
  16334. /*
  16335. * The MSDUQ index describe index of TCL HW, where each index is
  16336. * used for queuing particular types of MSDUs.
  16337. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16338. */
  16339. enum HTT_MSDUQ_INDEX {
  16340. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16341. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16342. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16343. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16344. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16345. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16346. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16347. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16348. HTT_MSDUQ_MAX_INDEX,
  16349. };
  16350. /* MSDU qtype definition */
  16351. enum HTT_MSDU_QTYPE {
  16352. /*
  16353. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16354. * relative priority. Instead, the relative priority of CRIT_0 versus
  16355. * CRIT_1 is controlled by the FW, through the configuration parameters
  16356. * it applies to the queues.
  16357. */
  16358. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16359. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16360. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16361. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16362. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16363. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16364. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16365. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16366. /* New MSDU_QTYPE should be added above this line */
  16367. /*
  16368. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16369. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16370. * any host/target message definitions. The QTYPE_MAX value can
  16371. * only be used internally within the host or within the target.
  16372. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16373. * it must regard the unexpected value as a default qtype value,
  16374. * or ignore it.
  16375. */
  16376. HTT_MSDU_QTYPE_MAX,
  16377. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16378. };
  16379. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16380. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16381. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16382. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16383. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16384. };
  16385. /**
  16386. * @brief target -> host mlo timestamp offset indication
  16387. *
  16388. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16389. *
  16390. * @details
  16391. * The following field definitions describe the format of the HTT target
  16392. * to host mlo timestamp offset indication message.
  16393. *
  16394. *
  16395. * |31 16|15 12|11 10|9 8|7 0 |
  16396. * |----------------------------------------------------------------------|
  16397. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16398. * |----------------------------------------------------------------------|
  16399. * | Sync time stamp lo in us |
  16400. * |----------------------------------------------------------------------|
  16401. * | Sync time stamp hi in us |
  16402. * |----------------------------------------------------------------------|
  16403. * | mlo time stamp offset lo in us |
  16404. * |----------------------------------------------------------------------|
  16405. * | mlo time stamp offset hi in us |
  16406. * |----------------------------------------------------------------------|
  16407. * | mlo time stamp offset clocks in clock ticks |
  16408. * |----------------------------------------------------------------------|
  16409. * |31 26|25 16|15 0 |
  16410. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16411. * | | compensation in clks | |
  16412. * |----------------------------------------------------------------------|
  16413. * |31 22|21 0 |
  16414. * | rsvd 3 | mlo time stamp comp timer period |
  16415. * |----------------------------------------------------------------------|
  16416. * The message is interpreted as follows:
  16417. *
  16418. * dword0 - b'0:7 - msg_type: This will be set to
  16419. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16420. * value: 0x28
  16421. *
  16422. * dword0 - b'9:8 - pdev_id
  16423. *
  16424. * dword0 - b'11:10 - chip_id
  16425. *
  16426. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16427. *
  16428. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16429. *
  16430. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16431. * which last sync interrupt was received
  16432. *
  16433. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16434. * which last sync interrupt was received
  16435. *
  16436. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16437. *
  16438. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16439. *
  16440. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16441. *
  16442. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16443. *
  16444. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16445. * for sub us resolution
  16446. *
  16447. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16448. *
  16449. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16450. * is applied, in us
  16451. *
  16452. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16453. */
  16454. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16455. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16456. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16457. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16458. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16459. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16460. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16461. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16462. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16463. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16464. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16465. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16466. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16467. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16468. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16469. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16470. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16471. do { \
  16472. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16473. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16474. } while (0)
  16475. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16476. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16477. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16478. do { \
  16479. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16480. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16481. } while (0)
  16482. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16483. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16484. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16485. do { \
  16486. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16487. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16488. } while (0)
  16489. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16490. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16491. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16492. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16493. do { \
  16494. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16495. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16496. } while (0)
  16497. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16498. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16499. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16500. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16501. do { \
  16502. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16503. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16504. } while (0)
  16505. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16506. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16507. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16508. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16509. do { \
  16510. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16511. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16512. } while (0)
  16513. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16514. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16515. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16516. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16517. do { \
  16518. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16519. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16520. } while (0)
  16521. typedef struct {
  16522. A_UINT32 msg_type: 8, /* bits 7:0 */
  16523. pdev_id: 2, /* bits 9:8 */
  16524. chip_id: 2, /* bits 11:10 */
  16525. reserved1: 4, /* bits 15:12 */
  16526. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16527. A_UINT32 sync_timestamp_lo_us;
  16528. A_UINT32 sync_timestamp_hi_us;
  16529. A_UINT32 mlo_timestamp_offset_lo_us;
  16530. A_UINT32 mlo_timestamp_offset_hi_us;
  16531. A_UINT32 mlo_timestamp_offset_clks;
  16532. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16533. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16534. reserved2: 6; /* bits 31:26 */
  16535. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16536. reserved3: 10; /* bits 31:22 */
  16537. } htt_t2h_mlo_offset_ind_t;
  16538. /*
  16539. * @brief target -> host VDEV TX RX STATS
  16540. *
  16541. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16542. *
  16543. * @details
  16544. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16545. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16546. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16547. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16548. * periodically by target even in the absence of any further HTT request
  16549. * messages from host.
  16550. *
  16551. * The message is formatted as follows:
  16552. *
  16553. * |31 16|15 8|7 0|
  16554. * |---------------------------------+----------------+----------------|
  16555. * | payload_size | pdev_id | msg_type |
  16556. * |---------------------------------+----------------+----------------|
  16557. * | reserved0 |
  16558. * |-------------------------------------------------------------------|
  16559. * | reserved1 |
  16560. * |-------------------------------------------------------------------|
  16561. * | reserved2 |
  16562. * |-------------------------------------------------------------------|
  16563. * | |
  16564. * | VDEV specific Tx Rx stats info |
  16565. * | |
  16566. * |-------------------------------------------------------------------|
  16567. *
  16568. * The message is interpreted as follows:
  16569. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16570. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16571. * b'8:15 - pdev_id
  16572. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16573. * message header fields (msg_type through reserved2)
  16574. * dword1 - b'0:31 - reserved0.
  16575. * dword2 - b'0:31 - reserved1.
  16576. * dword3 - b'0:31 - reserved2.
  16577. */
  16578. typedef struct {
  16579. A_UINT32 msg_type: 8,
  16580. pdev_id: 8,
  16581. payload_size: 16;
  16582. A_UINT32 reserved0;
  16583. A_UINT32 reserved1;
  16584. A_UINT32 reserved2;
  16585. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16586. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16587. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16588. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16589. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16590. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16591. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16592. do { \
  16593. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16594. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16595. } while (0)
  16596. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16597. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16598. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16599. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16600. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16601. do { \
  16602. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16603. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16604. } while (0)
  16605. /* SOC related stats */
  16606. typedef struct {
  16607. htt_tlv_hdr_t tlv_hdr;
  16608. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16609. * This can be due to either the peer is deleted or deletion is ongoing
  16610. * */
  16611. A_UINT32 inv_peers_msdu_drop_count_lo;
  16612. A_UINT32 inv_peers_msdu_drop_count_hi;
  16613. } htt_t2h_soc_txrx_stats_common_tlv;
  16614. /* VDEV HW Tx/Rx stats */
  16615. typedef struct {
  16616. htt_tlv_hdr_t tlv_hdr;
  16617. A_UINT32 vdev_id;
  16618. /* Rx msdu byte cnt */
  16619. A_UINT32 rx_msdu_byte_cnt_lo;
  16620. A_UINT32 rx_msdu_byte_cnt_hi;
  16621. /* Rx msdu cnt */
  16622. A_UINT32 rx_msdu_cnt_lo;
  16623. A_UINT32 rx_msdu_cnt_hi;
  16624. /* tx msdu byte cnt */
  16625. A_UINT32 tx_msdu_byte_cnt_lo;
  16626. A_UINT32 tx_msdu_byte_cnt_hi;
  16627. /* tx msdu cnt */
  16628. A_UINT32 tx_msdu_cnt_lo;
  16629. A_UINT32 tx_msdu_cnt_hi;
  16630. /* tx excessive retry discarded msdu cnt */
  16631. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16632. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16633. /* TX congestion ctrl msdu drop cnt */
  16634. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16635. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16636. /* discarded tx msdus cnt coz of time to live expiry */
  16637. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16638. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16639. /* tx excessive retry discarded msdu byte cnt */
  16640. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16641. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16642. /* TX congestion ctrl msdu drop byte cnt */
  16643. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16644. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16645. /* discarded tx msdus byte cnt coz of time to live expiry */
  16646. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16647. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16648. /* TQM bypass frame cnt */
  16649. A_UINT32 tqm_bypass_frame_cnt_lo;
  16650. A_UINT32 tqm_bypass_frame_cnt_hi;
  16651. /* TQM bypass byte cnt */
  16652. A_UINT32 tqm_bypass_byte_cnt_lo;
  16653. A_UINT32 tqm_bypass_byte_cnt_hi;
  16654. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16655. /*
  16656. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16657. *
  16658. * @details
  16659. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16660. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16661. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16662. * the default MSDU queues of each of the specified TIDs for the peer
  16663. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16664. * If the default MSDU queues of a given TID within the peer are not linked
  16665. * to a service class, the svc_class_id field for that TID will have a
  16666. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16667. * queues for that TID are not mapped to any service class.
  16668. *
  16669. * |31 16|15 8|7 0|
  16670. * |------------------------------+--------------+--------------|
  16671. * | peer ID | reserved | msg type |
  16672. * |------------------------------+--------------+------+-------|
  16673. * | reserved | svc class ID | TID |
  16674. * |------------------------------------------------------------|
  16675. * ...
  16676. * |------------------------------------------------------------|
  16677. * | reserved | svc class ID | TID |
  16678. * |------------------------------------------------------------|
  16679. * Header fields:
  16680. * dword0 - b'7:0 - msg_type: This will be set to
  16681. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16682. * b'31:16 - peer ID
  16683. * dword1 - b'7:0 - TID
  16684. * b'15:8 - svc class ID
  16685. * (dword2, etc. same format as dword1)
  16686. */
  16687. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16688. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16689. A_UINT32 msg_type :8,
  16690. reserved0 :8,
  16691. peer_id :16;
  16692. struct {
  16693. A_UINT32 tid :8,
  16694. svc_class_id :8,
  16695. reserved1 :16;
  16696. } tid_reports[1/*or more*/];
  16697. } POSTPACK;
  16698. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16699. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16700. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16701. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16702. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16703. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16704. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16705. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16706. do { \
  16707. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16708. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16709. } while (0)
  16710. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16711. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16712. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16713. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16714. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16715. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16716. do { \
  16717. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16718. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16719. } while (0)
  16720. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16721. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16722. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16723. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16724. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16725. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16726. do { \
  16727. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16728. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16729. } while (0)
  16730. /*
  16731. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16732. *
  16733. * @details
  16734. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16735. * flow if the flow is seen the associated service class is conveyed to the
  16736. * target via TCL Data Command. Target on the other hand internally creates the
  16737. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16738. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16739. * the newly created MSDUQ
  16740. *
  16741. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16742. * |------------------------------+------------------------+--------------|
  16743. * | peer ID | HTT qtype | msg type |
  16744. * |---------------------------------+--------------+--+---+-------+------|
  16745. * | reserved |AST list index|FO|WC | HLOS | remap|
  16746. * | | | | | TID | TID |
  16747. * |---------------------+------------------------------------------------|
  16748. * | reserved1 | tgt_opaque_id |
  16749. * |---------------------+------------------------------------------------|
  16750. *
  16751. * Header fields:
  16752. *
  16753. * dword0 - b'7:0 - msg_type: This will be set to
  16754. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16755. * b'15:8 - HTT qtype
  16756. * b'31:16 - peer ID
  16757. *
  16758. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16759. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16760. * hlos_tid : Common to Lithium and Beryllium
  16761. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16762. * TCL Data Command : Beryllium
  16763. * b10 - flow_override (FO), as sent by host in
  16764. * TCL Data Command: Beryllium
  16765. * b11:14 - ast_list_idx
  16766. * Array index into the list of extension AST entries
  16767. * (not the actual AST 16-bit index).
  16768. * The ast_list_idx is one-based, with the following
  16769. * range of values:
  16770. * - legacy targets supporting 16 user-defined
  16771. * MSDU queues: 1-2
  16772. * - legacy targets supporting 48 user-defined
  16773. * MSDU queues: 1-6
  16774. * - new targets: 0 (peer_id is used instead)
  16775. * Note that since ast_list_idx is one-based,
  16776. * the host will need to subtract 1 to use it as an
  16777. * index into a list of extension AST entries.
  16778. * b15:31 - reserved
  16779. *
  16780. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16781. * unique MSDUQ id in firmware
  16782. * b'24:31 - reserved1
  16783. */
  16784. PREPACK struct htt_t2h_sawf_msduq_event {
  16785. A_UINT32 msg_type : 8,
  16786. htt_qtype : 8,
  16787. peer_id :16;
  16788. A_UINT32 remap_tid : 4,
  16789. hlos_tid : 4,
  16790. who_classify_info_sel : 2,
  16791. flow_override : 1,
  16792. ast_list_idx : 4,
  16793. reserved :17;
  16794. A_UINT32 tgt_opaque_id :24,
  16795. reserved1 : 8;
  16796. } POSTPACK;
  16797. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16798. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16799. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16800. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16801. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16802. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16803. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16804. do { \
  16805. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16806. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16807. } while (0)
  16808. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16809. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16810. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16811. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16812. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16813. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16814. do { \
  16815. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16816. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16817. } while (0)
  16818. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16819. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16820. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16821. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16822. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16823. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16824. do { \
  16825. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16826. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16827. } while (0)
  16828. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16829. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16830. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16831. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16832. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16833. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16834. do { \
  16835. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16836. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16837. } while (0)
  16838. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16839. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16840. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16841. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16842. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16843. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16844. do { \
  16845. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16846. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16847. } while (0)
  16848. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16849. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16850. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16851. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16852. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16853. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16854. do { \
  16855. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16856. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16857. } while (0)
  16858. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  16859. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  16860. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  16861. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  16862. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  16863. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  16864. do { \
  16865. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  16866. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  16867. } while (0)
  16868. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  16869. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  16870. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  16871. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  16872. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  16873. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  16874. do { \
  16875. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  16876. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  16877. } while (0)
  16878. /**
  16879. * @brief target -> PPDU id format indication
  16880. *
  16881. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  16882. *
  16883. * @details
  16884. * The following field definitions describe the format of the HTT target
  16885. * to host PPDU ID format indication message.
  16886. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  16887. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  16888. * seq_idx :- Sequence control index of this PPDU.
  16889. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  16890. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  16891. * tqm_cmd:-
  16892. *
  16893. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  16894. * |--------------------------------------------------+------------------------|
  16895. * | rsvd0 | msg type |
  16896. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16897. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  16898. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16899. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  16900. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16901. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  16902. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16903. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  16904. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16905. * Where: OF = bit offset, NB = number of bits, V = valid
  16906. * The message is interpreted as follows:
  16907. *
  16908. * dword0 - b'7:0 - msg_type: This will be set to
  16909. * HTT_T2H_PPDU_ID_FMT_IND
  16910. * value: 0x30
  16911. *
  16912. * dword0 - b'31:8 - reserved
  16913. *
  16914. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  16915. *
  16916. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  16917. *
  16918. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  16919. *
  16920. * dword1 - b'15:11 - reserved for future use
  16921. *
  16922. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  16923. *
  16924. * dword1 - b'21:17 - number of bits in ring_id
  16925. *
  16926. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  16927. *
  16928. * dword1 - b'31:27 - reserved for future use
  16929. *
  16930. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  16931. *
  16932. * dword2 - b'5:1 - number of bits in sequence index
  16933. *
  16934. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  16935. *
  16936. * dword2 - b'15:11 - reserved for future use
  16937. *
  16938. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  16939. *
  16940. * dword2 - b'21:17 - number of bits in link_id
  16941. *
  16942. * dword2 - b'26:22 - offset of link_id (in number of bits)
  16943. *
  16944. * dword2 - b'31:27 - reserved for future use
  16945. *
  16946. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  16947. *
  16948. * dword3 - b'5:1 - number of bits in seq_cmd_type
  16949. *
  16950. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  16951. *
  16952. * dword3 - b'15:11 - reserved for future use
  16953. *
  16954. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  16955. *
  16956. * dword3 - b'21:17 - number of bits in tqm_cmd
  16957. *
  16958. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  16959. *
  16960. * dword3 - b'31:27 - reserved for future use
  16961. *
  16962. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  16963. *
  16964. * dword4 - b'5:1 - number of bits in mac_id
  16965. *
  16966. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  16967. *
  16968. * dword4 - b'15:11 - reserved for future use
  16969. *
  16970. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  16971. *
  16972. * dword4 - b'21:17 - number of bits in crc
  16973. *
  16974. * dword4 - b'26:22 - offset of crc (in number of bits)
  16975. *
  16976. * dword4 - b'31:27 - reserved for future use
  16977. *
  16978. */
  16979. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  16980. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  16981. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  16982. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  16983. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  16984. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  16985. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  16986. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  16987. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  16988. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  16989. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  16990. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  16991. /* macros for accessing lower 16 bits in dword */
  16992. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  16993. do { \
  16994. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  16995. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  16996. } while (0)
  16997. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  16998. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  16999. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17000. do { \
  17001. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17002. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17003. } while (0)
  17004. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17005. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17006. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17007. do { \
  17008. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17009. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17010. } while (0)
  17011. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17012. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17013. /* macros for accessing upper 16 bits in dword */
  17014. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17015. do { \
  17016. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17017. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17018. } while (0)
  17019. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17020. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17021. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17022. do { \
  17023. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17024. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17025. } while (0)
  17026. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17027. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17028. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17029. do { \
  17030. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17031. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17032. } while (0)
  17033. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17034. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17035. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17036. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17037. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17038. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17039. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17040. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17041. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17042. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17043. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17044. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17045. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17046. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17047. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17048. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17049. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17050. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17051. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17052. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17053. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17054. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17055. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17056. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17057. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17058. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17059. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17060. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17061. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17062. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17063. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17064. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17065. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17066. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17067. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17068. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17069. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17070. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17071. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17072. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17073. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17074. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17075. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17076. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17077. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17078. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17079. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17080. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17081. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17082. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17083. /* offsets in number dwords */
  17084. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17085. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17086. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17087. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17088. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17089. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17090. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17091. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17092. typedef struct {
  17093. A_UINT32 msg_type: 8, /* bits 7:0 */
  17094. rsvd0: 24;/* bits 31:8 */
  17095. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17096. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17097. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17098. rsvd1: 5, /* bits 15:11 */
  17099. ring_id_valid: 1, /* bits 16:16 */
  17100. ring_id_bits: 5, /* bits 21:17 */
  17101. ring_id_offset: 5, /* bits 26:22 */
  17102. rsvd2: 5; /* bits 31:27 */
  17103. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17104. seq_idx_bits: 5, /* bits 5:1 */
  17105. seq_idx_offset: 5, /* bits 10:6 */
  17106. rsvd3: 5, /* bits 15:11 */
  17107. link_id_valid: 1, /* bits 16:16 */
  17108. link_id_bits: 5, /* bits 21:17 */
  17109. link_id_offset: 5, /* bits 26:22 */
  17110. rsvd4: 5; /* bits 31:27 */
  17111. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17112. seq_cmd_type_bits: 5, /* bits 5:1 */
  17113. seq_cmd_type_offset: 5, /* bits 10:6 */
  17114. rsvd5: 5, /* bits 15:11 */
  17115. tqm_cmd_valid: 1, /* bits 16:16 */
  17116. tqm_cmd_bits: 5, /* bits 21:17 */
  17117. tqm_cmd_offset: 5, /* bits 26:12 */
  17118. rsvd6: 5; /* bits 31:27 */
  17119. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17120. mac_id_bits: 5, /* bits 5:1 */
  17121. mac_id_offset: 5, /* bits 10:6 */
  17122. rsvd8: 5, /* bits 15:11 */
  17123. crc_valid: 1, /* bits 16:16 */
  17124. crc_bits: 5, /* bits 21:17 */
  17125. crc_offset: 5, /* bits 26:12 */
  17126. rsvd9: 5; /* bits 31:27 */
  17127. } htt_t2h_ppdu_id_fmt_ind_t;
  17128. #endif