htt.h 764 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. */
  215. #define HTT_CURRENT_VERSION_MAJOR 3
  216. #define HTT_CURRENT_VERSION_MINOR 95
  217. #define HTT_NUM_TX_FRAG_DESC 1024
  218. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  219. #define HTT_CHECK_SET_VAL(field, val) \
  220. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  221. /* macros to assist in sign-extending fields from HTT messages */
  222. #define HTT_SIGN_BIT_MASK(field) \
  223. ((field ## _M + (1 << field ## _S)) >> 1)
  224. #define HTT_SIGN_BIT(_val, field) \
  225. (_val & HTT_SIGN_BIT_MASK(field))
  226. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  227. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  228. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  229. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  230. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  231. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  232. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  233. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  234. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  235. /*
  236. * TEMPORARY:
  237. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  238. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  239. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  240. * updated.
  241. */
  242. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  243. /*
  244. * TEMPORARY:
  245. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  246. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  247. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  248. * updated.
  249. */
  250. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  251. /*
  252. * htt_dbg_stats_type -
  253. * bit positions for each stats type within a stats type bitmask
  254. * The bitmask contains 24 bits.
  255. */
  256. enum htt_dbg_stats_type {
  257. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  258. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  259. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  260. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  261. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  262. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  263. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  264. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  265. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  266. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  267. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  268. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  269. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  270. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  271. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  272. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  273. /* bits 16-23 currently reserved */
  274. /* keep this last */
  275. HTT_DBG_NUM_STATS
  276. };
  277. /*=== HTT option selection TLVs ===
  278. * Certain HTT messages have alternatives or options.
  279. * For such cases, the host and target need to agree on which option to use.
  280. * Option specification TLVs can be appended to the VERSION_REQ and
  281. * VERSION_CONF messages to select options other than the default.
  282. * These TLVs are entirely optional - if they are not provided, there is a
  283. * well-defined default for each option. If they are provided, they can be
  284. * provided in any order. Each TLV can be present or absent independent of
  285. * the presence / absence of other TLVs.
  286. *
  287. * The HTT option selection TLVs use the following format:
  288. * |31 16|15 8|7 0|
  289. * |---------------------------------+----------------+----------------|
  290. * | value (payload) | length | tag |
  291. * |-------------------------------------------------------------------|
  292. * The value portion need not be only 2 bytes; it can be extended by any
  293. * integer number of 4-byte units. The total length of the TLV, including
  294. * the tag and length fields, must be a multiple of 4 bytes. The length
  295. * field specifies the total TLV size in 4-byte units. Thus, the typical
  296. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  297. * field, would store 0x1 in its length field, to show that the TLV occupies
  298. * a single 4-byte unit.
  299. */
  300. /*--- TLV header format - applies to all HTT option TLVs ---*/
  301. enum HTT_OPTION_TLV_TAGS {
  302. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  303. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  304. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  305. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  306. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  307. };
  308. PREPACK struct htt_option_tlv_header_t {
  309. A_UINT8 tag;
  310. A_UINT8 length;
  311. } POSTPACK;
  312. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  313. #define HTT_OPTION_TLV_TAG_S 0
  314. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  315. #define HTT_OPTION_TLV_LENGTH_S 8
  316. /*
  317. * value0 - 16 bit value field stored in word0
  318. * The TLV's value field may be longer than 2 bytes, in which case
  319. * the remainder of the value is stored in word1, word2, etc.
  320. */
  321. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  322. #define HTT_OPTION_TLV_VALUE0_S 16
  323. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  326. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  327. } while (0)
  328. #define HTT_OPTION_TLV_TAG_GET(word) \
  329. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  330. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  331. do { \
  332. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  333. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  334. } while (0)
  335. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  336. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  337. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  338. do { \
  339. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  340. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  341. } while (0)
  342. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  343. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  344. /*--- format of specific HTT option TLVs ---*/
  345. /*
  346. * HTT option TLV for specifying LL bus address size
  347. * Some chips require bus addresses used by the target to access buffers
  348. * within the host's memory to be 32 bits; others require bus addresses
  349. * used by the target to access buffers within the host's memory to be
  350. * 64 bits.
  351. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  352. * a suffix to the VERSION_CONF message to specify which bus address format
  353. * the target requires.
  354. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  355. * default to providing bus addresses to the target in 32-bit format.
  356. */
  357. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  358. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  359. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  360. };
  361. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  362. struct htt_option_tlv_header_t hdr;
  363. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  364. } POSTPACK;
  365. /*
  366. * HTT option TLV for specifying whether HL systems should indicate
  367. * over-the-air tx completion for individual frames, or should instead
  368. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  369. * requests an OTA tx completion for a particular tx frame.
  370. * This option does not apply to LL systems, where the TX_COMPL_IND
  371. * is mandatory.
  372. * This option is primarily intended for HL systems in which the tx frame
  373. * downloads over the host --> target bus are as slow as or slower than
  374. * the transmissions over the WLAN PHY. For cases where the bus is faster
  375. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  376. * and consquently will send one TX_COMPL_IND message that covers several
  377. * tx frames. For cases where the WLAN PHY is faster than the bus,
  378. * the target will end up transmitting very short A-MPDUs, and consequently
  379. * sending many TX_COMPL_IND messages, which each cover a very small number
  380. * of tx frames.
  381. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  382. * a suffix to the VERSION_REQ message to request whether the host desires to
  383. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  384. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  385. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  386. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  387. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  388. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  389. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  390. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  391. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  392. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  393. * TLV.
  394. */
  395. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  396. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  397. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  398. };
  399. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  400. struct htt_option_tlv_header_t hdr;
  401. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  402. } POSTPACK;
  403. /*
  404. * HTT option TLV for specifying how many tx queue groups the target
  405. * may establish.
  406. * This TLV specifies the maximum value the target may send in the
  407. * txq_group_id field of any TXQ_GROUP information elements sent by
  408. * the target to the host. This allows the host to pre-allocate an
  409. * appropriate number of tx queue group structs.
  410. *
  411. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  412. * a suffix to the VERSION_REQ message to specify whether the host supports
  413. * tx queue groups at all, and if so if there is any limit on the number of
  414. * tx queue groups that the host supports.
  415. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  416. * a suffix to the VERSION_CONF message. If the host has specified in the
  417. * VER_REQ message a limit on the number of tx queue groups the host can
  418. * supprt, the target shall limit its specification of the maximum tx groups
  419. * to be no larger than this host-specified limit.
  420. *
  421. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  422. * shall preallocate 4 tx queue group structs, and the target shall not
  423. * specify a txq_group_id larger than 3.
  424. */
  425. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  426. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  427. /*
  428. * values 1 through N specify the max number of tx queue groups
  429. * the sender supports
  430. */
  431. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  432. };
  433. /* TEMPORARY backwards-compatibility alias for a typo fix -
  434. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  435. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  436. * to support the old name (with the typo) until all references to the
  437. * old name are replaced with the new name.
  438. */
  439. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  440. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  441. struct htt_option_tlv_header_t hdr;
  442. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  443. } POSTPACK;
  444. /*
  445. * HTT option TLV for specifying whether the target supports an extended
  446. * version of the HTT tx descriptor. If the target provides this TLV
  447. * and specifies in the TLV that the target supports an extended version
  448. * of the HTT tx descriptor, the target must check the "extension" bit in
  449. * the HTT tx descriptor, and if the extension bit is set, to expect a
  450. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  451. * descriptor. Furthermore, the target must provide room for the HTT
  452. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  453. * This option is intended for systems where the host needs to explicitly
  454. * control the transmission parameters such as tx power for individual
  455. * tx frames.
  456. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  457. * as a suffix to the VERSION_CONF message to explicitly specify whether
  458. * the target supports the HTT tx MSDU extension descriptor.
  459. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  460. * by the host as lack of target support for the HTT tx MSDU extension
  461. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  462. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  463. * the HTT tx MSDU extension descriptor.
  464. * The host is not required to provide the HTT tx MSDU extension descriptor
  465. * just because the target supports it; the target must check the
  466. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  467. * extension descriptor is present.
  468. */
  469. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  470. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  471. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  472. };
  473. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  474. struct htt_option_tlv_header_t hdr;
  475. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  476. } POSTPACK;
  477. typedef struct {
  478. union {
  479. /* BIT [11 : 0] :- tag
  480. * BIT [23 : 12] :- length
  481. * BIT [31 : 24] :- reserved
  482. */
  483. A_UINT32 tag__length;
  484. /*
  485. * The following struct is not endian-portable.
  486. * It is suitable for use within the target, which is known to be
  487. * little-endian.
  488. * The host should use the above endian-portable macros to access
  489. * the tag and length bitfields in an endian-neutral manner.
  490. */
  491. struct {
  492. A_UINT32 tag : 12, /* BIT [11 : 0] */
  493. length : 12, /* BIT [23 : 12] */
  494. reserved : 8; /* BIT [31 : 24] */
  495. };
  496. };
  497. } htt_tlv_hdr_t;
  498. typedef enum {
  499. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  500. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  501. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  502. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  503. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  504. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  505. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  506. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  507. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  508. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  509. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  510. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  511. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  512. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  513. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  514. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  515. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  516. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  517. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  518. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  519. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  520. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  521. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  522. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  523. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  524. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  525. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  526. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  527. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  528. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  529. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  530. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  531. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  532. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  533. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  534. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  535. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  536. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  537. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  538. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  539. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  540. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  541. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  542. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  543. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  544. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  545. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  546. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  547. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  548. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  549. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  550. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  551. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  552. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  553. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  554. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  555. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  556. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  557. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  558. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  559. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  560. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  561. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  562. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  563. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  564. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  565. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  566. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  567. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  568. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  569. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  570. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  571. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  572. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  573. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  574. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  575. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  576. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  577. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  578. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  579. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  580. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  581. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  582. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  583. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  584. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  585. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  586. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  587. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  588. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  589. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  590. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  591. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  592. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  593. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  594. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  595. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  596. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  597. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  598. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  599. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  600. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  601. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  602. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  603. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  604. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  605. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  606. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  607. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  608. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  609. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  610. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  611. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  612. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  613. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  614. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  615. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  616. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  617. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  618. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  619. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  620. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  621. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  622. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  623. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  624. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  625. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  626. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  627. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  628. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  629. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  630. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  631. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  632. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  633. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  634. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  635. HTT_STATS_MAX_TAG,
  636. } htt_tlv_tag_t;
  637. #define HTT_STATS_TLV_TAG_M 0x00000fff
  638. #define HTT_STATS_TLV_TAG_S 0
  639. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  640. #define HTT_STATS_TLV_LENGTH_S 12
  641. #define HTT_STATS_TLV_TAG_GET(_var) \
  642. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  643. HTT_STATS_TLV_TAG_S)
  644. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  645. do { \
  646. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  647. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  648. } while (0)
  649. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  650. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  651. HTT_STATS_TLV_LENGTH_S)
  652. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  653. do { \
  654. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  655. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  656. } while (0)
  657. /*=== host -> target messages ===============================================*/
  658. enum htt_h2t_msg_type {
  659. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  660. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  661. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  662. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  663. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  664. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  665. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  666. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  667. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  668. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  669. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  670. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  671. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  672. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  673. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  674. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  675. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  676. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  677. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  678. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  679. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  680. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  681. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  682. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  683. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  684. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  685. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  686. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  687. /* keep this last */
  688. HTT_H2T_NUM_MSGS
  689. };
  690. /*
  691. * HTT host to target message type -
  692. * stored in bits 7:0 of the first word of the message
  693. */
  694. #define HTT_H2T_MSG_TYPE_M 0xff
  695. #define HTT_H2T_MSG_TYPE_S 0
  696. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  697. do { \
  698. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  699. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  700. } while (0)
  701. #define HTT_H2T_MSG_TYPE_GET(word) \
  702. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  703. /**
  704. * @brief host -> target version number request message definition
  705. *
  706. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  707. *
  708. *
  709. * |31 24|23 16|15 8|7 0|
  710. * |----------------+----------------+----------------+----------------|
  711. * | reserved | msg type |
  712. * |-------------------------------------------------------------------|
  713. * : option request TLV (optional) |
  714. * :...................................................................:
  715. *
  716. * The VER_REQ message may consist of a single 4-byte word, or may be
  717. * extended with TLVs that specify which HTT options the host is requesting
  718. * from the target.
  719. * The following option TLVs may be appended to the VER_REQ message:
  720. * - HL_SUPPRESS_TX_COMPL_IND
  721. * - HL_MAX_TX_QUEUE_GROUPS
  722. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  723. * may be appended to the VER_REQ message (but only one TLV of each type).
  724. *
  725. * Header fields:
  726. * - MSG_TYPE
  727. * Bits 7:0
  728. * Purpose: identifies this as a version number request message
  729. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  730. */
  731. #define HTT_VER_REQ_BYTES 4
  732. /* TBDXXX: figure out a reasonable number */
  733. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  734. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  735. /**
  736. * @brief HTT tx MSDU descriptor
  737. *
  738. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  739. *
  740. * @details
  741. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  742. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  743. * the target firmware needs for the FW's tx processing, particularly
  744. * for creating the HW msdu descriptor.
  745. * The same HTT tx descriptor is used for HL and LL systems, though
  746. * a few fields within the tx descriptor are used only by LL or
  747. * only by HL.
  748. * The HTT tx descriptor is defined in two manners: by a struct with
  749. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  750. * definitions.
  751. * The target should use the struct def, for simplicitly and clarity,
  752. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  753. * neutral. Specifically, the host shall use the get/set macros built
  754. * around the mask + shift defs.
  755. */
  756. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  757. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  758. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  759. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  760. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  761. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  762. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  763. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  764. #define HTT_TX_VDEV_ID_WORD 0
  765. #define HTT_TX_VDEV_ID_MASK 0x3f
  766. #define HTT_TX_VDEV_ID_SHIFT 16
  767. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  768. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  769. #define HTT_TX_MSDU_LEN_DWORD 1
  770. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  771. /*
  772. * HTT_VAR_PADDR macros
  773. * Allow physical / bus addresses to be either a single 32-bit value,
  774. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  775. */
  776. #define HTT_VAR_PADDR32(var_name) \
  777. A_UINT32 var_name
  778. #define HTT_VAR_PADDR64_LE(var_name) \
  779. struct { \
  780. /* little-endian: lo precedes hi */ \
  781. A_UINT32 lo; \
  782. A_UINT32 hi; \
  783. } var_name
  784. /*
  785. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  786. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  787. * addresses are stored in a XXX-bit field.
  788. * This macro is used to define both htt_tx_msdu_desc32_t and
  789. * htt_tx_msdu_desc64_t structs.
  790. */
  791. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  792. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  793. { \
  794. /* DWORD 0: flags and meta-data */ \
  795. A_UINT32 \
  796. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  797. \
  798. /* pkt_subtype - \
  799. * Detailed specification of the tx frame contents, extending the \
  800. * general specification provided by pkt_type. \
  801. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  802. * pkt_type | pkt_subtype \
  803. * ============================================================== \
  804. * 802.3 | bit 0:3 - Reserved \
  805. * | bit 4: 0x0 - Copy-Engine Classification Results \
  806. * | not appended to the HTT message \
  807. * | 0x1 - Copy-Engine Classification Results \
  808. * | appended to the HTT message in the \
  809. * | format: \
  810. * | [HTT tx desc, frame header, \
  811. * | CE classification results] \
  812. * | The CE classification results begin \
  813. * | at the next 4-byte boundary after \
  814. * | the frame header. \
  815. * ------------+------------------------------------------------- \
  816. * Eth2 | bit 0:3 - Reserved \
  817. * | bit 4: 0x0 - Copy-Engine Classification Results \
  818. * | not appended to the HTT message \
  819. * | 0x1 - Copy-Engine Classification Results \
  820. * | appended to the HTT message. \
  821. * | See the above specification of the \
  822. * | CE classification results location. \
  823. * ------------+------------------------------------------------- \
  824. * native WiFi | bit 0:3 - Reserved \
  825. * | bit 4: 0x0 - Copy-Engine Classification Results \
  826. * | not appended to the HTT message \
  827. * | 0x1 - Copy-Engine Classification Results \
  828. * | appended to the HTT message. \
  829. * | See the above specification of the \
  830. * | CE classification results location. \
  831. * ------------+------------------------------------------------- \
  832. * mgmt | 0x0 - 802.11 MAC header absent \
  833. * | 0x1 - 802.11 MAC header present \
  834. * ------------+------------------------------------------------- \
  835. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  836. * | 0x1 - 802.11 MAC header present \
  837. * | bit 1: 0x0 - allow aggregation \
  838. * | 0x1 - don't allow aggregation \
  839. * | bit 2: 0x0 - perform encryption \
  840. * | 0x1 - don't perform encryption \
  841. * | bit 3: 0x0 - perform tx classification / queuing \
  842. * | 0x1 - don't perform tx classification; \
  843. * | insert the frame into the "misc" \
  844. * | tx queue \
  845. * | bit 4: 0x0 - Copy-Engine Classification Results \
  846. * | not appended to the HTT message \
  847. * | 0x1 - Copy-Engine Classification Results \
  848. * | appended to the HTT message. \
  849. * | See the above specification of the \
  850. * | CE classification results location. \
  851. */ \
  852. pkt_subtype: 5, \
  853. \
  854. /* pkt_type - \
  855. * General specification of the tx frame contents. \
  856. * The htt_pkt_type enum should be used to specify and check the \
  857. * value of this field. \
  858. */ \
  859. pkt_type: 3, \
  860. \
  861. /* vdev_id - \
  862. * ID for the vdev that is sending this tx frame. \
  863. * For certain non-standard packet types, e.g. pkt_type == raw \
  864. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  865. * This field is used primarily for determining where to queue \
  866. * broadcast and multicast frames. \
  867. */ \
  868. vdev_id: 6, \
  869. /* ext_tid - \
  870. * The extended traffic ID. \
  871. * If the TID is unknown, the extended TID is set to \
  872. * HTT_TX_EXT_TID_INVALID. \
  873. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  874. * value of the QoS TID. \
  875. * If the tx frame is non-QoS data, then the extended TID is set to \
  876. * HTT_TX_EXT_TID_NON_QOS. \
  877. * If the tx frame is multicast or broadcast, then the extended TID \
  878. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  879. */ \
  880. ext_tid: 5, \
  881. \
  882. /* postponed - \
  883. * This flag indicates whether the tx frame has been downloaded to \
  884. * the target before but discarded by the target, and now is being \
  885. * downloaded again; or if this is a new frame that is being \
  886. * downloaded for the first time. \
  887. * This flag allows the target to determine the correct order for \
  888. * transmitting new vs. old frames. \
  889. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  890. * This flag only applies to HL systems, since in LL systems, \
  891. * the tx flow control is handled entirely within the target. \
  892. */ \
  893. postponed: 1, \
  894. \
  895. /* extension - \
  896. * This flag indicates whether a HTT tx MSDU extension descriptor \
  897. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  898. * \
  899. * 0x0 - no extension MSDU descriptor is present \
  900. * 0x1 - an extension MSDU descriptor immediately follows the \
  901. * regular MSDU descriptor \
  902. */ \
  903. extension: 1, \
  904. \
  905. /* cksum_offload - \
  906. * This flag indicates whether checksum offload is enabled or not \
  907. * for this frame. Target FW use this flag to turn on HW checksumming \
  908. * 0x0 - No checksum offload \
  909. * 0x1 - L3 header checksum only \
  910. * 0x2 - L4 checksum only \
  911. * 0x3 - L3 header checksum + L4 checksum \
  912. */ \
  913. cksum_offload: 2, \
  914. \
  915. /* tx_comp_req - \
  916. * This flag indicates whether Tx Completion \
  917. * from fw is required or not. \
  918. * This flag is only relevant if tx completion is not \
  919. * universally enabled. \
  920. * For all LL systems, tx completion is mandatory, \
  921. * so this flag will be irrelevant. \
  922. * For HL systems tx completion is optional, but HL systems in which \
  923. * the bus throughput exceeds the WLAN throughput will \
  924. * probably want to always use tx completion, and thus \
  925. * would not check this flag. \
  926. * This flag is required when tx completions are not used universally, \
  927. * but are still required for certain tx frames for which \
  928. * an OTA delivery acknowledgment is needed by the host. \
  929. * In practice, this would be for HL systems in which the \
  930. * bus throughput is less than the WLAN throughput. \
  931. * \
  932. * 0x0 - Tx Completion Indication from Fw not required \
  933. * 0x1 - Tx Completion Indication from Fw is required \
  934. */ \
  935. tx_compl_req: 1; \
  936. \
  937. \
  938. /* DWORD 1: MSDU length and ID */ \
  939. A_UINT32 \
  940. len: 16, /* MSDU length, in bytes */ \
  941. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  942. * and this id is used to calculate fragmentation \
  943. * descriptor pointer inside the target based on \
  944. * the base address, configured inside the target. \
  945. */ \
  946. \
  947. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  948. /* frags_desc_ptr - \
  949. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  950. * where the tx frame's fragments reside in memory. \
  951. * This field only applies to LL systems, since in HL systems the \
  952. * (degenerate single-fragment) fragmentation descriptor is created \
  953. * within the target. \
  954. */ \
  955. _paddr__frags_desc_ptr_; \
  956. \
  957. /* DWORD 3 (or 4): peerid, chanfreq */ \
  958. /* \
  959. * Peer ID : Target can use this value to know which peer-id packet \
  960. * destined to. \
  961. * It's intended to be specified by host in case of NAWDS. \
  962. */ \
  963. A_UINT16 peerid; \
  964. \
  965. /* \
  966. * Channel frequency: This identifies the desired channel \
  967. * frequency (in mhz) for tx frames. This is used by FW to help \
  968. * determine when it is safe to transmit or drop frames for \
  969. * off-channel operation. \
  970. * The default value of zero indicates to FW that the corresponding \
  971. * VDEV's home channel (if there is one) is the desired channel \
  972. * frequency. \
  973. */ \
  974. A_UINT16 chanfreq; \
  975. \
  976. /* Reason reserved is commented is increasing the htt structure size \
  977. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  978. * A_UINT32 reserved_dword3_bits0_31; \
  979. */ \
  980. } POSTPACK
  981. /* define a htt_tx_msdu_desc32_t type */
  982. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  983. /* define a htt_tx_msdu_desc64_t type */
  984. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  985. /*
  986. * Make htt_tx_msdu_desc_t be an alias for either
  987. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  988. */
  989. #if HTT_PADDR64
  990. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  991. #else
  992. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  993. #endif
  994. /* decriptor information for Management frame*/
  995. /*
  996. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  997. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  998. */
  999. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1000. extern A_UINT32 mgmt_hdr_len;
  1001. PREPACK struct htt_mgmt_tx_desc_t {
  1002. A_UINT32 msg_type;
  1003. #if HTT_PADDR64
  1004. A_UINT64 frag_paddr; /* DMAble address of the data */
  1005. #else
  1006. A_UINT32 frag_paddr; /* DMAble address of the data */
  1007. #endif
  1008. A_UINT32 desc_id; /* returned to host during completion
  1009. * to free the meory*/
  1010. A_UINT32 len; /* Fragment length */
  1011. A_UINT32 vdev_id; /* virtual device ID*/
  1012. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1013. } POSTPACK;
  1014. PREPACK struct htt_mgmt_tx_compl_ind {
  1015. A_UINT32 desc_id;
  1016. A_UINT32 status;
  1017. } POSTPACK;
  1018. /*
  1019. * This SDU header size comes from the summation of the following:
  1020. * 1. Max of:
  1021. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1022. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1023. * b. 802.11 header, for raw frames: 36 bytes
  1024. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1025. * QoS header, HT header)
  1026. * c. 802.3 header, for ethernet frames: 14 bytes
  1027. * (destination address, source address, ethertype / length)
  1028. * 2. Max of:
  1029. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1030. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1031. * 3. 802.1Q VLAN header: 4 bytes
  1032. * 4. LLC/SNAP header: 8 bytes
  1033. */
  1034. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1035. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1036. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1037. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1038. A_COMPILE_TIME_ASSERT(
  1039. htt_encap_hdr_size_max_check_nwifi,
  1040. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1041. A_COMPILE_TIME_ASSERT(
  1042. htt_encap_hdr_size_max_check_enet,
  1043. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1044. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1045. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1046. #define HTT_TX_HDR_SIZE_802_1Q 4
  1047. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1048. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1049. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1050. HTT_TX_HDR_SIZE_802_1Q + \
  1051. HTT_TX_HDR_SIZE_LLC_SNAP)
  1052. #define HTT_HL_TX_FRM_HDR_LEN \
  1053. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1054. #define HTT_LL_TX_FRM_HDR_LEN \
  1055. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1056. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1057. /* dword 0 */
  1058. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1059. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1060. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1061. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1062. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1063. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1064. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1065. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1066. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1067. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1068. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1069. #define HTT_TX_DESC_PKT_TYPE_S 13
  1070. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1071. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1072. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1073. #define HTT_TX_DESC_VDEV_ID_S 16
  1074. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1075. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1076. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1077. #define HTT_TX_DESC_EXT_TID_S 22
  1078. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1079. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1080. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1081. #define HTT_TX_DESC_POSTPONED_S 27
  1082. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1083. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1084. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1085. #define HTT_TX_DESC_EXTENSION_S 28
  1086. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1087. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1088. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1089. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1090. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1091. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1092. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1093. #define HTT_TX_DESC_TX_COMP_S 31
  1094. /* dword 1 */
  1095. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1096. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1097. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1098. #define HTT_TX_DESC_FRM_LEN_S 0
  1099. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1100. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1101. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1102. #define HTT_TX_DESC_FRM_ID_S 16
  1103. /* dword 2 */
  1104. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1105. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1106. /* for systems using 64-bit format for bus addresses */
  1107. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1108. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1109. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1110. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1111. /* for systems using 32-bit format for bus addresses */
  1112. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1113. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1114. /* dword 3 */
  1115. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1116. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1117. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1118. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1119. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1120. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1121. #if HTT_PADDR64
  1122. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1123. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1124. #else
  1125. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1126. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1127. #endif
  1128. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1129. #define HTT_TX_DESC_PEER_ID_S 0
  1130. /*
  1131. * TEMPORARY:
  1132. * The original definitions for the PEER_ID fields contained typos
  1133. * (with _DESC_PADDR appended to this PEER_ID field name).
  1134. * Retain deprecated original names for PEER_ID fields until all code that
  1135. * refers to them has been updated.
  1136. */
  1137. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1138. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1139. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1140. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1141. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1142. HTT_TX_DESC_PEER_ID_M
  1143. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1144. HTT_TX_DESC_PEER_ID_S
  1145. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1146. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1147. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1148. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1149. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1150. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1151. #if HTT_PADDR64
  1152. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1153. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1154. #else
  1155. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1156. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1157. #endif
  1158. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1159. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1160. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1161. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1162. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1163. do { \
  1164. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1165. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1166. } while (0)
  1167. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1168. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1169. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1170. do { \
  1171. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1172. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1173. } while (0)
  1174. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1175. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1176. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1177. do { \
  1178. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1179. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1180. } while (0)
  1181. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1182. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1183. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1184. do { \
  1185. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1186. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1187. } while (0)
  1188. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1189. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1190. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1191. do { \
  1192. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1193. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1194. } while (0)
  1195. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1196. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1197. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1198. do { \
  1199. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1200. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1201. } while (0)
  1202. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1203. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1204. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1205. do { \
  1206. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1207. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1208. } while (0)
  1209. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1210. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1211. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1212. do { \
  1213. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1214. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1215. } while (0)
  1216. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1217. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1218. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1219. do { \
  1220. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1221. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1222. } while (0)
  1223. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1224. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1225. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1226. do { \
  1227. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1228. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1229. } while (0)
  1230. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1231. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1232. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1233. do { \
  1234. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1235. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1236. } while (0)
  1237. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1238. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1239. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1240. do { \
  1241. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1242. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1243. } while (0)
  1244. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1245. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1246. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1247. do { \
  1248. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1249. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1250. } while (0)
  1251. /* enums used in the HTT tx MSDU extension descriptor */
  1252. enum {
  1253. htt_tx_guard_interval_regular = 0,
  1254. htt_tx_guard_interval_short = 1,
  1255. };
  1256. enum {
  1257. htt_tx_preamble_type_ofdm = 0,
  1258. htt_tx_preamble_type_cck = 1,
  1259. htt_tx_preamble_type_ht = 2,
  1260. htt_tx_preamble_type_vht = 3,
  1261. };
  1262. enum {
  1263. htt_tx_bandwidth_5MHz = 0,
  1264. htt_tx_bandwidth_10MHz = 1,
  1265. htt_tx_bandwidth_20MHz = 2,
  1266. htt_tx_bandwidth_40MHz = 3,
  1267. htt_tx_bandwidth_80MHz = 4,
  1268. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1269. };
  1270. /**
  1271. * @brief HTT tx MSDU extension descriptor
  1272. * @details
  1273. * If the target supports HTT tx MSDU extension descriptors, the host has
  1274. * the option of appending the following struct following the regular
  1275. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1276. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1277. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1278. * tx specs for each frame.
  1279. */
  1280. PREPACK struct htt_tx_msdu_desc_ext_t {
  1281. /* DWORD 0: flags */
  1282. A_UINT32
  1283. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1284. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1285. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1286. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1287. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1288. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1289. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1290. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1291. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1292. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1293. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1294. /* DWORD 1: tx power, tx rate, tx BW */
  1295. A_UINT32
  1296. /* pwr -
  1297. * Specify what power the tx frame needs to be transmitted at.
  1298. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1299. * The value needs to be appropriately sign-extended when extracting
  1300. * the value from the message and storing it in a variable that is
  1301. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1302. * automatically handles this sign-extension.)
  1303. * If the transmission uses multiple tx chains, this power spec is
  1304. * the total transmit power, assuming incoherent combination of
  1305. * per-chain power to produce the total power.
  1306. */
  1307. pwr: 8,
  1308. /* mcs_mask -
  1309. * Specify the allowable values for MCS index (modulation and coding)
  1310. * to use for transmitting the frame.
  1311. *
  1312. * For HT / VHT preamble types, this mask directly corresponds to
  1313. * the HT or VHT MCS indices that are allowed. For each bit N set
  1314. * within the mask, MCS index N is allowed for transmitting the frame.
  1315. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1316. * rates versus OFDM rates, so the host has the option of specifying
  1317. * that the target must transmit the frame with CCK or OFDM rates
  1318. * (not HT or VHT), but leaving the decision to the target whether
  1319. * to use CCK or OFDM.
  1320. *
  1321. * For CCK and OFDM, the bits within this mask are interpreted as
  1322. * follows:
  1323. * bit 0 -> CCK 1 Mbps rate is allowed
  1324. * bit 1 -> CCK 2 Mbps rate is allowed
  1325. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1326. * bit 3 -> CCK 11 Mbps rate is allowed
  1327. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1328. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1329. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1330. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1331. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1332. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1333. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1334. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1335. *
  1336. * The MCS index specification needs to be compatible with the
  1337. * bandwidth mask specification. For example, a MCS index == 9
  1338. * specification is inconsistent with a preamble type == VHT,
  1339. * Nss == 1, and channel bandwidth == 20 MHz.
  1340. *
  1341. * Furthermore, the host has only a limited ability to specify to
  1342. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1343. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1344. */
  1345. mcs_mask: 12,
  1346. /* nss_mask -
  1347. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1348. * Each bit in this mask corresponds to a Nss value:
  1349. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1350. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1351. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1352. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1353. * The values in the Nss mask must be suitable for the recipient, e.g.
  1354. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1355. * recipient which only supports 2x2 MIMO.
  1356. */
  1357. nss_mask: 4,
  1358. /* guard_interval -
  1359. * Specify a htt_tx_guard_interval enum value to indicate whether
  1360. * the transmission should use a regular guard interval or a
  1361. * short guard interval.
  1362. */
  1363. guard_interval: 1,
  1364. /* preamble_type_mask -
  1365. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1366. * may choose from for transmitting this frame.
  1367. * The bits in this mask correspond to the values in the
  1368. * htt_tx_preamble_type enum. For example, to allow the target
  1369. * to transmit the frame as either CCK or OFDM, this field would
  1370. * be set to
  1371. * (1 << htt_tx_preamble_type_ofdm) |
  1372. * (1 << htt_tx_preamble_type_cck)
  1373. */
  1374. preamble_type_mask: 4,
  1375. reserved1_31_29: 3; /* unused, set to 0x0 */
  1376. /* DWORD 2: tx chain mask, tx retries */
  1377. A_UINT32
  1378. /* chain_mask - specify which chains to transmit from */
  1379. chain_mask: 4,
  1380. /* retry_limit -
  1381. * Specify the maximum number of transmissions, including the
  1382. * initial transmission, to attempt before giving up if no ack
  1383. * is received.
  1384. * If the tx rate is specified, then all retries shall use the
  1385. * same rate as the initial transmission.
  1386. * If no tx rate is specified, the target can choose whether to
  1387. * retain the original rate during the retransmissions, or to
  1388. * fall back to a more robust rate.
  1389. */
  1390. retry_limit: 4,
  1391. /* bandwidth_mask -
  1392. * Specify what channel widths may be used for the transmission.
  1393. * A value of zero indicates "don't care" - the target may choose
  1394. * the transmission bandwidth.
  1395. * The bits within this mask correspond to the htt_tx_bandwidth
  1396. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1397. * The bandwidth_mask must be consistent with the preamble_type_mask
  1398. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1399. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1400. */
  1401. bandwidth_mask: 6,
  1402. reserved2_31_14: 18; /* unused, set to 0x0 */
  1403. /* DWORD 3: tx expiry time (TSF) LSBs */
  1404. A_UINT32 expire_tsf_lo;
  1405. /* DWORD 4: tx expiry time (TSF) MSBs */
  1406. A_UINT32 expire_tsf_hi;
  1407. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1408. } POSTPACK;
  1409. /* DWORD 0 */
  1410. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1411. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1412. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1413. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1425. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1426. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1427. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1428. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1429. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1430. /* DWORD 1 */
  1431. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1432. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1433. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1434. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1435. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1436. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1437. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1438. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1439. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1440. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1441. /* DWORD 2 */
  1442. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1443. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1444. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1445. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1446. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1447. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1448. /* DWORD 0 */
  1449. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1450. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1451. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1452. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1453. do { \
  1454. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1455. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1456. } while (0)
  1457. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1458. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1459. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1460. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1461. do { \
  1462. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1463. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1464. } while (0)
  1465. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1466. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1467. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1468. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1469. do { \
  1470. HTT_CHECK_SET_VAL( \
  1471. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1472. ((_var) |= ((_val) \
  1473. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1474. } while (0)
  1475. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1476. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1477. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1479. do { \
  1480. HTT_CHECK_SET_VAL( \
  1481. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1482. ((_var) |= ((_val) \
  1483. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1484. } while (0)
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1486. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1487. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1489. do { \
  1490. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1491. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1492. } while (0)
  1493. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1494. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1495. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1496. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1497. do { \
  1498. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1499. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1500. } while (0)
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1502. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1503. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1504. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1505. do { \
  1506. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1507. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1508. } while (0)
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1510. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1511. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1513. do { \
  1514. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1515. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1516. } while (0)
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1518. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1519. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1521. do { \
  1522. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1523. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1524. } while (0)
  1525. /* DWORD 1 */
  1526. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1527. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1528. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1529. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1530. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1531. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1532. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1533. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1534. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1535. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1536. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1537. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1538. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1539. do { \
  1540. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1541. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1542. } while (0)
  1543. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1544. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1545. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1546. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1547. do { \
  1548. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1549. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1550. } while (0)
  1551. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1552. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1553. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1554. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1555. do { \
  1556. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1557. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1558. } while (0)
  1559. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1560. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1561. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1562. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1563. do { \
  1564. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1565. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1566. } while (0)
  1567. /* DWORD 2 */
  1568. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1569. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1570. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1571. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1572. do { \
  1573. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1574. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1575. } while (0)
  1576. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1577. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1578. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1579. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1580. do { \
  1581. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1582. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1583. } while (0)
  1584. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1586. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1587. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1590. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1591. } while (0)
  1592. typedef enum {
  1593. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1594. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1595. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1596. } htt_11ax_ltf_subtype_t;
  1597. typedef enum {
  1598. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1599. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1600. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1601. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1602. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1603. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1604. } htt_tx_ext2_preamble_type_t;
  1605. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1606. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1607. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1608. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1613. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1614. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1615. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1616. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1617. /**
  1618. * @brief HTT tx MSDU extension descriptor v2
  1619. * @details
  1620. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1621. * is received as tcl_exit_base->host_meta_info in firmware.
  1622. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1623. * are already part of tcl_exit_base.
  1624. */
  1625. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1626. /* DWORD 0: flags */
  1627. A_UINT32
  1628. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1629. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1630. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1631. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1632. valid_retries : 1, /* if set, tx retries spec is valid */
  1633. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1634. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1635. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1636. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1637. valid_key_flags : 1, /* if set, key flags is valid */
  1638. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1639. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1640. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1641. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1642. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1643. 1 = ENCRYPT,
  1644. 2 ~ 3 - Reserved */
  1645. /* retry_limit -
  1646. * Specify the maximum number of transmissions, including the
  1647. * initial transmission, to attempt before giving up if no ack
  1648. * is received.
  1649. * If the tx rate is specified, then all retries shall use the
  1650. * same rate as the initial transmission.
  1651. * If no tx rate is specified, the target can choose whether to
  1652. * retain the original rate during the retransmissions, or to
  1653. * fall back to a more robust rate.
  1654. */
  1655. retry_limit : 4,
  1656. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1657. * Valid only for 11ax preamble types HE_SU
  1658. * and HE_EXT_SU
  1659. */
  1660. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1661. * Valid only for 11ax preamble types HE_SU
  1662. * and HE_EXT_SU
  1663. */
  1664. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1665. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1666. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1667. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1668. */
  1669. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1670. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1671. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1672. * Use cases:
  1673. * Any time firmware uses TQM-BYPASS for Data
  1674. * TID, firmware expect host to set this bit.
  1675. */
  1676. /* DWORD 1: tx power, tx rate */
  1677. A_UINT32
  1678. power : 8, /* unit of the power field is 0.5 dbm
  1679. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1680. * signed value ranging from -64dbm to 63.5 dbm
  1681. */
  1682. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1683. * Setting more than one MCS isn't currently
  1684. * supported by the target (but is supported
  1685. * in the interface in case in the future
  1686. * the target supports specifications of
  1687. * a limited set of MCS values.
  1688. */
  1689. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1690. * Setting more than one Nss isn't currently
  1691. * supported by the target (but is supported
  1692. * in the interface in case in the future
  1693. * the target supports specifications of
  1694. * a limited set of Nss values.
  1695. */
  1696. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1697. update_peer_cache : 1; /* When set these custom values will be
  1698. * used for all packets, until the next
  1699. * update via this ext header.
  1700. * This is to make sure not all packets
  1701. * need to include this header.
  1702. */
  1703. /* DWORD 2: tx chain mask, tx retries */
  1704. A_UINT32
  1705. /* chain_mask - specify which chains to transmit from */
  1706. chain_mask : 8,
  1707. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1708. * TODO: Update Enum values for key_flags
  1709. */
  1710. /*
  1711. * Channel frequency: This identifies the desired channel
  1712. * frequency (in MHz) for tx frames. This is used by FW to help
  1713. * determine when it is safe to transmit or drop frames for
  1714. * off-channel operation.
  1715. * The default value of zero indicates to FW that the corresponding
  1716. * VDEV's home channel (if there is one) is the desired channel
  1717. * frequency.
  1718. */
  1719. chanfreq : 16;
  1720. /* DWORD 3: tx expiry time (TSF) LSBs */
  1721. A_UINT32 expire_tsf_lo;
  1722. /* DWORD 4: tx expiry time (TSF) MSBs */
  1723. A_UINT32 expire_tsf_hi;
  1724. /* DWORD 5: flags to control routing / processing of the MSDU */
  1725. A_UINT32
  1726. /* learning_frame
  1727. * When this flag is set, this frame will be dropped by FW
  1728. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1729. */
  1730. learning_frame : 1,
  1731. /* send_as_standalone
  1732. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1733. * i.e. with no A-MSDU or A-MPDU aggregation.
  1734. * The scope is extended to other use-cases.
  1735. */
  1736. send_as_standalone : 1,
  1737. /* is_host_opaque_valid
  1738. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1739. * with valid information.
  1740. */
  1741. is_host_opaque_valid : 1,
  1742. rsvd0 : 29;
  1743. /* DWORD 6 : Host opaque cookie for special frames */
  1744. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1745. rsvd1 : 16;
  1746. /*
  1747. * This structure can be expanded further up to 40 bytes
  1748. * by adding further DWORDs as needed.
  1749. */
  1750. } POSTPACK;
  1751. /* DWORD 0 */
  1752. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1773. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1774. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1775. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1776. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1777. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1778. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1779. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1780. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1781. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1782. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1783. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1784. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1785. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1786. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1787. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1788. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1789. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1790. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1791. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1792. /* DWORD 1 */
  1793. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1794. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1795. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1796. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1797. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1798. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1799. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1800. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1801. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1802. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1803. /* DWORD 2 */
  1804. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1805. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1806. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1807. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1808. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1809. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1810. /* DWORD 5 */
  1811. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1812. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1817. /* DWORD 6 */
  1818. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1819. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1820. /* DWORD 0 */
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1822. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1823. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1825. do { \
  1826. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1827. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1828. } while (0)
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1830. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1831. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1833. do { \
  1834. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1835. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1836. } while (0)
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1838. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1839. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1841. do { \
  1842. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1843. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1844. } while (0)
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1846. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1847. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1849. do { \
  1850. HTT_CHECK_SET_VAL( \
  1851. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1852. ((_var) |= ((_val) \
  1853. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1854. } while (0)
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1856. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1857. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1859. do { \
  1860. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1861. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1862. } while (0)
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1864. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1865. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1867. do { \
  1868. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1869. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1870. } while (0)
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1872. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1873. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1875. do { \
  1876. HTT_CHECK_SET_VAL( \
  1877. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1878. ((_var) |= ((_val) \
  1879. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1880. } while (0)
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1882. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1883. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1885. do { \
  1886. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1887. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1888. } while (0)
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1890. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1891. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1893. do { \
  1894. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1895. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1896. } while (0)
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1898. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1899. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1901. do { \
  1902. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1903. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1904. } while (0)
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1906. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1907. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1909. do { \
  1910. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1911. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1912. } while (0)
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1914. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1915. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1917. do { \
  1918. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1919. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1920. } while (0)
  1921. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1922. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1923. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1925. do { \
  1926. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1927. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1928. } while (0)
  1929. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1930. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1931. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1932. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1933. do { \
  1934. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1935. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1936. } while (0)
  1937. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1938. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1939. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1940. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1941. do { \
  1942. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1943. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1944. } while (0)
  1945. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1946. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1947. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1948. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1949. do { \
  1950. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1951. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1952. } while (0)
  1953. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1954. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1955. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1956. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1957. do { \
  1958. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1959. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1960. } while (0)
  1961. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1962. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1963. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1964. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1965. do { \
  1966. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1967. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1968. } while (0)
  1969. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1970. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1971. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1972. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1975. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1976. } while (0)
  1977. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1978. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1979. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1980. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1983. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1984. } while (0)
  1985. /* DWORD 1 */
  1986. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1987. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1988. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1989. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1990. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1991. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1992. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1993. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1994. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1995. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1996. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1997. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1998. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2001. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2002. } while (0)
  2003. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2004. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2005. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2006. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2010. } while (0)
  2011. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2012. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2013. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2014. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2015. do { \
  2016. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2017. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2018. } while (0)
  2019. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2020. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2021. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2022. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2023. do { \
  2024. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2025. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2026. } while (0)
  2027. /* DWORD 2 */
  2028. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2029. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2030. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2031. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2035. } while (0)
  2036. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2037. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2038. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2039. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2043. } while (0)
  2044. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2045. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2046. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2047. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2051. } while (0)
  2052. /* DWORD 5 */
  2053. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2054. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2055. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2056. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2057. do { \
  2058. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2059. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2060. } while (0)
  2061. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2062. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2063. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2064. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2065. do { \
  2066. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2067. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2068. } while (0)
  2069. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2070. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2071. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2072. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2073. do { \
  2074. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2075. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2076. } while (0)
  2077. /* DWORD 6 */
  2078. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2079. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2080. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2081. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2082. do { \
  2083. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2084. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2085. } while (0)
  2086. typedef enum {
  2087. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2088. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2089. } htt_tcl_metadata_type;
  2090. /**
  2091. * @brief HTT TCL command number format
  2092. * @details
  2093. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2094. * available to firmware as tcl_exit_base->tcl_status_number.
  2095. * For regular / multicast packets host will send vdev and mac id and for
  2096. * NAWDS packets, host will send peer id.
  2097. * A_UINT32 is used to avoid endianness conversion problems.
  2098. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2099. */
  2100. typedef struct {
  2101. A_UINT32
  2102. type: 1, /* vdev_id based or peer_id based */
  2103. rsvd: 31;
  2104. } htt_tx_tcl_vdev_or_peer_t;
  2105. typedef struct {
  2106. A_UINT32
  2107. type: 1, /* vdev_id based or peer_id based */
  2108. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2109. vdev_id: 8,
  2110. pdev_id: 2,
  2111. host_inspected:1,
  2112. rsvd: 19;
  2113. } htt_tx_tcl_vdev_metadata;
  2114. typedef struct {
  2115. A_UINT32
  2116. type: 1, /* vdev_id based or peer_id based */
  2117. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2118. peer_id: 14,
  2119. rsvd: 16;
  2120. } htt_tx_tcl_peer_metadata;
  2121. PREPACK struct htt_tx_tcl_metadata {
  2122. union {
  2123. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2124. htt_tx_tcl_vdev_metadata vdev_meta;
  2125. htt_tx_tcl_peer_metadata peer_meta;
  2126. };
  2127. } POSTPACK;
  2128. /* DWORD 0 */
  2129. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2130. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2131. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2132. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2133. /* VDEV metadata */
  2134. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2135. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2136. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2137. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2138. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2139. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2140. /* PEER metadata */
  2141. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2142. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2143. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2144. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2145. HTT_TX_TCL_METADATA_TYPE_S)
  2146. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2147. do { \
  2148. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2149. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2150. } while (0)
  2151. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2152. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2153. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2154. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2157. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2158. } while (0)
  2159. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2160. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2161. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2162. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2166. } while (0)
  2167. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2168. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2169. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2170. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2174. } while (0)
  2175. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2176. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2177. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2178. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2179. do { \
  2180. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2181. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2182. } while (0)
  2183. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2184. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2185. HTT_TX_TCL_METADATA_PEER_ID_S)
  2186. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2187. do { \
  2188. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2189. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2190. } while (0)
  2191. typedef enum {
  2192. HTT_TX_FW2WBM_TX_STATUS_OK,
  2193. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2194. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2195. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2196. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2197. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2198. HTT_TX_FW2WBM_TX_STATUS_MAX
  2199. } htt_tx_fw2wbm_tx_status_t;
  2200. typedef enum {
  2201. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2202. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2203. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2204. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2205. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2206. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2207. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2208. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2209. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2210. } htt_tx_fw2wbm_reinject_reason_t;
  2211. /**
  2212. * @brief HTT TX WBM Completion from firmware to host
  2213. * @details
  2214. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2215. * DWORD 3 and 4 for software based completions (Exception frames and
  2216. * TQM bypass frames)
  2217. * For software based completions, wbm_release_ring->release_source_module will
  2218. * be set to release_source_fw
  2219. */
  2220. PREPACK struct htt_tx_wbm_completion {
  2221. A_UINT32
  2222. sch_cmd_id: 24,
  2223. exception_frame: 1, /* If set, this packet was queued via exception path */
  2224. rsvd0_31_25: 7;
  2225. A_UINT32
  2226. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2227. * reception of an ACK or BA, this field indicates
  2228. * the RSSI of the received ACK or BA frame.
  2229. * When the frame is removed as result of a direct
  2230. * remove command from the SW, this field is set
  2231. * to 0x0 (which is never a valid value when real
  2232. * RSSI is available).
  2233. * Units: dB w.r.t noise floor
  2234. */
  2235. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2236. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2237. rsvd1_31_16: 16;
  2238. } POSTPACK;
  2239. /* DWORD 0 */
  2240. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2241. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2242. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2243. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2244. /* DWORD 1 */
  2245. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2246. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2247. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2248. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2249. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2250. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2251. /* DWORD 0 */
  2252. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2253. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2254. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2255. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2256. do { \
  2257. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2258. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2259. } while (0)
  2260. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2261. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2262. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2263. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2264. do { \
  2265. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2266. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2267. } while (0)
  2268. /* DWORD 1 */
  2269. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2270. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2271. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2272. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2275. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2276. } while (0)
  2277. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2278. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2279. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2280. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2281. do { \
  2282. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2283. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2284. } while (0)
  2285. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2286. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2287. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2288. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2289. do { \
  2290. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2291. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2292. } while (0)
  2293. /**
  2294. * @brief HTT TX WBM Completion from firmware to host
  2295. * @details
  2296. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2297. * (WBM) offload HW.
  2298. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2299. * For software based completions, release_source_module will
  2300. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2301. * struct wbm_release_ring and then switch to this after looking at
  2302. * release_source_module.
  2303. */
  2304. PREPACK struct htt_tx_wbm_completion_v2 {
  2305. A_UINT32
  2306. used_by_hw0; /* Refer to struct wbm_release_ring */
  2307. A_UINT32
  2308. used_by_hw1; /* Refer to struct wbm_release_ring */
  2309. A_UINT32
  2310. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2311. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2312. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2313. exception_frame: 1,
  2314. rsvd0: 12, /* For future use */
  2315. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2316. rsvd1: 1; /* For future use */
  2317. A_UINT32
  2318. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2319. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2320. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2321. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2322. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2323. */
  2324. A_UINT32
  2325. data1: 32;
  2326. A_UINT32
  2327. data2: 32;
  2328. A_UINT32
  2329. used_by_hw3; /* Refer to struct wbm_release_ring */
  2330. } POSTPACK;
  2331. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2332. /* DWORD 3 */
  2333. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2334. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2335. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2336. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2337. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2338. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2339. /* DWORD 3 */
  2340. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2341. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2342. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2343. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2344. do { \
  2345. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2346. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2347. } while (0)
  2348. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2349. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2350. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2351. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2352. do { \
  2353. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2354. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2355. } while (0)
  2356. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2357. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2358. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2359. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2360. do { \
  2361. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2362. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2363. } while (0)
  2364. /**
  2365. * @brief HTT TX WBM transmit status from firmware to host
  2366. * @details
  2367. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2368. * (WBM) offload HW.
  2369. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2370. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2371. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2372. */
  2373. PREPACK struct htt_tx_wbm_transmit_status {
  2374. A_UINT32
  2375. sch_cmd_id: 24,
  2376. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2377. * reception of an ACK or BA, this field indicates
  2378. * the RSSI of the received ACK or BA frame.
  2379. * When the frame is removed as result of a direct
  2380. * remove command from the SW, this field is set
  2381. * to 0x0 (which is never a valid value when real
  2382. * RSSI is available).
  2383. * Units: dB w.r.t noise floor
  2384. */
  2385. A_UINT32
  2386. sw_peer_id: 16,
  2387. tid_num: 5,
  2388. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2389. * and tid_num fields contain valid data.
  2390. * If this "valid" flag is not set, the
  2391. * sw_peer_id and tid_num fields must be ignored.
  2392. */
  2393. mcast: 1,
  2394. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2395. * contains valid data.
  2396. */
  2397. reserved0: 8;
  2398. A_UINT32
  2399. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2400. * packets in the wbm completion path
  2401. */
  2402. } POSTPACK;
  2403. /* DWORD 4 */
  2404. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2405. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2406. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2407. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2408. /* DWORD 5 */
  2409. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2410. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2411. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2412. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2413. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2414. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2415. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2416. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2417. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2418. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2419. /* DWORD 4 */
  2420. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2421. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2422. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2423. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2426. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2427. } while (0)
  2428. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2429. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2430. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2431. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2435. } while (0)
  2436. /* DWORD 5 */
  2437. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2438. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2439. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2440. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2441. do { \
  2442. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2443. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2444. } while (0)
  2445. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2446. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2447. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2448. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2449. do { \
  2450. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2451. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2452. } while (0)
  2453. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2454. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2455. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2456. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2457. do { \
  2458. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2459. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2460. } while (0)
  2461. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2462. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2463. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2464. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2465. do { \
  2466. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2467. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2468. } while (0)
  2469. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2470. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2471. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2472. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2473. do { \
  2474. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2475. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2476. } while (0)
  2477. /**
  2478. * @brief HTT TX WBM reinject status from firmware to host
  2479. * @details
  2480. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2481. * (WBM) offload HW.
  2482. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2483. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2484. */
  2485. PREPACK struct htt_tx_wbm_reinject_status {
  2486. A_UINT32
  2487. reserved0: 32;
  2488. A_UINT32
  2489. reserved1: 32;
  2490. A_UINT32
  2491. reserved2: 32;
  2492. } POSTPACK;
  2493. /**
  2494. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2495. * @details
  2496. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2497. * (WBM) offload HW.
  2498. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2499. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2500. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2501. * STA side.
  2502. */
  2503. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2504. A_UINT32
  2505. mec_sa_addr_31_0;
  2506. A_UINT32
  2507. mec_sa_addr_47_32: 16,
  2508. sa_ast_index: 16;
  2509. A_UINT32
  2510. vdev_id: 8,
  2511. reserved0: 24;
  2512. } POSTPACK;
  2513. /* DWORD 4 - mec_sa_addr_31_0 */
  2514. /* DWORD 5 */
  2515. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2516. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2517. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2518. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2519. /* DWORD 6 */
  2520. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2521. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2522. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2523. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2524. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2525. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2526. do { \
  2527. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2528. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2529. } while (0)
  2530. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2531. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2532. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2533. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2534. do { \
  2535. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2536. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2537. } while (0)
  2538. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2539. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2540. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2541. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2542. do { \
  2543. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2544. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2545. } while (0)
  2546. typedef enum {
  2547. TX_FLOW_PRIORITY_BE,
  2548. TX_FLOW_PRIORITY_HIGH,
  2549. TX_FLOW_PRIORITY_LOW,
  2550. } htt_tx_flow_priority_t;
  2551. typedef enum {
  2552. TX_FLOW_LATENCY_SENSITIVE,
  2553. TX_FLOW_LATENCY_INSENSITIVE,
  2554. } htt_tx_flow_latency_t;
  2555. typedef enum {
  2556. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2557. TX_FLOW_INTERACTIVE_TRAFFIC,
  2558. TX_FLOW_PERIODIC_TRAFFIC,
  2559. TX_FLOW_BURSTY_TRAFFIC,
  2560. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2561. } htt_tx_flow_traffic_pattern_t;
  2562. /**
  2563. * @brief HTT TX Flow search metadata format
  2564. * @details
  2565. * Host will set this metadata in flow table's flow search entry along with
  2566. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2567. * firmware and TQM ring if the flow search entry wins.
  2568. * This metadata is available to firmware in that first MSDU's
  2569. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2570. * to one of the available flows for specific tid and returns the tqm flow
  2571. * pointer as part of htt_tx_map_flow_info message.
  2572. */
  2573. PREPACK struct htt_tx_flow_metadata {
  2574. A_UINT32
  2575. rsvd0_1_0: 2,
  2576. tid: 4,
  2577. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2578. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2579. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2580. * Else choose final tid based on latency, priority.
  2581. */
  2582. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2583. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2584. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2585. } POSTPACK;
  2586. /* DWORD 0 */
  2587. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2588. #define HTT_TX_FLOW_METADATA_TID_S 2
  2589. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2590. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2591. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2592. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2593. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2594. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2595. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2596. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2597. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2598. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2599. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2600. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2601. /* DWORD 0 */
  2602. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2603. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2604. HTT_TX_FLOW_METADATA_TID_S)
  2605. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2606. do { \
  2607. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2608. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2609. } while (0)
  2610. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2611. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2612. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2613. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2614. do { \
  2615. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2616. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2617. } while (0)
  2618. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2619. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2620. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2621. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2622. do { \
  2623. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2624. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2625. } while (0)
  2626. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2627. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2628. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2629. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2630. do { \
  2631. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2632. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2633. } while (0)
  2634. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2635. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2636. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2637. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2638. do { \
  2639. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2640. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2641. } while (0)
  2642. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2643. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2644. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2645. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2646. do { \
  2647. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2648. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2649. } while (0)
  2650. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2651. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2652. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2653. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2654. do { \
  2655. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2656. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2657. } while (0)
  2658. /**
  2659. * @brief host -> target ADD WDS Entry
  2660. *
  2661. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2662. *
  2663. * @brief host -> target DELETE WDS Entry
  2664. *
  2665. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2666. *
  2667. * @details
  2668. * HTT wds entry from source port learning
  2669. * Host will learn wds entries from rx and send this message to firmware
  2670. * to enable firmware to configure/delete AST entries for wds clients.
  2671. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2672. * and when SA's entry is deleted, firmware removes this AST entry
  2673. *
  2674. * The message would appear as follows:
  2675. *
  2676. * |31 30|29 |17 16|15 8|7 0|
  2677. * |----------------+----------------+----------------+----------------|
  2678. * | rsvd0 |PDVID| vdev_id | msg_type |
  2679. * |-------------------------------------------------------------------|
  2680. * | sa_addr_31_0 |
  2681. * |-------------------------------------------------------------------|
  2682. * | | ta_peer_id | sa_addr_47_32 |
  2683. * |-------------------------------------------------------------------|
  2684. * Where PDVID = pdev_id
  2685. *
  2686. * The message is interpreted as follows:
  2687. *
  2688. * dword0 - b'0:7 - msg_type: This will be set to
  2689. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2690. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2691. *
  2692. * dword0 - b'8:15 - vdev_id
  2693. *
  2694. * dword0 - b'16:17 - pdev_id
  2695. *
  2696. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2697. *
  2698. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2699. *
  2700. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2701. *
  2702. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2703. */
  2704. PREPACK struct htt_wds_entry {
  2705. A_UINT32
  2706. msg_type: 8,
  2707. vdev_id: 8,
  2708. pdev_id: 2,
  2709. rsvd0: 14;
  2710. A_UINT32 sa_addr_31_0;
  2711. A_UINT32
  2712. sa_addr_47_32: 16,
  2713. ta_peer_id: 14,
  2714. rsvd2: 2;
  2715. } POSTPACK;
  2716. /* DWORD 0 */
  2717. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2718. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2719. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2720. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2721. /* DWORD 2 */
  2722. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2723. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2724. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2725. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2726. /* DWORD 0 */
  2727. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2728. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2729. HTT_WDS_ENTRY_VDEV_ID_S)
  2730. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2731. do { \
  2732. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2733. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2734. } while (0)
  2735. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2736. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2737. HTT_WDS_ENTRY_PDEV_ID_S)
  2738. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2739. do { \
  2740. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2741. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2742. } while (0)
  2743. /* DWORD 2 */
  2744. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2745. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2746. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2747. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2748. do { \
  2749. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2750. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2751. } while (0)
  2752. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2753. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2754. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2755. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2756. do { \
  2757. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2758. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2759. } while (0)
  2760. /**
  2761. * @brief MAC DMA rx ring setup specification
  2762. *
  2763. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2764. *
  2765. * @details
  2766. * To allow for dynamic rx ring reconfiguration and to avoid race
  2767. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2768. * it uses. Instead, it sends this message to the target, indicating how
  2769. * the rx ring used by the host should be set up and maintained.
  2770. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2771. * specifications.
  2772. *
  2773. * |31 16|15 8|7 0|
  2774. * |---------------------------------------------------------------|
  2775. * header: | reserved | num rings | msg type |
  2776. * |---------------------------------------------------------------|
  2777. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2778. #if HTT_PADDR64
  2779. * | FW_IDX shadow register physical address (bits 63:32) |
  2780. #endif
  2781. * |---------------------------------------------------------------|
  2782. * | rx ring base physical address (bits 31:0) |
  2783. #if HTT_PADDR64
  2784. * | rx ring base physical address (bits 63:32) |
  2785. #endif
  2786. * |---------------------------------------------------------------|
  2787. * | rx ring buffer size | rx ring length |
  2788. * |---------------------------------------------------------------|
  2789. * | FW_IDX initial value | enabled flags |
  2790. * |---------------------------------------------------------------|
  2791. * | MSDU payload offset | 802.11 header offset |
  2792. * |---------------------------------------------------------------|
  2793. * | PPDU end offset | PPDU start offset |
  2794. * |---------------------------------------------------------------|
  2795. * | MPDU end offset | MPDU start offset |
  2796. * |---------------------------------------------------------------|
  2797. * | MSDU end offset | MSDU start offset |
  2798. * |---------------------------------------------------------------|
  2799. * | frag info offset | rx attention offset |
  2800. * |---------------------------------------------------------------|
  2801. * payload 2, if present, has the same format as payload 1
  2802. * Header fields:
  2803. * - MSG_TYPE
  2804. * Bits 7:0
  2805. * Purpose: identifies this as an rx ring configuration message
  2806. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2807. * - NUM_RINGS
  2808. * Bits 15:8
  2809. * Purpose: indicates whether the host is setting up one rx ring or two
  2810. * Value: 1 or 2
  2811. * Payload:
  2812. * for systems using 64-bit format for bus addresses:
  2813. * - IDX_SHADOW_REG_PADDR_LO
  2814. * Bits 31:0
  2815. * Value: lower 4 bytes of physical address of the host's
  2816. * FW_IDX shadow register
  2817. * - IDX_SHADOW_REG_PADDR_HI
  2818. * Bits 31:0
  2819. * Value: upper 4 bytes of physical address of the host's
  2820. * FW_IDX shadow register
  2821. * - RING_BASE_PADDR_LO
  2822. * Bits 31:0
  2823. * Value: lower 4 bytes of physical address of the host's rx ring
  2824. * - RING_BASE_PADDR_HI
  2825. * Bits 31:0
  2826. * Value: uppper 4 bytes of physical address of the host's rx ring
  2827. * for systems using 32-bit format for bus addresses:
  2828. * - IDX_SHADOW_REG_PADDR
  2829. * Bits 31:0
  2830. * Value: physical address of the host's FW_IDX shadow register
  2831. * - RING_BASE_PADDR
  2832. * Bits 31:0
  2833. * Value: physical address of the host's rx ring
  2834. * - RING_LEN
  2835. * Bits 15:0
  2836. * Value: number of elements in the rx ring
  2837. * - RING_BUF_SZ
  2838. * Bits 31:16
  2839. * Value: size of the buffers referenced by the rx ring, in byte units
  2840. * - ENABLED_FLAGS
  2841. * Bits 15:0
  2842. * Value: 1-bit flags to show whether different rx fields are enabled
  2843. * bit 0: 802.11 header enabled (1) or disabled (0)
  2844. * bit 1: MSDU payload enabled (1) or disabled (0)
  2845. * bit 2: PPDU start enabled (1) or disabled (0)
  2846. * bit 3: PPDU end enabled (1) or disabled (0)
  2847. * bit 4: MPDU start enabled (1) or disabled (0)
  2848. * bit 5: MPDU end enabled (1) or disabled (0)
  2849. * bit 6: MSDU start enabled (1) or disabled (0)
  2850. * bit 7: MSDU end enabled (1) or disabled (0)
  2851. * bit 8: rx attention enabled (1) or disabled (0)
  2852. * bit 9: frag info enabled (1) or disabled (0)
  2853. * bit 10: unicast rx enabled (1) or disabled (0)
  2854. * bit 11: multicast rx enabled (1) or disabled (0)
  2855. * bit 12: ctrl rx enabled (1) or disabled (0)
  2856. * bit 13: mgmt rx enabled (1) or disabled (0)
  2857. * bit 14: null rx enabled (1) or disabled (0)
  2858. * bit 15: phy data rx enabled (1) or disabled (0)
  2859. * - IDX_INIT_VAL
  2860. * Bits 31:16
  2861. * Purpose: Specify the initial value for the FW_IDX.
  2862. * Value: the number of buffers initially present in the host's rx ring
  2863. * - OFFSET_802_11_HDR
  2864. * Bits 15:0
  2865. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2866. * - OFFSET_MSDU_PAYLOAD
  2867. * Bits 31:16
  2868. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2869. * - OFFSET_PPDU_START
  2870. * Bits 15:0
  2871. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2872. * - OFFSET_PPDU_END
  2873. * Bits 31:16
  2874. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2875. * - OFFSET_MPDU_START
  2876. * Bits 15:0
  2877. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2878. * - OFFSET_MPDU_END
  2879. * Bits 31:16
  2880. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2881. * - OFFSET_MSDU_START
  2882. * Bits 15:0
  2883. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2884. * - OFFSET_MSDU_END
  2885. * Bits 31:16
  2886. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2887. * - OFFSET_RX_ATTN
  2888. * Bits 15:0
  2889. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2890. * - OFFSET_FRAG_INFO
  2891. * Bits 31:16
  2892. * Value: offset in QUAD-bytes of frag info table
  2893. */
  2894. /* header fields */
  2895. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2896. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2897. /* payload fields */
  2898. /* for systems using a 64-bit format for bus addresses */
  2899. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2900. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2901. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2902. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2903. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2904. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2905. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2906. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2907. /* for systems using a 32-bit format for bus addresses */
  2908. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2909. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2910. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2911. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2912. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2913. #define HTT_RX_RING_CFG_LEN_S 0
  2914. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2915. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2916. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2917. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2918. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2919. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2920. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2921. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2922. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2923. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2924. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2925. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2926. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2927. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2928. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2929. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2930. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2931. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2932. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2933. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2934. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2935. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2936. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2937. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2938. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2939. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2940. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2941. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2942. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2943. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2944. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2945. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2946. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2947. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2948. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2949. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2950. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2951. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2952. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2953. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2954. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2955. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2956. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2957. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2958. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2959. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2960. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2961. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2962. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2963. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2964. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2965. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2966. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2967. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2968. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2969. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2970. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2971. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2972. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2973. #if HTT_PADDR64
  2974. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2975. #else
  2976. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2977. #endif
  2978. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2979. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2980. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2981. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2982. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2983. do { \
  2984. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2985. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2986. } while (0)
  2987. /* degenerate case for 32-bit fields */
  2988. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2989. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2990. ((_var) = (_val))
  2991. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2992. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2993. ((_var) = (_val))
  2994. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2995. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2996. ((_var) = (_val))
  2997. /* degenerate case for 32-bit fields */
  2998. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2999. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3000. ((_var) = (_val))
  3001. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3002. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3003. ((_var) = (_val))
  3004. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3005. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3006. ((_var) = (_val))
  3007. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3008. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3009. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3010. do { \
  3011. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3012. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3013. } while (0)
  3014. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3015. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3016. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3017. do { \
  3018. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3019. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3020. } while (0)
  3021. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3022. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3023. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3024. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3025. do { \
  3026. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3027. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3028. } while (0)
  3029. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3030. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3031. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3032. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3033. do { \
  3034. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3035. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3036. } while (0)
  3037. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3038. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3039. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3040. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3041. do { \
  3042. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3043. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3044. } while (0)
  3045. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3046. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3047. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3048. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3049. do { \
  3050. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3051. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3052. } while (0)
  3053. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3054. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3055. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3056. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3057. do { \
  3058. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3059. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3060. } while (0)
  3061. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3062. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3063. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3064. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3065. do { \
  3066. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3067. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3068. } while (0)
  3069. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3070. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3071. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3072. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3073. do { \
  3074. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3075. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3076. } while (0)
  3077. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3078. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3079. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3080. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3081. do { \
  3082. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3083. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3084. } while (0)
  3085. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3086. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3087. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3088. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3089. do { \
  3090. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3091. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3092. } while (0)
  3093. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3094. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3095. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3096. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3097. do { \
  3098. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3099. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3100. } while (0)
  3101. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3102. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3103. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3104. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3105. do { \
  3106. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3107. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3108. } while (0)
  3109. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3110. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3111. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3112. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3113. do { \
  3114. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3115. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3116. } while (0)
  3117. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3118. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3119. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3120. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3121. do { \
  3122. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3123. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3124. } while (0)
  3125. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3126. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3127. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3128. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3129. do { \
  3130. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3131. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3132. } while (0)
  3133. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3134. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3135. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3136. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3137. do { \
  3138. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3139. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3140. } while (0)
  3141. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3142. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3143. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3144. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3145. do { \
  3146. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3147. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3148. } while (0)
  3149. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3150. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3151. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3152. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3153. do { \
  3154. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3155. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3156. } while (0)
  3157. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3158. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3159. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3160. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3161. do { \
  3162. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3163. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3164. } while (0)
  3165. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3166. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3167. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3168. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3169. do { \
  3170. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3171. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3172. } while (0)
  3173. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3174. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3175. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3176. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3177. do { \
  3178. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3179. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3180. } while (0)
  3181. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3182. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3183. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3184. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3185. do { \
  3186. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3187. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3188. } while (0)
  3189. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3190. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3191. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3192. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3193. do { \
  3194. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3195. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3196. } while (0)
  3197. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3198. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3199. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3200. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3201. do { \
  3202. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3203. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3204. } while (0)
  3205. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3206. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3207. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3208. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3209. do { \
  3210. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3211. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3212. } while (0)
  3213. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3214. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3215. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3216. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3217. do { \
  3218. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3219. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3220. } while (0)
  3221. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3222. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3223. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3224. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3225. do { \
  3226. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3227. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3228. } while (0)
  3229. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3230. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3231. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3232. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3233. do { \
  3234. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3235. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3236. } while (0)
  3237. /**
  3238. * @brief host -> target FW statistics retrieve
  3239. *
  3240. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3241. *
  3242. * @details
  3243. * The following field definitions describe the format of the HTT host
  3244. * to target FW stats retrieve message. The message specifies the type of
  3245. * stats host wants to retrieve.
  3246. *
  3247. * |31 24|23 16|15 8|7 0|
  3248. * |-----------------------------------------------------------|
  3249. * | stats types request bitmask | msg type |
  3250. * |-----------------------------------------------------------|
  3251. * | stats types reset bitmask | reserved |
  3252. * |-----------------------------------------------------------|
  3253. * | stats type | config value |
  3254. * |-----------------------------------------------------------|
  3255. * | cookie LSBs |
  3256. * |-----------------------------------------------------------|
  3257. * | cookie MSBs |
  3258. * |-----------------------------------------------------------|
  3259. * Header fields:
  3260. * - MSG_TYPE
  3261. * Bits 7:0
  3262. * Purpose: identifies this is a stats upload request message
  3263. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3264. * - UPLOAD_TYPES
  3265. * Bits 31:8
  3266. * Purpose: identifies which types of FW statistics to upload
  3267. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3268. * - RESET_TYPES
  3269. * Bits 31:8
  3270. * Purpose: identifies which types of FW statistics to reset
  3271. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3272. * - CFG_VAL
  3273. * Bits 23:0
  3274. * Purpose: give an opaque configuration value to the specified stats type
  3275. * Value: stats-type specific configuration value
  3276. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3277. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3278. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3279. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3280. * - CFG_STAT_TYPE
  3281. * Bits 31:24
  3282. * Purpose: specify which stats type (if any) the config value applies to
  3283. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3284. * a valid configuration specification
  3285. * - COOKIE_LSBS
  3286. * Bits 31:0
  3287. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3288. * message with its preceding host->target stats request message.
  3289. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3290. * - COOKIE_MSBS
  3291. * Bits 31:0
  3292. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3293. * message with its preceding host->target stats request message.
  3294. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3295. */
  3296. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3297. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3298. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3299. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3300. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3301. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3302. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3303. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3304. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3305. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3306. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3307. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3308. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3309. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3310. do { \
  3311. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3312. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3313. } while (0)
  3314. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3315. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3316. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3317. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3318. do { \
  3319. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3320. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3321. } while (0)
  3322. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3323. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3324. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3325. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3326. do { \
  3327. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3328. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3329. } while (0)
  3330. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3331. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3332. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3333. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3334. do { \
  3335. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3336. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3337. } while (0)
  3338. /**
  3339. * @brief host -> target HTT out-of-band sync request
  3340. *
  3341. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3342. *
  3343. * @details
  3344. * The HTT SYNC tells the target to suspend processing of subsequent
  3345. * HTT host-to-target messages until some other target agent locally
  3346. * informs the target HTT FW that the current sync counter is equal to
  3347. * or greater than (in a modulo sense) the sync counter specified in
  3348. * the SYNC message.
  3349. * This allows other host-target components to synchronize their operation
  3350. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3351. * security key has been downloaded to and activated by the target.
  3352. * In the absence of any explicit synchronization counter value
  3353. * specification, the target HTT FW will use zero as the default current
  3354. * sync value.
  3355. *
  3356. * |31 24|23 16|15 8|7 0|
  3357. * |-----------------------------------------------------------|
  3358. * | reserved | sync count | msg type |
  3359. * |-----------------------------------------------------------|
  3360. * Header fields:
  3361. * - MSG_TYPE
  3362. * Bits 7:0
  3363. * Purpose: identifies this as a sync message
  3364. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3365. * - SYNC_COUNT
  3366. * Bits 15:8
  3367. * Purpose: specifies what sync value the HTT FW will wait for from
  3368. * an out-of-band specification to resume its operation
  3369. * Value: in-band sync counter value to compare against the out-of-band
  3370. * counter spec.
  3371. * The HTT target FW will suspend its host->target message processing
  3372. * as long as
  3373. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3374. */
  3375. #define HTT_H2T_SYNC_MSG_SZ 4
  3376. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3377. #define HTT_H2T_SYNC_COUNT_S 8
  3378. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3379. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3380. HTT_H2T_SYNC_COUNT_S)
  3381. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3382. do { \
  3383. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3384. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3385. } while (0)
  3386. /**
  3387. * @brief host -> target HTT aggregation configuration
  3388. *
  3389. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3390. */
  3391. #define HTT_AGGR_CFG_MSG_SZ 4
  3392. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3393. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3394. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3395. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3396. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3397. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3398. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3399. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3400. do { \
  3401. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3402. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3403. } while (0)
  3404. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3405. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3406. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3407. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3408. do { \
  3409. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3410. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3411. } while (0)
  3412. /**
  3413. * @brief host -> target HTT configure max amsdu info per vdev
  3414. *
  3415. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3416. *
  3417. * @details
  3418. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3419. *
  3420. * |31 21|20 16|15 8|7 0|
  3421. * |-----------------------------------------------------------|
  3422. * | reserved | vdev id | max amsdu | msg type |
  3423. * |-----------------------------------------------------------|
  3424. * Header fields:
  3425. * - MSG_TYPE
  3426. * Bits 7:0
  3427. * Purpose: identifies this as a aggr cfg ex message
  3428. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3429. * - MAX_NUM_AMSDU_SUBFRM
  3430. * Bits 15:8
  3431. * Purpose: max MSDUs per A-MSDU
  3432. * - VDEV_ID
  3433. * Bits 20:16
  3434. * Purpose: ID of the vdev to which this limit is applied
  3435. */
  3436. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3437. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3438. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3439. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3440. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3441. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3442. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3443. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3444. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3445. do { \
  3446. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3447. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3448. } while (0)
  3449. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3450. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3451. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3452. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3453. do { \
  3454. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3455. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3456. } while (0)
  3457. /**
  3458. * @brief HTT WDI_IPA Config Message
  3459. *
  3460. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3461. *
  3462. * @details
  3463. * The HTT WDI_IPA config message is created/sent by host at driver
  3464. * init time. It contains information about data structures used on
  3465. * WDI_IPA TX and RX path.
  3466. * TX CE ring is used for pushing packet metadata from IPA uC
  3467. * to WLAN FW
  3468. * TX Completion ring is used for generating TX completions from
  3469. * WLAN FW to IPA uC
  3470. * RX Indication ring is used for indicating RX packets from FW
  3471. * to IPA uC
  3472. * RX Ring2 is used as either completion ring or as second
  3473. * indication ring. when Ring2 is used as completion ring, IPA uC
  3474. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3475. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3476. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3477. * indicated in RX Indication ring. Please see WDI_IPA specification
  3478. * for more details.
  3479. * |31 24|23 16|15 8|7 0|
  3480. * |----------------+----------------+----------------+----------------|
  3481. * | tx pkt pool size | Rsvd | msg_type |
  3482. * |-------------------------------------------------------------------|
  3483. * | tx comp ring base (bits 31:0) |
  3484. #if HTT_PADDR64
  3485. * | tx comp ring base (bits 63:32) |
  3486. #endif
  3487. * |-------------------------------------------------------------------|
  3488. * | tx comp ring size |
  3489. * |-------------------------------------------------------------------|
  3490. * | tx comp WR_IDX physical address (bits 31:0) |
  3491. #if HTT_PADDR64
  3492. * | tx comp WR_IDX physical address (bits 63:32) |
  3493. #endif
  3494. * |-------------------------------------------------------------------|
  3495. * | tx CE WR_IDX physical address (bits 31:0) |
  3496. #if HTT_PADDR64
  3497. * | tx CE WR_IDX physical address (bits 63:32) |
  3498. #endif
  3499. * |-------------------------------------------------------------------|
  3500. * | rx indication ring base (bits 31:0) |
  3501. #if HTT_PADDR64
  3502. * | rx indication ring base (bits 63:32) |
  3503. #endif
  3504. * |-------------------------------------------------------------------|
  3505. * | rx indication ring size |
  3506. * |-------------------------------------------------------------------|
  3507. * | rx ind RD_IDX physical address (bits 31:0) |
  3508. #if HTT_PADDR64
  3509. * | rx ind RD_IDX physical address (bits 63:32) |
  3510. #endif
  3511. * |-------------------------------------------------------------------|
  3512. * | rx ind WR_IDX physical address (bits 31:0) |
  3513. #if HTT_PADDR64
  3514. * | rx ind WR_IDX physical address (bits 63:32) |
  3515. #endif
  3516. * |-------------------------------------------------------------------|
  3517. * |-------------------------------------------------------------------|
  3518. * | rx ring2 base (bits 31:0) |
  3519. #if HTT_PADDR64
  3520. * | rx ring2 base (bits 63:32) |
  3521. #endif
  3522. * |-------------------------------------------------------------------|
  3523. * | rx ring2 size |
  3524. * |-------------------------------------------------------------------|
  3525. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3526. #if HTT_PADDR64
  3527. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3528. #endif
  3529. * |-------------------------------------------------------------------|
  3530. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3531. #if HTT_PADDR64
  3532. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3533. #endif
  3534. * |-------------------------------------------------------------------|
  3535. *
  3536. * Header fields:
  3537. * Header fields:
  3538. * - MSG_TYPE
  3539. * Bits 7:0
  3540. * Purpose: Identifies this as WDI_IPA config message
  3541. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3542. * - TX_PKT_POOL_SIZE
  3543. * Bits 15:0
  3544. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3545. * WDI_IPA TX path
  3546. * For systems using 32-bit format for bus addresses:
  3547. * - TX_COMP_RING_BASE_ADDR
  3548. * Bits 31:0
  3549. * Purpose: TX Completion Ring base address in DDR
  3550. * - TX_COMP_RING_SIZE
  3551. * Bits 31:0
  3552. * Purpose: TX Completion Ring size (must be power of 2)
  3553. * - TX_COMP_WR_IDX_ADDR
  3554. * Bits 31:0
  3555. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3556. * updates the Write Index for WDI_IPA TX completion ring
  3557. * - TX_CE_WR_IDX_ADDR
  3558. * Bits 31:0
  3559. * Purpose: DDR address where IPA uC
  3560. * updates the WR Index for TX CE ring
  3561. * (needed for fusion platforms)
  3562. * - RX_IND_RING_BASE_ADDR
  3563. * Bits 31:0
  3564. * Purpose: RX Indication Ring base address in DDR
  3565. * - RX_IND_RING_SIZE
  3566. * Bits 31:0
  3567. * Purpose: RX Indication Ring size
  3568. * - RX_IND_RD_IDX_ADDR
  3569. * Bits 31:0
  3570. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3571. * RX indication ring
  3572. * - RX_IND_WR_IDX_ADDR
  3573. * Bits 31:0
  3574. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3575. * updates the Write Index for WDI_IPA RX indication ring
  3576. * - RX_RING2_BASE_ADDR
  3577. * Bits 31:0
  3578. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3579. * - RX_RING2_SIZE
  3580. * Bits 31:0
  3581. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3582. * - RX_RING2_RD_IDX_ADDR
  3583. * Bits 31:0
  3584. * Purpose: If Second RX ring is Indication ring, DDR address where
  3585. * IPA uC updates the Read Index for Ring2.
  3586. * If Second RX ring is completion ring, this is NOT used
  3587. * - RX_RING2_WR_IDX_ADDR
  3588. * Bits 31:0
  3589. * Purpose: If Second RX ring is Indication ring, DDR address where
  3590. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3591. * If second RX ring is completion ring, DDR address where
  3592. * IPA uC updates the Write Index for Ring 2.
  3593. * For systems using 64-bit format for bus addresses:
  3594. * - TX_COMP_RING_BASE_ADDR_LO
  3595. * Bits 31:0
  3596. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3597. * - TX_COMP_RING_BASE_ADDR_HI
  3598. * Bits 31:0
  3599. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3600. * - TX_COMP_RING_SIZE
  3601. * Bits 31:0
  3602. * Purpose: TX Completion Ring size (must be power of 2)
  3603. * - TX_COMP_WR_IDX_ADDR_LO
  3604. * Bits 31:0
  3605. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3606. * Lower 4 bytes of DDR address where WIFI FW
  3607. * updates the Write Index for WDI_IPA TX completion ring
  3608. * - TX_COMP_WR_IDX_ADDR_HI
  3609. * Bits 31:0
  3610. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3611. * Higher 4 bytes of DDR address where WIFI FW
  3612. * updates the Write Index for WDI_IPA TX completion ring
  3613. * - TX_CE_WR_IDX_ADDR_LO
  3614. * Bits 31:0
  3615. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3616. * updates the WR Index for TX CE ring
  3617. * (needed for fusion platforms)
  3618. * - TX_CE_WR_IDX_ADDR_HI
  3619. * Bits 31:0
  3620. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3621. * updates the WR Index for TX CE ring
  3622. * (needed for fusion platforms)
  3623. * - RX_IND_RING_BASE_ADDR_LO
  3624. * Bits 31:0
  3625. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3626. * - RX_IND_RING_BASE_ADDR_HI
  3627. * Bits 31:0
  3628. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3629. * - RX_IND_RING_SIZE
  3630. * Bits 31:0
  3631. * Purpose: RX Indication Ring size
  3632. * - RX_IND_RD_IDX_ADDR_LO
  3633. * Bits 31:0
  3634. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3635. * for WDI_IPA RX indication ring
  3636. * - RX_IND_RD_IDX_ADDR_HI
  3637. * Bits 31:0
  3638. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3639. * for WDI_IPA RX indication ring
  3640. * - RX_IND_WR_IDX_ADDR_LO
  3641. * Bits 31:0
  3642. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3643. * Lower 4 bytes of DDR address where WIFI FW
  3644. * updates the Write Index for WDI_IPA RX indication ring
  3645. * - RX_IND_WR_IDX_ADDR_HI
  3646. * Bits 31:0
  3647. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3648. * Higher 4 bytes of DDR address where WIFI FW
  3649. * updates the Write Index for WDI_IPA RX indication ring
  3650. * - RX_RING2_BASE_ADDR_LO
  3651. * Bits 31:0
  3652. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3653. * - RX_RING2_BASE_ADDR_HI
  3654. * Bits 31:0
  3655. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3656. * - RX_RING2_SIZE
  3657. * Bits 31:0
  3658. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3659. * - RX_RING2_RD_IDX_ADDR_LO
  3660. * Bits 31:0
  3661. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3662. * DDR address where IPA uC updates the Read Index for Ring2.
  3663. * If Second RX ring is completion ring, this is NOT used
  3664. * - RX_RING2_RD_IDX_ADDR_HI
  3665. * Bits 31:0
  3666. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3667. * DDR address where IPA uC updates the Read Index for Ring2.
  3668. * If Second RX ring is completion ring, this is NOT used
  3669. * - RX_RING2_WR_IDX_ADDR_LO
  3670. * Bits 31:0
  3671. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3672. * DDR address where WIFI FW updates the Write Index
  3673. * for WDI_IPA RX ring2
  3674. * If second RX ring is completion ring, lower 4 bytes of
  3675. * DDR address where IPA uC updates the Write Index for Ring 2.
  3676. * - RX_RING2_WR_IDX_ADDR_HI
  3677. * Bits 31:0
  3678. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3679. * DDR address where WIFI FW updates the Write Index
  3680. * for WDI_IPA RX ring2
  3681. * If second RX ring is completion ring, higher 4 bytes of
  3682. * DDR address where IPA uC updates the Write Index for Ring 2.
  3683. */
  3684. #if HTT_PADDR64
  3685. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3686. #else
  3687. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3688. #endif
  3689. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3690. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3691. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3692. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3693. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3694. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3695. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3696. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3697. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3698. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3699. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3700. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3701. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3702. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3703. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3704. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3705. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3706. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3707. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3708. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3709. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3710. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3711. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3712. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3713. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3714. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3715. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3716. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3717. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3718. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3719. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3720. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3721. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3722. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3723. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3724. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3725. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3726. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3727. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3728. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3729. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3730. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3751. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3752. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3753. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3754. do { \
  3755. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3756. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3757. } while (0)
  3758. /* for systems using 32-bit format for bus addr */
  3759. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3760. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3761. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3762. do { \
  3763. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3764. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3765. } while (0)
  3766. /* for systems using 64-bit format for bus addr */
  3767. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3768. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3769. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3770. do { \
  3771. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3772. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3773. } while (0)
  3774. /* for systems using 64-bit format for bus addr */
  3775. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3776. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3777. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3778. do { \
  3779. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3780. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3781. } while (0)
  3782. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3783. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3784. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3785. do { \
  3786. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3787. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3788. } while (0)
  3789. /* for systems using 32-bit format for bus addr */
  3790. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3791. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3792. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3793. do { \
  3794. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3795. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3796. } while (0)
  3797. /* for systems using 64-bit format for bus addr */
  3798. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3799. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3800. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3801. do { \
  3802. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3803. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3804. } while (0)
  3805. /* for systems using 64-bit format for bus addr */
  3806. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3807. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3808. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3809. do { \
  3810. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3811. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3812. } while (0)
  3813. /* for systems using 32-bit format for bus addr */
  3814. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3815. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3816. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3817. do { \
  3818. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3819. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3820. } while (0)
  3821. /* for systems using 64-bit format for bus addr */
  3822. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3823. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3824. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3825. do { \
  3826. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3827. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3828. } while (0)
  3829. /* for systems using 64-bit format for bus addr */
  3830. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3831. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3832. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3833. do { \
  3834. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3835. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3836. } while (0)
  3837. /* for systems using 32-bit format for bus addr */
  3838. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3839. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3840. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3841. do { \
  3842. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3843. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3844. } while (0)
  3845. /* for systems using 64-bit format for bus addr */
  3846. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3847. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3848. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3849. do { \
  3850. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3851. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3852. } while (0)
  3853. /* for systems using 64-bit format for bus addr */
  3854. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3855. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3856. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3857. do { \
  3858. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3859. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3860. } while (0)
  3861. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3862. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3863. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3864. do { \
  3865. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3866. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3867. } while (0)
  3868. /* for systems using 32-bit format for bus addr */
  3869. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3870. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3871. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3872. do { \
  3873. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3874. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3875. } while (0)
  3876. /* for systems using 64-bit format for bus addr */
  3877. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3878. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3879. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3880. do { \
  3881. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3882. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3883. } while (0)
  3884. /* for systems using 64-bit format for bus addr */
  3885. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3886. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3887. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3888. do { \
  3889. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3890. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3891. } while (0)
  3892. /* for systems using 32-bit format for bus addr */
  3893. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3894. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3895. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3896. do { \
  3897. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3898. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3899. } while (0)
  3900. /* for systems using 64-bit format for bus addr */
  3901. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3902. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3903. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3904. do { \
  3905. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3906. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3907. } while (0)
  3908. /* for systems using 64-bit format for bus addr */
  3909. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3910. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3911. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3912. do { \
  3913. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3914. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3915. } while (0)
  3916. /* for systems using 32-bit format for bus addr */
  3917. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3918. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3919. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3920. do { \
  3921. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3922. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3923. } while (0)
  3924. /* for systems using 64-bit format for bus addr */
  3925. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3926. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3927. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3928. do { \
  3929. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3930. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3931. } while (0)
  3932. /* for systems using 64-bit format for bus addr */
  3933. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3934. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3935. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3936. do { \
  3937. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3938. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3939. } while (0)
  3940. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3941. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3942. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3943. do { \
  3944. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3945. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3946. } while (0)
  3947. /* for systems using 32-bit format for bus addr */
  3948. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3949. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3950. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3951. do { \
  3952. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3953. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3954. } while (0)
  3955. /* for systems using 64-bit format for bus addr */
  3956. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3957. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3958. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3959. do { \
  3960. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3961. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3962. } while (0)
  3963. /* for systems using 64-bit format for bus addr */
  3964. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3965. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3966. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3967. do { \
  3968. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3969. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3970. } while (0)
  3971. /* for systems using 32-bit format for bus addr */
  3972. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3973. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3974. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3975. do { \
  3976. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3977. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3978. } while (0)
  3979. /* for systems using 64-bit format for bus addr */
  3980. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3981. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3982. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3983. do { \
  3984. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3985. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3986. } while (0)
  3987. /* for systems using 64-bit format for bus addr */
  3988. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3989. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3990. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3991. do { \
  3992. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3993. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3994. } while (0)
  3995. /*
  3996. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3997. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3998. * addresses are stored in a XXX-bit field.
  3999. * This macro is used to define both htt_wdi_ipa_config32_t and
  4000. * htt_wdi_ipa_config64_t structs.
  4001. */
  4002. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4003. _paddr__tx_comp_ring_base_addr_, \
  4004. _paddr__tx_comp_wr_idx_addr_, \
  4005. _paddr__tx_ce_wr_idx_addr_, \
  4006. _paddr__rx_ind_ring_base_addr_, \
  4007. _paddr__rx_ind_rd_idx_addr_, \
  4008. _paddr__rx_ind_wr_idx_addr_, \
  4009. _paddr__rx_ring2_base_addr_,\
  4010. _paddr__rx_ring2_rd_idx_addr_,\
  4011. _paddr__rx_ring2_wr_idx_addr_) \
  4012. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4013. { \
  4014. /* DWORD 0: flags and meta-data */ \
  4015. A_UINT32 \
  4016. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4017. reserved: 8, \
  4018. tx_pkt_pool_size: 16;\
  4019. /* DWORD 1 */\
  4020. _paddr__tx_comp_ring_base_addr_;\
  4021. /* DWORD 2 (or 3)*/\
  4022. A_UINT32 tx_comp_ring_size;\
  4023. /* DWORD 3 (or 4)*/\
  4024. _paddr__tx_comp_wr_idx_addr_;\
  4025. /* DWORD 4 (or 6)*/\
  4026. _paddr__tx_ce_wr_idx_addr_;\
  4027. /* DWORD 5 (or 8)*/\
  4028. _paddr__rx_ind_ring_base_addr_;\
  4029. /* DWORD 6 (or 10)*/\
  4030. A_UINT32 rx_ind_ring_size;\
  4031. /* DWORD 7 (or 11)*/\
  4032. _paddr__rx_ind_rd_idx_addr_;\
  4033. /* DWORD 8 (or 13)*/\
  4034. _paddr__rx_ind_wr_idx_addr_;\
  4035. /* DWORD 9 (or 15)*/\
  4036. _paddr__rx_ring2_base_addr_;\
  4037. /* DWORD 10 (or 17) */\
  4038. A_UINT32 rx_ring2_size;\
  4039. /* DWORD 11 (or 18) */\
  4040. _paddr__rx_ring2_rd_idx_addr_;\
  4041. /* DWORD 12 (or 20) */\
  4042. _paddr__rx_ring2_wr_idx_addr_;\
  4043. } POSTPACK
  4044. /* define a htt_wdi_ipa_config32_t type */
  4045. 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));
  4046. /* define a htt_wdi_ipa_config64_t type */
  4047. 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));
  4048. #if HTT_PADDR64
  4049. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4050. #else
  4051. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4052. #endif
  4053. enum htt_wdi_ipa_op_code {
  4054. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4055. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4056. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4057. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4058. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4059. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4060. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4061. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4062. /* keep this last */
  4063. HTT_WDI_IPA_OPCODE_MAX
  4064. };
  4065. /**
  4066. * @brief HTT WDI_IPA Operation Request Message
  4067. *
  4068. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4069. *
  4070. * @details
  4071. * HTT WDI_IPA Operation Request message is sent by host
  4072. * to either suspend or resume WDI_IPA TX or RX path.
  4073. * |31 24|23 16|15 8|7 0|
  4074. * |----------------+----------------+----------------+----------------|
  4075. * | op_code | Rsvd | msg_type |
  4076. * |-------------------------------------------------------------------|
  4077. *
  4078. * Header fields:
  4079. * - MSG_TYPE
  4080. * Bits 7:0
  4081. * Purpose: Identifies this as WDI_IPA Operation Request message
  4082. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4083. * - OP_CODE
  4084. * Bits 31:16
  4085. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4086. * value: = enum htt_wdi_ipa_op_code
  4087. */
  4088. PREPACK struct htt_wdi_ipa_op_request_t
  4089. {
  4090. /* DWORD 0: flags and meta-data */
  4091. A_UINT32
  4092. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4093. reserved: 8,
  4094. op_code: 16;
  4095. } POSTPACK;
  4096. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4097. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4098. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4099. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4100. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4101. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4102. do { \
  4103. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4104. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4105. } while (0)
  4106. /*
  4107. * @brief host -> target HTT_SRING_SETUP message
  4108. *
  4109. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4110. *
  4111. * @details
  4112. * After target is booted up, Host can send SRING setup message for
  4113. * each host facing LMAC SRING. Target setups up HW registers based
  4114. * on setup message and confirms back to Host if response_required is set.
  4115. * Host should wait for confirmation message before sending new SRING
  4116. * setup message
  4117. *
  4118. * The message would appear as follows:
  4119. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4120. * |--------------- +-----------------+-----------------+-----------------|
  4121. * | ring_type | ring_id | pdev_id | msg_type |
  4122. * |----------------------------------------------------------------------|
  4123. * | ring_base_addr_lo |
  4124. * |----------------------------------------------------------------------|
  4125. * | ring_base_addr_hi |
  4126. * |----------------------------------------------------------------------|
  4127. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4128. * |----------------------------------------------------------------------|
  4129. * | ring_head_offset32_remote_addr_lo |
  4130. * |----------------------------------------------------------------------|
  4131. * | ring_head_offset32_remote_addr_hi |
  4132. * |----------------------------------------------------------------------|
  4133. * | ring_tail_offset32_remote_addr_lo |
  4134. * |----------------------------------------------------------------------|
  4135. * | ring_tail_offset32_remote_addr_hi |
  4136. * |----------------------------------------------------------------------|
  4137. * | ring_msi_addr_lo |
  4138. * |----------------------------------------------------------------------|
  4139. * | ring_msi_addr_hi |
  4140. * |----------------------------------------------------------------------|
  4141. * | ring_msi_data |
  4142. * |----------------------------------------------------------------------|
  4143. * | intr_timer_th |IM| intr_batch_counter_th |
  4144. * |----------------------------------------------------------------------|
  4145. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4146. * |----------------------------------------------------------------------|
  4147. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4148. * |----------------------------------------------------------------------|
  4149. * Where
  4150. * IM = sw_intr_mode
  4151. * RR = response_required
  4152. * PTCF = prefetch_timer_cfg
  4153. * IP = IPA drop flag
  4154. *
  4155. * The message is interpreted as follows:
  4156. * dword0 - b'0:7 - msg_type: This will be set to
  4157. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4158. * b'8:15 - pdev_id:
  4159. * 0 (for rings at SOC/UMAC level),
  4160. * 1/2/3 mac id (for rings at LMAC level)
  4161. * b'16:23 - ring_id: identify which ring is to setup,
  4162. * more details can be got from enum htt_srng_ring_id
  4163. * b'24:31 - ring_type: identify type of host rings,
  4164. * more details can be got from enum htt_srng_ring_type
  4165. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4166. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4167. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4168. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4169. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4170. * SW_TO_HW_RING.
  4171. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4172. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4173. * Lower 32 bits of memory address of the remote variable
  4174. * storing the 4-byte word offset that identifies the head
  4175. * element within the ring.
  4176. * (The head offset variable has type A_UINT32.)
  4177. * Valid for HW_TO_SW and SW_TO_SW rings.
  4178. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4179. * Upper 32 bits of memory address of the remote variable
  4180. * storing the 4-byte word offset that identifies the head
  4181. * element within the ring.
  4182. * (The head offset variable has type A_UINT32.)
  4183. * Valid for HW_TO_SW and SW_TO_SW rings.
  4184. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4185. * Lower 32 bits of memory address of the remote variable
  4186. * storing the 4-byte word offset that identifies the tail
  4187. * element within the ring.
  4188. * (The tail offset variable has type A_UINT32.)
  4189. * Valid for HW_TO_SW and SW_TO_SW rings.
  4190. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4191. * Upper 32 bits of memory address of the remote variable
  4192. * storing the 4-byte word offset that identifies the tail
  4193. * element within the ring.
  4194. * (The tail offset variable has type A_UINT32.)
  4195. * Valid for HW_TO_SW and SW_TO_SW rings.
  4196. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4197. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4198. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4199. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4200. * dword10 - b'0:31 - ring_msi_data: MSI data
  4201. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4202. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4203. * dword11 - b'0:14 - intr_batch_counter_th:
  4204. * batch counter threshold is in units of 4-byte words.
  4205. * HW internally maintains and increments batch count.
  4206. * (see SRING spec for detail description).
  4207. * When batch count reaches threshold value, an interrupt
  4208. * is generated by HW.
  4209. * b'15 - sw_intr_mode:
  4210. * This configuration shall be static.
  4211. * Only programmed at power up.
  4212. * 0: generate pulse style sw interrupts
  4213. * 1: generate level style sw interrupts
  4214. * b'16:31 - intr_timer_th:
  4215. * The timer init value when timer is idle or is
  4216. * initialized to start downcounting.
  4217. * In 8us units (to cover a range of 0 to 524 ms)
  4218. * dword12 - b'0:15 - intr_low_threshold:
  4219. * Used only by Consumer ring to generate ring_sw_int_p.
  4220. * Ring entries low threshold water mark, that is used
  4221. * in combination with the interrupt timer as well as
  4222. * the the clearing of the level interrupt.
  4223. * b'16:18 - prefetch_timer_cfg:
  4224. * Used only by Consumer ring to set timer mode to
  4225. * support Application prefetch handling.
  4226. * The external tail offset/pointer will be updated
  4227. * at following intervals:
  4228. * 3'b000: (Prefetch feature disabled; used only for debug)
  4229. * 3'b001: 1 usec
  4230. * 3'b010: 4 usec
  4231. * 3'b011: 8 usec (default)
  4232. * 3'b100: 16 usec
  4233. * Others: Reserverd
  4234. * b'19 - response_required:
  4235. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4236. * b'20 - ipa_drop_flag:
  4237. Indicates that host will config ipa drop threshold percentage
  4238. * b'21:31 - reserved: reserved for future use
  4239. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4240. * b'8:15 - ipa drop high threshold percentage:
  4241. * b'16:31 - Reserved
  4242. */
  4243. PREPACK struct htt_sring_setup_t {
  4244. A_UINT32 msg_type: 8,
  4245. pdev_id: 8,
  4246. ring_id: 8,
  4247. ring_type: 8;
  4248. A_UINT32 ring_base_addr_lo;
  4249. A_UINT32 ring_base_addr_hi;
  4250. A_UINT32 ring_size: 16,
  4251. ring_entry_size: 8,
  4252. ring_misc_cfg_flag: 8;
  4253. A_UINT32 ring_head_offset32_remote_addr_lo;
  4254. A_UINT32 ring_head_offset32_remote_addr_hi;
  4255. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4256. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4257. A_UINT32 ring_msi_addr_lo;
  4258. A_UINT32 ring_msi_addr_hi;
  4259. A_UINT32 ring_msi_data;
  4260. A_UINT32 intr_batch_counter_th: 15,
  4261. sw_intr_mode: 1,
  4262. intr_timer_th: 16;
  4263. A_UINT32 intr_low_threshold: 16,
  4264. prefetch_timer_cfg: 3,
  4265. response_required: 1,
  4266. ipa_drop_flag: 1,
  4267. reserved1: 11;
  4268. A_UINT32 ipa_drop_low_threshold: 8,
  4269. ipa_drop_high_threshold: 8,
  4270. reserved: 16;
  4271. } POSTPACK;
  4272. enum htt_srng_ring_type {
  4273. HTT_HW_TO_SW_RING = 0,
  4274. HTT_SW_TO_HW_RING,
  4275. HTT_SW_TO_SW_RING,
  4276. /* Insert new ring types above this line */
  4277. };
  4278. enum htt_srng_ring_id {
  4279. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4280. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4281. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4282. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4283. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4284. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4285. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4286. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4287. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4288. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4289. HTT_TX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4290. HTT_TX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4291. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4292. HTT_RX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4293. HTT_RX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4294. /* Add Other SRING which can't be directly configured by host software above this line */
  4295. };
  4296. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4297. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4298. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4299. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4300. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4301. HTT_SRING_SETUP_PDEV_ID_S)
  4302. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4303. do { \
  4304. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4305. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4306. } while (0)
  4307. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4308. #define HTT_SRING_SETUP_RING_ID_S 16
  4309. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4310. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4311. HTT_SRING_SETUP_RING_ID_S)
  4312. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4313. do { \
  4314. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4315. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4316. } while (0)
  4317. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4318. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4319. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4320. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4321. HTT_SRING_SETUP_RING_TYPE_S)
  4322. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4323. do { \
  4324. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4325. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4326. } while (0)
  4327. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4328. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4329. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4330. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4331. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4332. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4333. do { \
  4334. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4335. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4336. } while (0)
  4337. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4338. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4339. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4340. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4341. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4342. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4343. do { \
  4344. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4345. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4346. } while (0)
  4347. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4348. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4349. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4350. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4351. HTT_SRING_SETUP_RING_SIZE_S)
  4352. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4353. do { \
  4354. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4355. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4356. } while (0)
  4357. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4358. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4359. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4360. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4361. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4362. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4363. do { \
  4364. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4365. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4366. } while (0)
  4367. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4368. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4369. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4370. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4371. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4372. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4373. do { \
  4374. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4375. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4376. } while (0)
  4377. /* This control bit is applicable to only Producer, which updates Ring ID field
  4378. * of each descriptor before pushing into the ring.
  4379. * 0: updates ring_id(default)
  4380. * 1: ring_id updating disabled */
  4381. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4382. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4383. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4384. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4385. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4386. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4387. do { \
  4388. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4389. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4390. } while (0)
  4391. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4392. * of each descriptor before pushing into the ring.
  4393. * 0: updates Loopcnt(default)
  4394. * 1: Loopcnt updating disabled */
  4395. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4396. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4397. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4398. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4399. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4400. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4401. do { \
  4402. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4403. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4404. } while (0)
  4405. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4406. * into security_id port of GXI/AXI. */
  4407. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4408. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4409. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4410. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4411. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4412. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4413. do { \
  4414. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4415. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4416. } while (0)
  4417. /* During MSI write operation, SRNG drives value of this register bit into
  4418. * swap bit of GXI/AXI. */
  4419. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4420. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4421. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4422. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4423. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4424. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4425. do { \
  4426. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4427. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4428. } while (0)
  4429. /* During Pointer write operation, SRNG drives value of this register bit into
  4430. * swap bit of GXI/AXI. */
  4431. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4432. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4433. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4434. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4435. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4436. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4437. do { \
  4438. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4439. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4440. } while (0)
  4441. /* During any data or TLV write operation, SRNG drives value of this register
  4442. * bit into swap bit of GXI/AXI. */
  4443. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4444. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4445. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4446. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4447. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4448. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4449. do { \
  4450. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4451. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4452. } while (0)
  4453. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4454. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4455. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4456. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4457. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4458. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4459. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4460. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4461. do { \
  4462. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4463. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4464. } while (0)
  4465. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4466. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4467. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4468. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4469. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4470. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4471. do { \
  4472. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4473. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4474. } while (0)
  4475. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4476. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4477. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4478. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4479. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4480. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4481. do { \
  4482. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4483. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4484. } while (0)
  4485. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4486. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4487. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4488. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4489. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4490. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4491. do { \
  4492. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4493. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4494. } while (0)
  4495. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4496. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4497. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4498. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4499. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4500. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4501. do { \
  4502. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4503. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4504. } while (0)
  4505. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4506. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4507. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4508. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4509. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4510. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4511. do { \
  4512. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4513. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4514. } while (0)
  4515. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4516. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4517. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4518. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4519. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4520. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4521. do { \
  4522. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4523. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4524. } while (0)
  4525. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4526. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4527. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4528. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4529. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4530. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4531. do { \
  4532. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4533. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4534. } while (0)
  4535. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4536. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4537. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4538. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4539. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4540. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4541. do { \
  4542. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4543. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4544. } while (0)
  4545. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4546. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4547. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4548. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4549. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4550. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4551. do { \
  4552. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4553. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4554. } while (0)
  4555. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4556. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4557. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4558. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4559. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4560. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4561. do { \
  4562. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4563. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4564. } while (0)
  4565. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4566. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4567. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4568. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4569. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4570. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4571. do { \
  4572. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4573. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4574. } while (0)
  4575. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4576. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4577. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4578. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4579. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4580. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4581. do { \
  4582. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4583. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4584. } while (0)
  4585. /**
  4586. * @brief host -> target RX ring selection config message
  4587. *
  4588. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4589. *
  4590. * @details
  4591. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4592. * configure RXDMA rings.
  4593. * The configuration is per ring based and includes both packet subtypes
  4594. * and PPDU/MPDU TLVs.
  4595. *
  4596. * The message would appear as follows:
  4597. *
  4598. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4599. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4600. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4601. * |-------------------------------------------------------------------|
  4602. * | rsvd2 | ring_buffer_size |
  4603. * |-------------------------------------------------------------------|
  4604. * | packet_type_enable_flags_0 |
  4605. * |-------------------------------------------------------------------|
  4606. * | packet_type_enable_flags_1 |
  4607. * |-------------------------------------------------------------------|
  4608. * | packet_type_enable_flags_2 |
  4609. * |-------------------------------------------------------------------|
  4610. * | packet_type_enable_flags_3 |
  4611. * |-------------------------------------------------------------------|
  4612. * | tlv_filter_in_flags |
  4613. * |-------------------------------------------------------------------|
  4614. * | rx_header_offset | rx_packet_offset |
  4615. * |-------------------------------------------------------------------|
  4616. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4617. * |-------------------------------------------------------------------|
  4618. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4619. * |-------------------------------------------------------------------|
  4620. * | rsvd3 | rx_attention_offset |
  4621. * |-------------------------------------------------------------------|
  4622. * | rsvd4 | mo| fp| rx_drop_threshold |
  4623. * | |ndp|ndp| |
  4624. * |-------------------------------------------------------------------|
  4625. * Where:
  4626. * PS = pkt_swap
  4627. * SS = status_swap
  4628. * OV = rx_offsets_valid
  4629. * DT = drop_thresh_valid
  4630. * The message is interpreted as follows:
  4631. * dword0 - b'0:7 - msg_type: This will be set to
  4632. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4633. * b'8:15 - pdev_id:
  4634. * 0 (for rings at SOC/UMAC level),
  4635. * 1/2/3 mac id (for rings at LMAC level)
  4636. * b'16:23 - ring_id : Identify the ring to configure.
  4637. * More details can be got from enum htt_srng_ring_id
  4638. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4639. * BUF_RING_CFG_0 defs within HW .h files,
  4640. * e.g. wmac_top_reg_seq_hwioreg.h
  4641. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4642. * BUF_RING_CFG_0 defs within HW .h files,
  4643. * e.g. wmac_top_reg_seq_hwioreg.h
  4644. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4645. * configuration fields are valid
  4646. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4647. * rx_drop_threshold field is valid
  4648. * b'28:31 - rsvd1: reserved for future use
  4649. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4650. * in byte units.
  4651. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4652. * - b'16:31 - rsvd2: Reserved for future use
  4653. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4654. * Enable MGMT packet from 0b0000 to 0b1001
  4655. * bits from low to high: FP, MD, MO - 3 bits
  4656. * FP: Filter_Pass
  4657. * MD: Monitor_Direct
  4658. * MO: Monitor_Other
  4659. * 10 mgmt subtypes * 3 bits -> 30 bits
  4660. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4661. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4662. * Enable MGMT packet from 0b1010 to 0b1111
  4663. * bits from low to high: FP, MD, MO - 3 bits
  4664. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4665. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4666. * Enable CTRL packet from 0b0000 to 0b1001
  4667. * bits from low to high: FP, MD, MO - 3 bits
  4668. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4669. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4670. * Enable CTRL packet from 0b1010 to 0b1111,
  4671. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4672. * bits from low to high: FP, MD, MO - 3 bits
  4673. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4674. * dword6 - b'0:31 - tlv_filter_in_flags:
  4675. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4676. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4677. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4678. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4679. * A value of 0 will be considered as ignore this config.
  4680. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4681. * e.g. wmac_top_reg_seq_hwioreg.h
  4682. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4683. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4684. * A value of 0 will be considered as ignore this config.
  4685. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4686. * e.g. wmac_top_reg_seq_hwioreg.h
  4687. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4688. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4689. * A value of 0 will be considered as ignore this config.
  4690. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4691. * e.g. wmac_top_reg_seq_hwioreg.h
  4692. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4693. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4694. * A value of 0 will be considered as ignore this config.
  4695. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4696. * e.g. wmac_top_reg_seq_hwioreg.h
  4697. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4698. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4699. * A value of 0 will be considered as ignore this config.
  4700. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4701. * e.g. wmac_top_reg_seq_hwioreg.h
  4702. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4703. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4704. * A value of 0 will be considered as ignore this config.
  4705. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4706. * e.g. wmac_top_reg_seq_hwioreg.h
  4707. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4708. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4709. * A value of 0 will be considered as ignore this config.
  4710. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4711. * e.g. wmac_top_reg_seq_hwioreg.h
  4712. * - b'16:31 - rsvd3 for future use
  4713. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4714. * to source rings. Consumer drops packets if the available
  4715. * words in the ring falls below the configured threshold
  4716. * value.
  4717. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4718. * by host. 1 -> subscribed
  4719. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4720. * by host. 1 -> subscribed
  4721. */
  4722. PREPACK struct htt_rx_ring_selection_cfg_t {
  4723. A_UINT32 msg_type: 8,
  4724. pdev_id: 8,
  4725. ring_id: 8,
  4726. status_swap: 1,
  4727. pkt_swap: 1,
  4728. rx_offsets_valid: 1,
  4729. drop_thresh_valid: 1,
  4730. rsvd1: 4;
  4731. A_UINT32 ring_buffer_size: 16,
  4732. rsvd2: 16;
  4733. A_UINT32 packet_type_enable_flags_0;
  4734. A_UINT32 packet_type_enable_flags_1;
  4735. A_UINT32 packet_type_enable_flags_2;
  4736. A_UINT32 packet_type_enable_flags_3;
  4737. A_UINT32 tlv_filter_in_flags;
  4738. A_UINT32 rx_packet_offset: 16,
  4739. rx_header_offset: 16;
  4740. A_UINT32 rx_mpdu_end_offset: 16,
  4741. rx_mpdu_start_offset: 16;
  4742. A_UINT32 rx_msdu_end_offset: 16,
  4743. rx_msdu_start_offset: 16;
  4744. A_UINT32 rx_attn_offset: 16,
  4745. rsvd3: 16;
  4746. A_UINT32 rx_drop_threshold: 10,
  4747. fp_ndp: 1,
  4748. mo_ndp: 1,
  4749. rsvd4: 20;
  4750. } POSTPACK;
  4751. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4752. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4753. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4754. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4755. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4756. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4757. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4758. do { \
  4759. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4760. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4761. } while (0)
  4762. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4763. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4764. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4765. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4766. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4767. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4768. do { \
  4769. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4770. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4771. } while (0)
  4772. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4773. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4774. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4775. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4776. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4777. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4778. do { \
  4779. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4780. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4781. } while (0)
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4785. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4786. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4788. do { \
  4789. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4790. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4791. } while (0)
  4792. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4793. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4794. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4795. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4796. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4797. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4798. do { \
  4799. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4800. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4801. } while (0)
  4802. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4803. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4804. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4805. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4806. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4807. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4808. do { \
  4809. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4810. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4811. } while (0)
  4812. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4813. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4814. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4815. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4816. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4817. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4818. do { \
  4819. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4820. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4821. } while (0)
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4825. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4826. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4828. do { \
  4829. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4830. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4831. } while (0)
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4835. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4836. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4838. do { \
  4839. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4840. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4841. } while (0)
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4845. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4846. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4848. do { \
  4849. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4850. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4851. } while (0)
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4855. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4856. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4858. do { \
  4859. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4860. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4861. } while (0)
  4862. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4863. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4864. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4865. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4866. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4867. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4868. do { \
  4869. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4870. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4871. } while (0)
  4872. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4873. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4874. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4875. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4876. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4877. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4878. do { \
  4879. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4880. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4881. } while (0)
  4882. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4883. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4884. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4885. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4886. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4887. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4888. do { \
  4889. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4890. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4891. } while (0)
  4892. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4893. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4894. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4895. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4896. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4897. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4898. do { \
  4899. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4900. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4901. } while (0)
  4902. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4903. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4904. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4905. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4906. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4907. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4908. do { \
  4909. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4910. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4911. } while (0)
  4912. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4913. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4914. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4915. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4916. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4917. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4918. do { \
  4919. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4920. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4921. } while (0)
  4922. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4923. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4924. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4925. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4926. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4927. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4928. do { \
  4929. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4930. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4931. } while (0)
  4932. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4933. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4934. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4935. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4936. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4937. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4938. do { \
  4939. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4940. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4941. } while (0)
  4942. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4943. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4944. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4945. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4946. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4947. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4948. do { \
  4949. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4950. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4951. } while (0)
  4952. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4953. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4954. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4955. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4956. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4957. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4958. do { \
  4959. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4960. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4961. } while (0)
  4962. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4963. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4964. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4965. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4966. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4967. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4968. do { \
  4969. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4970. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4971. } while (0)
  4972. /*
  4973. * Subtype based MGMT frames enable bits.
  4974. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4975. */
  4976. /* association request */
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4983. /* association response */
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4990. /* Reassociation request */
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4997. /* Reassociation response */
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5004. /* Probe request */
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5011. /* Probe response */
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5018. /* Timing Advertisement */
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5025. /* Reserved */
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5032. /* Beacon */
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5039. /* ATIM */
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5046. /* Disassociation */
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5053. /* Authentication */
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5060. /* Deauthentication */
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5067. /* Action */
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5074. /* Action No Ack */
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5081. /* Reserved */
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5088. /*
  5089. * Subtype based CTRL frames enable bits.
  5090. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5091. */
  5092. /* Reserved */
  5093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5099. /* Reserved */
  5100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5106. /* Reserved */
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5113. /* Reserved */
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5120. /* Reserved */
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5127. /* Reserved */
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5134. /* Reserved */
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5141. /* Control Wrapper */
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5148. /* Block Ack Request */
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5155. /* Block Ack*/
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5162. /* PS-POLL */
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5169. /* RTS */
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5176. /* CTS */
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5183. /* ACK */
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5190. /* CF-END */
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5197. /* CF-END + CF-ACK */
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5204. /* Multicast data */
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5211. /* Unicast data */
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5218. /* NULL data */
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5226. do { \
  5227. HTT_CHECK_SET_VAL(httsym, value); \
  5228. (word) |= (value) << httsym##_S; \
  5229. } while (0)
  5230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5231. (((word) & httsym##_M) >> httsym##_S)
  5232. #define htt_rx_ring_pkt_enable_subtype_set( \
  5233. word, flag, mode, type, subtype, val) \
  5234. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5235. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5236. #define htt_rx_ring_pkt_enable_subtype_get( \
  5237. word, flag, mode, type, subtype) \
  5238. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5239. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5240. /* Definition to filter in TLVs */
  5241. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5258. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5259. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5262. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5263. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5264. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5265. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5266. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5267. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5268. do { \
  5269. HTT_CHECK_SET_VAL(httsym, enable); \
  5270. (word) |= (enable) << httsym##_S; \
  5271. } while (0)
  5272. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5273. (((word) & httsym##_M) >> httsym##_S)
  5274. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5275. HTT_RX_RING_TLV_ENABLE_SET( \
  5276. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5277. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5278. HTT_RX_RING_TLV_ENABLE_GET( \
  5279. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5280. /**
  5281. * @brief host -> target TX monitor config message
  5282. *
  5283. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5284. *
  5285. * @details
  5286. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5287. * configure RXDMA rings.
  5288. * The configuration is per ring based and includes both packet types
  5289. * and PPDU/MPDU TLVs.
  5290. *
  5291. * The message would appear as follows:
  5292. *
  5293. * |31 28|27|26|25|24|23 22|21 19|18 16|15 8|7 |2 0|
  5294. * |-----+-----+--+--+-----=-----+------+----------------+---------+-----|
  5295. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5296. * |-----+--------+--------+-----+------+--------------------------------|
  5297. * |rsvd2| DATA | CTRL | MGMT| PT | ring_buffer_size |
  5298. * |---------------------------------------------------------------+-----|
  5299. * | rsvd3 | E |
  5300. * |---------------------------------------------------------------------|
  5301. * | tlv_filter_mask_in0 |
  5302. * |---------------------------------------------------------------------|
  5303. * | tlv_filter_mask_in1 |
  5304. * |---------------------------------------------------------------------|
  5305. * | tlv_filter_mask_in2 |
  5306. * |---------------------------------------------------------------------|
  5307. * | tlv_filter_mask_in3 |
  5308. * |------------------------------------+--------------------------------|
  5309. * | tx_peer_entry_word_mask | tx_fes_setup_word_mask |
  5310. * |------------------------------------+--------------------------------|
  5311. * | tx_msdu_start_word_mask | tx_queue_ext_word_mask |
  5312. * |------------------------------------+--------------------------------|
  5313. * | pcu_ppdu_setup_word_mask | tx_mpdu_start_word_mask |
  5314. * |-----------------------+-----+------+--------------------------------|
  5315. * | rsvd4 | EMM | PT | rxpcu_user_setup_word_mask |
  5316. * |---------------------------------------------------------------------|
  5317. *
  5318. * Where:
  5319. * PS = pkt_swap
  5320. * SS = status_swap
  5321. * The message is interpreted as follows:
  5322. * dword0 - b'0:7 - msg_type: This will be set to
  5323. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5324. * b'8:15 - pdev_id:
  5325. * 0 (for rings at SOC/UMAC level),
  5326. * 1/2/3 mac id (for rings at LMAC level)
  5327. * b'16:23 - ring_id : Identify the ring to configure.
  5328. * More details can be got from enum htt_srng_ring_id
  5329. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5330. * BUF_RING_CFG_0 defs within HW .h files,
  5331. * e.g. wmac_top_reg_seq_hwioreg.h
  5332. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5333. * BUF_RING_CFG_0 defs within HW .h files,
  5334. * e.g. wmac_top_reg_seq_hwioreg.h
  5335. * b'26:31 - rsvd1: reserved for future use
  5336. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5337. * in byte units.
  5338. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5339. * b'16:18 - pkt_type_config_length (PT): MGMT, CTRL, DATA
  5340. * Each bit out of 3 bits represents if configurable length
  5341. * is valid and needs to programmed.
  5342. * b'19:21 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5343. * 64, 128, 256.
  5344. * If all 3 bits are set config length is > 256
  5345. * b'22:24 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5346. * 64, 128, 256.
  5347. * If all 3 bits are set config length is > 256
  5348. * b'25:27 - config_length_data(DATA) for DATA: Each bit set represent
  5349. * 64, 128, 256.
  5350. * If all 3 bits are set config length is > 256
  5351. * - b'28:31 - rsvd2: Reserved for future use
  5352. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5353. * b'3:31 - rsvd3: Reserved for future use
  5354. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5355. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5356. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5357. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5358. * dword7 - b'0:15 - tx_fes_setup_word_mask:
  5359. * - b'16:31 - tx_peer_entry_word_mask:
  5360. * dword8 - b'0:15 - tx_queue_ext_word_mask:
  5361. * - b'16:31 - tx_msdu_start_word_mask:
  5362. * dword9 - b'0:15 - tx_mpdu_start_word_mask:
  5363. * - b'16:31 - pcu_ppdu_setup_word_mask:
  5364. * dword10- b'0:15 - rxpcu_user_setup_word_mask:
  5365. * - b'16:18 - pkt_type_msdu_or_mpdu_logging (PT): MGMT, CTRL, DATA
  5366. * Each bit out of 3 bits represents if MSDU/MPDU
  5367. * logging is enabled
  5368. * - b'19:21 - enable_msdu_or_mpdu_logging (EMM): For MGMT, CTRL, DATA
  5369. * 0 -> MSDU level logging is enabled
  5370. * (valid only if bit is set in
  5371. * pkt_type_msdu_or_mpdu_logging)
  5372. * 1 -> MPDU level logging is enabled
  5373. * (valid only if bit is set in
  5374. * pkt_type_msdu_or_mpdu_logging)
  5375. * - b'22:31 - rsvd4 for future use
  5376. */
  5377. PREPACK struct htt_tx_monitor_cfg_t {
  5378. A_UINT32 msg_type: 8,
  5379. pdev_id: 8,
  5380. ring_id: 8,
  5381. status_swap: 1,
  5382. pkt_swap: 1,
  5383. rsvd1: 6;
  5384. A_UINT32 ring_buffer_size: 16,
  5385. pkt_type_config_length: 3,
  5386. config_length_mgmt: 3,
  5387. config_length_ctrl: 3,
  5388. config_length_data: 3,
  5389. rsvd2: 4;
  5390. A_UINT32 pkt_type_enable_flags: 3,
  5391. rsvd3: 29;
  5392. A_UINT32 tlv_filter_mask_in0;
  5393. A_UINT32 tlv_filter_mask_in1;
  5394. A_UINT32 tlv_filter_mask_in2;
  5395. A_UINT32 tlv_filter_mask_in3;
  5396. A_UINT32 tx_fes_setup_word_mask: 16,
  5397. tx_peer_entry_word_mask: 16;
  5398. A_UINT32 tx_queue_ext_word_mask: 16,
  5399. tx_msdu_start_word_mask: 16;
  5400. A_UINT32 tx_mpdu_start_word_mask: 16,
  5401. pcu_ppdu_setup_word_mask: 16;
  5402. A_UINT32 rxpcu_user_setup_word_mask: 16,
  5403. pkt_type_msdu_or_mpdu_logging: 3,
  5404. enable_msdu_or_mpdu_logging: 3,
  5405. rsvd4: 10;
  5406. } POSTPACK;
  5407. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5408. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5409. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5410. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5411. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5412. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5413. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5414. do { \
  5415. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5416. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5417. } while (0)
  5418. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5419. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5420. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5421. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5422. HTT_TX_MONITOR_CFG_RING_ID_S)
  5423. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5424. do { \
  5425. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5426. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5427. } while (0)
  5428. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5429. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5430. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5431. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5432. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5433. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5434. do { \
  5435. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5436. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5437. } while (0)
  5438. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5439. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5440. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5441. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5442. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5443. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5446. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5447. } while (0)
  5448. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5449. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5450. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5451. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5452. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5453. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5454. do { \
  5455. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5456. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5457. } while (0)
  5458. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M 0x00070000
  5459. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S 16
  5460. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_GET(_var) \
  5461. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M) >> \
  5462. HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)
  5463. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH, _val); \
  5466. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)); \
  5467. } while (0)
  5468. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00380000
  5469. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 19
  5470. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5471. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5472. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5473. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5474. do { \
  5475. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5476. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5477. } while (0)
  5478. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x01C00000
  5479. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 22
  5480. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5481. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5482. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5483. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5484. do { \
  5485. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5486. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5487. } while (0)
  5488. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x0E000000
  5489. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 25
  5490. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5491. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5492. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5493. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5496. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5497. } while (0)
  5498. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5499. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5500. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5501. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5502. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5503. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5506. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5507. } while (0)
  5508. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5509. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5510. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5511. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5512. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5513. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5516. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5517. } while (0)
  5518. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x0000ffff
  5519. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5520. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5521. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5522. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5523. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5524. do { \
  5525. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5526. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5527. } while (0)
  5528. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0xffff0000
  5529. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 16
  5530. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5531. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5532. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5533. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5536. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5537. } while (0)
  5538. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x0000ffff
  5539. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 0
  5540. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5541. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5542. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5543. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5546. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5547. } while (0)
  5548. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xffff0000
  5549. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 16
  5550. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5551. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5552. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5553. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5556. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5557. } while (0)
  5558. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x0000ffff
  5559. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5560. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5561. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5562. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5563. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5566. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5567. } while (0)
  5568. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffff0000
  5569. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 16
  5570. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5571. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5572. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5573. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5576. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5577. } while (0)
  5578. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ffff
  5579. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 0
  5580. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5581. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5582. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5583. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5586. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5587. } while (0)
  5588. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5589. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5590. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5591. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5592. HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5593. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5594. do { \
  5595. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5596. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5597. } while (0)
  5598. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00380000
  5599. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 19
  5600. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5601. (((_var) & HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5602. HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5603. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5604. do { \
  5605. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5606. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5607. } while (0)
  5608. /*
  5609. * pkt_type_config_length
  5610. */
  5611. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_M 0x00000001
  5612. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_S 0
  5613. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_M 0x00000002
  5614. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_S 1
  5615. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_M 0x00000004
  5616. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_S 2
  5617. /*
  5618. * pkt_type_enable_flags
  5619. */
  5620. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00010000
  5621. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 16
  5622. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00020000
  5623. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 17
  5624. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00040000
  5625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 18
  5626. /*
  5627. * pkt_type_msdu_or_mpdu_logging
  5628. * */
  5629. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5636. do { \
  5637. HTT_CHECK_SET_VAL(httsym, value); \
  5638. (word) |= (value) << httsym##_S; \
  5639. } while (0)
  5640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5641. (((word) & httsym##_M) >> httsym##_S)
  5642. /* mode -> CONFIG_LENGTH, ENABLE_FLAGS, MSDU_OR_MPDU_LOGGING
  5643. * type -> MGMT, CTRL, DATA*/
  5644. #define htt_tx_ring_pkt_type_set( \
  5645. word, mode, type, val) \
  5646. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5647. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5648. #define htt_tx_ring_pkt_type_get( \
  5649. word, mode, type) \
  5650. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5651. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5652. /* Definition to filter in TLVs */
  5653. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5717. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5718. do { \
  5719. HTT_CHECK_SET_VAL(httsym, enable); \
  5720. (word) |= (enable) << httsym##_S; \
  5721. } while (0)
  5722. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5723. (((word) & httsym##_M) >> httsym##_S)
  5724. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5725. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5726. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5727. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5728. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5729. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  5758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  5759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  5760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  5761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  5762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  5763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  5764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  5765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  5766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  5767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  5768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  5769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  5770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  5771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  5772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  5773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  5774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  5775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  5776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  5777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  5778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  5779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  5780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  5781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  5782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  5783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  5784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  5785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  5786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  5787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  5788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  5789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  5790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_M 0x40000000
  5791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_S 30
  5792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_M 0x80000000
  5793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_S 31
  5794. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  5795. do { \
  5796. HTT_CHECK_SET_VAL(httsym, enable); \
  5797. (word) |= (enable) << httsym##_S; \
  5798. } while (0)
  5799. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  5800. (((word) & httsym##_M) >> httsym##_S)
  5801. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  5802. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  5803. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  5804. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  5805. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  5806. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  5807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  5808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  5809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  5810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  5811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  5812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  5813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  5814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  5815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  5816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  5817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  5818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  5819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  5820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  5821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  5822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  5823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  5824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  5825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  5826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  5827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  5828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  5829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  5830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  5831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  5832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  5833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  5834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  5835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  5836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  5837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  5838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  5839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  5840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  5841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  5842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  5843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  5844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  5845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  5846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  5847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  5848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  5849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  5850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  5851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  5852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  5853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  5854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  5855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  5856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  5857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  5858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  5859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  5860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  5861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_M 0x08000000
  5862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_S 27
  5863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  5864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_S 28
  5865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_M 0x20000000
  5866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_S 29
  5867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_M 0x40000000
  5868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_S 30
  5869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  5870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_S 31
  5871. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  5872. do { \
  5873. HTT_CHECK_SET_VAL(httsym, enable); \
  5874. (word) |= (enable) << httsym##_S; \
  5875. } while (0)
  5876. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  5877. (((word) & httsym##_M) >> httsym##_S)
  5878. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  5879. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  5880. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  5881. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  5882. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  5883. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  5884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  5885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  5886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  5887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  5888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  5889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  5890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  5891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  5892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  5893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  5894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  5923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  5924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  5925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  5926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  5927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  5928. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  5929. do { \
  5930. HTT_CHECK_SET_VAL(httsym, enable); \
  5931. (word) |= (enable) << httsym##_S; \
  5932. } while (0)
  5933. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  5934. (((word) & httsym##_M) >> httsym##_S)
  5935. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  5936. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  5937. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  5938. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  5939. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  5940. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  5941. /**
  5942. * @brief host --> target Receive Flow Steering configuration message definition
  5943. *
  5944. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5945. *
  5946. * host --> target Receive Flow Steering configuration message definition.
  5947. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5948. * The reason for this is we want RFS to be configured and ready before MAC
  5949. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5950. *
  5951. * |31 24|23 16|15 9|8|7 0|
  5952. * |----------------+----------------+----------------+----------------|
  5953. * | reserved |E| msg type |
  5954. * |-------------------------------------------------------------------|
  5955. * Where E = RFS enable flag
  5956. *
  5957. * The RFS_CONFIG message consists of a single 4-byte word.
  5958. *
  5959. * Header fields:
  5960. * - MSG_TYPE
  5961. * Bits 7:0
  5962. * Purpose: identifies this as a RFS config msg
  5963. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5964. * - RFS_CONFIG
  5965. * Bit 8
  5966. * Purpose: Tells target whether to enable (1) or disable (0)
  5967. * flow steering feature when sending rx indication messages to host
  5968. */
  5969. #define HTT_H2T_RFS_CONFIG_M 0x100
  5970. #define HTT_H2T_RFS_CONFIG_S 8
  5971. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5972. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5973. HTT_H2T_RFS_CONFIG_S)
  5974. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5975. do { \
  5976. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5977. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5978. } while (0)
  5979. #define HTT_RFS_CFG_REQ_BYTES 4
  5980. /**
  5981. * @brief host -> target FW extended statistics retrieve
  5982. *
  5983. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5984. *
  5985. * @details
  5986. * The following field definitions describe the format of the HTT host
  5987. * to target FW extended stats retrieve message.
  5988. * The message specifies the type of stats the host wants to retrieve.
  5989. *
  5990. * |31 24|23 16|15 8|7 0|
  5991. * |-----------------------------------------------------------|
  5992. * | reserved | stats type | pdev_mask | msg type |
  5993. * |-----------------------------------------------------------|
  5994. * | config param [0] |
  5995. * |-----------------------------------------------------------|
  5996. * | config param [1] |
  5997. * |-----------------------------------------------------------|
  5998. * | config param [2] |
  5999. * |-----------------------------------------------------------|
  6000. * | config param [3] |
  6001. * |-----------------------------------------------------------|
  6002. * | reserved |
  6003. * |-----------------------------------------------------------|
  6004. * | cookie LSBs |
  6005. * |-----------------------------------------------------------|
  6006. * | cookie MSBs |
  6007. * |-----------------------------------------------------------|
  6008. * Header fields:
  6009. * - MSG_TYPE
  6010. * Bits 7:0
  6011. * Purpose: identifies this is a extended stats upload request message
  6012. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6013. * - PDEV_MASK
  6014. * Bits 8:15
  6015. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6016. * Value: This is a overloaded field, refer to usage and interpretation of
  6017. * PDEV in interface document.
  6018. * Bit 8 : Reserved for SOC stats
  6019. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6020. * Indicates MACID_MASK in DBS
  6021. * - STATS_TYPE
  6022. * Bits 23:16
  6023. * Purpose: identifies which FW statistics to upload
  6024. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6025. * - Reserved
  6026. * Bits 31:24
  6027. * - CONFIG_PARAM [0]
  6028. * Bits 31:0
  6029. * Purpose: give an opaque configuration value to the specified stats type
  6030. * Value: stats-type specific configuration value
  6031. * Refer to htt_stats.h for interpretation for each stats sub_type
  6032. * - CONFIG_PARAM [1]
  6033. * Bits 31:0
  6034. * Purpose: give an opaque configuration value to the specified stats type
  6035. * Value: stats-type specific configuration value
  6036. * Refer to htt_stats.h for interpretation for each stats sub_type
  6037. * - CONFIG_PARAM [2]
  6038. * Bits 31:0
  6039. * Purpose: give an opaque configuration value to the specified stats type
  6040. * Value: stats-type specific configuration value
  6041. * Refer to htt_stats.h for interpretation for each stats sub_type
  6042. * - CONFIG_PARAM [3]
  6043. * Bits 31:0
  6044. * Purpose: give an opaque configuration value to the specified stats type
  6045. * Value: stats-type specific configuration value
  6046. * Refer to htt_stats.h for interpretation for each stats sub_type
  6047. * - Reserved [31:0] for future use.
  6048. * - COOKIE_LSBS
  6049. * Bits 31:0
  6050. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6051. * message with its preceding host->target stats request message.
  6052. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6053. * - COOKIE_MSBS
  6054. * Bits 31:0
  6055. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6056. * message with its preceding host->target stats request message.
  6057. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6058. */
  6059. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6060. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6061. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6062. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6063. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6064. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6065. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6066. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6067. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6068. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6069. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6070. do { \
  6071. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6072. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6073. } while (0)
  6074. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6075. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6076. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6077. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6078. do { \
  6079. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6080. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6081. } while (0)
  6082. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6083. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6084. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6085. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6086. do { \
  6087. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6088. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6089. } while (0)
  6090. /**
  6091. * @brief host -> target FW PPDU_STATS request message
  6092. *
  6093. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6094. *
  6095. * @details
  6096. * The following field definitions describe the format of the HTT host
  6097. * to target FW for PPDU_STATS_CFG msg.
  6098. * The message allows the host to configure the PPDU_STATS_IND messages
  6099. * produced by the target.
  6100. *
  6101. * |31 24|23 16|15 8|7 0|
  6102. * |-----------------------------------------------------------|
  6103. * | REQ bit mask | pdev_mask | msg type |
  6104. * |-----------------------------------------------------------|
  6105. * Header fields:
  6106. * - MSG_TYPE
  6107. * Bits 7:0
  6108. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6109. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6110. * - PDEV_MASK
  6111. * Bits 8:15
  6112. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6113. * Value: This is a overloaded field, refer to usage and interpretation of
  6114. * PDEV in interface document.
  6115. * Bit 8 : Reserved for SOC stats
  6116. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6117. * Indicates MACID_MASK in DBS
  6118. * - REQ_TLV_BIT_MASK
  6119. * Bits 16:31
  6120. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6121. * needs to be included in the target's PPDU_STATS_IND messages.
  6122. * Value: refer htt_ppdu_stats_tlv_tag_t
  6123. *
  6124. */
  6125. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6126. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6127. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6128. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6129. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6130. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6131. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6132. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6133. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6134. do { \
  6135. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6136. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6137. } while (0)
  6138. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6139. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6140. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6141. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6142. do { \
  6143. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6144. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6145. } while (0)
  6146. /**
  6147. * @brief Host-->target HTT RX FSE setup message
  6148. *
  6149. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6150. *
  6151. * @details
  6152. * Through this message, the host will provide details of the flow tables
  6153. * in host DDR along with hash keys.
  6154. * This message can be sent per SOC or per PDEV, which is differentiated
  6155. * by pdev id values.
  6156. * The host will allocate flow search table and sends table size,
  6157. * physical DMA address of flow table, and hash keys to firmware to
  6158. * program into the RXOLE FSE HW block.
  6159. *
  6160. * The following field definitions describe the format of the RX FSE setup
  6161. * message sent from the host to target
  6162. *
  6163. * Header fields:
  6164. * dword0 - b'7:0 - msg_type: This will be set to
  6165. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6166. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6167. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6168. * pdev's LMAC ring.
  6169. * b'31:16 - reserved : Reserved for future use
  6170. * dword1 - b'19:0 - number of records: This field indicates the number of
  6171. * entries in the flow table. For example: 8k number of
  6172. * records is equivalent to
  6173. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6174. * b'27:20 - max search: This field specifies the skid length to FSE
  6175. * parser HW module whenever match is not found at the
  6176. * exact index pointed by hash.
  6177. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6178. * Refer htt_ip_da_sa_prefix below for more details.
  6179. * b'31:30 - reserved: Reserved for future use
  6180. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6181. * table allocated by host in DDR
  6182. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6183. * table allocated by host in DDR
  6184. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6185. * entry hashing
  6186. *
  6187. *
  6188. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6189. * |---------------------------------------------------------------|
  6190. * | reserved | pdev_id | MSG_TYPE |
  6191. * |---------------------------------------------------------------|
  6192. * |resvd|IPDSA| max_search | Number of records |
  6193. * |---------------------------------------------------------------|
  6194. * | base address lo |
  6195. * |---------------------------------------------------------------|
  6196. * | base address high |
  6197. * |---------------------------------------------------------------|
  6198. * | toeplitz key 31_0 |
  6199. * |---------------------------------------------------------------|
  6200. * | toeplitz key 63_32 |
  6201. * |---------------------------------------------------------------|
  6202. * | toeplitz key 95_64 |
  6203. * |---------------------------------------------------------------|
  6204. * | toeplitz key 127_96 |
  6205. * |---------------------------------------------------------------|
  6206. * | toeplitz key 159_128 |
  6207. * |---------------------------------------------------------------|
  6208. * | toeplitz key 191_160 |
  6209. * |---------------------------------------------------------------|
  6210. * | toeplitz key 223_192 |
  6211. * |---------------------------------------------------------------|
  6212. * | toeplitz key 255_224 |
  6213. * |---------------------------------------------------------------|
  6214. * | toeplitz key 287_256 |
  6215. * |---------------------------------------------------------------|
  6216. * | reserved | toeplitz key 314_288(26:0 bits) |
  6217. * |---------------------------------------------------------------|
  6218. * where:
  6219. * IPDSA = ip_da_sa
  6220. */
  6221. /**
  6222. * @brief: htt_ip_da_sa_prefix
  6223. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6224. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6225. * documentation per RFC3849
  6226. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6227. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6228. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6229. */
  6230. enum htt_ip_da_sa_prefix {
  6231. HTT_RX_IPV6_20010db8,
  6232. HTT_RX_IPV4_MAPPED_IPV6,
  6233. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6234. HTT_RX_IPV6_64FF9B,
  6235. };
  6236. /**
  6237. * @brief Host-->target HTT RX FISA configure and enable
  6238. *
  6239. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6240. *
  6241. * @details
  6242. * The host will send this command down to configure and enable the FISA
  6243. * operational params.
  6244. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6245. * register.
  6246. * Should configure both the MACs.
  6247. *
  6248. * dword0 - b'7:0 - msg_type:
  6249. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6250. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6251. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6252. * pdev's LMAC ring.
  6253. * b'31:16 - reserved : Reserved for future use
  6254. *
  6255. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6256. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6257. * packets. 1 flow search will be skipped
  6258. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6259. * tcp,udp packets
  6260. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6261. * calculation
  6262. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6263. * calculation
  6264. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6265. * calculation
  6266. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6267. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6268. * length
  6269. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6270. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6271. * length
  6272. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6273. * num jump
  6274. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6275. * num jump
  6276. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6277. * data type switch has happend for MPDU Sequence num jump
  6278. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6279. * for MPDU Sequence num jump
  6280. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6281. * for decrypt errors
  6282. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6283. * while aggregating a msdu
  6284. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6285. * The aggregation is done until (number of MSDUs aggregated
  6286. * < LIMIT + 1)
  6287. * b'31:18 - Reserved
  6288. *
  6289. * fisa_control_value - 32bit value FW can write to register
  6290. *
  6291. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6292. * Threshold value for FISA timeout (units are microseconds).
  6293. * When the global timestamp exceeds this threshold, FISA
  6294. * aggregation will be restarted.
  6295. * A value of 0 means timeout is disabled.
  6296. * Compare the threshold register with timestamp field in
  6297. * flow entry to generate timeout for the flow.
  6298. *
  6299. * |31 18 |17 16|15 8|7 0|
  6300. * |-------------------------------------------------------------|
  6301. * | reserved | pdev_mask | msg type |
  6302. * |-------------------------------------------------------------|
  6303. * | reserved | FISA_CTRL |
  6304. * |-------------------------------------------------------------|
  6305. * | FISA_TIMEOUT_THRESH |
  6306. * |-------------------------------------------------------------|
  6307. */
  6308. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6309. A_UINT32 msg_type:8,
  6310. pdev_id:8,
  6311. reserved0:16;
  6312. /**
  6313. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6314. * [17:0]
  6315. */
  6316. union {
  6317. /*
  6318. * fisa_control_bits structure is deprecated.
  6319. * Please use fisa_control_bits_v2 going forward.
  6320. */
  6321. struct {
  6322. A_UINT32 fisa_enable: 1,
  6323. ipsec_skip_search: 1,
  6324. nontcp_skip_search: 1,
  6325. add_ipv4_fixed_hdr_len: 1,
  6326. add_ipv6_fixed_hdr_len: 1,
  6327. add_tcp_fixed_hdr_len: 1,
  6328. add_udp_hdr_len: 1,
  6329. chksum_cum_ip_len_en: 1,
  6330. disable_tid_check: 1,
  6331. disable_ta_check: 1,
  6332. disable_qos_check: 1,
  6333. disable_raw_check: 1,
  6334. disable_decrypt_err_check: 1,
  6335. disable_msdu_drop_check: 1,
  6336. fisa_aggr_limit: 4,
  6337. reserved: 14;
  6338. } fisa_control_bits;
  6339. struct {
  6340. A_UINT32 fisa_enable: 1,
  6341. fisa_aggr_limit: 4,
  6342. reserved: 27;
  6343. } fisa_control_bits_v2;
  6344. A_UINT32 fisa_control_value;
  6345. } u_fisa_control;
  6346. /**
  6347. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6348. * timeout threshold for aggregation. Unit in usec.
  6349. * [31:0]
  6350. */
  6351. A_UINT32 fisa_timeout_threshold;
  6352. } POSTPACK;
  6353. /* DWord 0: pdev-ID */
  6354. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6355. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6356. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6357. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6358. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6359. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6360. do { \
  6361. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6362. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6363. } while (0)
  6364. /* Dword 1: fisa_control_value fisa config */
  6365. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6366. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6367. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6368. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6369. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6370. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6373. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6374. } while (0)
  6375. /* Dword 1: fisa_control_value ipsec_skip_search */
  6376. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6377. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6378. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6379. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6380. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6381. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6382. do { \
  6383. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6384. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6385. } while (0)
  6386. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6387. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6388. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6389. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6390. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6391. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6392. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6393. do { \
  6394. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6395. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6396. } while (0)
  6397. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6398. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6399. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6400. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6401. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6402. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6403. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6404. do { \
  6405. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6406. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6407. } while (0)
  6408. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6409. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6410. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6411. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6412. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6413. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6414. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6415. do { \
  6416. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6417. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6418. } while (0)
  6419. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6420. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6421. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6422. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6423. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6424. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6425. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6426. do { \
  6427. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6428. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6429. } while (0)
  6430. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6431. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6432. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6433. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6434. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6435. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6436. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6437. do { \
  6438. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6439. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6440. } while (0)
  6441. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6442. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6443. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6444. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6445. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6446. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6447. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6448. do { \
  6449. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6450. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6451. } while (0)
  6452. /* Dword 1: fisa_control_value disable_tid_check */
  6453. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6454. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6455. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6456. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6457. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6458. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6459. do { \
  6460. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6461. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6462. } while (0)
  6463. /* Dword 1: fisa_control_value disable_ta_check */
  6464. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6465. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6466. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6467. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6468. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6469. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6470. do { \
  6471. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6472. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6473. } while (0)
  6474. /* Dword 1: fisa_control_value disable_qos_check */
  6475. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6476. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6477. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6478. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6479. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6480. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6481. do { \
  6482. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6483. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6484. } while (0)
  6485. /* Dword 1: fisa_control_value disable_raw_check */
  6486. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6487. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6488. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6489. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6490. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6491. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6492. do { \
  6493. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6494. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6495. } while (0)
  6496. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6497. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6498. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6499. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6500. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6501. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6502. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6503. do { \
  6504. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6505. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6506. } while (0)
  6507. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6508. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6509. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6510. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6511. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6512. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6513. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6514. do { \
  6515. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6516. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6517. } while (0)
  6518. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6519. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6520. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6521. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6522. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6523. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6524. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6525. do { \
  6526. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6527. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6528. } while (0)
  6529. /* Dword 1: fisa_control_value fisa config */
  6530. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6531. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6532. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6533. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6534. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6535. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6536. do { \
  6537. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6538. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6539. } while (0)
  6540. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6541. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6542. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6543. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6544. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6545. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6546. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6547. do { \
  6548. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6549. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6550. } while (0)
  6551. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6552. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6553. pdev_id:8,
  6554. reserved0:16;
  6555. A_UINT32 num_records:20,
  6556. max_search:8,
  6557. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6558. reserved1:2;
  6559. A_UINT32 base_addr_lo;
  6560. A_UINT32 base_addr_hi;
  6561. A_UINT32 toeplitz31_0;
  6562. A_UINT32 toeplitz63_32;
  6563. A_UINT32 toeplitz95_64;
  6564. A_UINT32 toeplitz127_96;
  6565. A_UINT32 toeplitz159_128;
  6566. A_UINT32 toeplitz191_160;
  6567. A_UINT32 toeplitz223_192;
  6568. A_UINT32 toeplitz255_224;
  6569. A_UINT32 toeplitz287_256;
  6570. A_UINT32 toeplitz314_288:27,
  6571. reserved2:5;
  6572. } POSTPACK;
  6573. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6574. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6575. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6576. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6577. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6578. /* DWORD 0: Pdev ID */
  6579. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6580. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6581. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6582. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6583. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6584. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6585. do { \
  6586. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6587. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6588. } while (0)
  6589. /* DWORD 1:num of records */
  6590. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6591. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6592. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6593. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6594. HTT_RX_FSE_SETUP_NUM_REC_S)
  6595. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6596. do { \
  6597. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6598. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6599. } while (0)
  6600. /* DWORD 1:max_search */
  6601. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6602. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6603. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6604. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6605. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6606. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6607. do { \
  6608. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6609. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6610. } while (0)
  6611. /* DWORD 1:ip_da_sa prefix */
  6612. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6613. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6614. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6615. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6616. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6617. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6618. do { \
  6619. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6620. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6621. } while (0)
  6622. /* DWORD 2: Base Address LO */
  6623. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6624. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6625. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6626. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6627. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6628. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6629. do { \
  6630. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6631. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6632. } while (0)
  6633. /* DWORD 3: Base Address High */
  6634. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6635. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6636. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6637. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6638. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6639. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6640. do { \
  6641. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6642. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6643. } while (0)
  6644. /* DWORD 4-12: Hash Value */
  6645. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6646. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6647. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6648. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6649. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6650. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6651. do { \
  6652. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6653. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6654. } while (0)
  6655. /* DWORD 13: Hash Value 314:288 bits */
  6656. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6657. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6658. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6659. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6660. do { \
  6661. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6662. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6663. } while (0)
  6664. /**
  6665. * @brief Host-->target HTT RX FSE operation message
  6666. *
  6667. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6668. *
  6669. * @details
  6670. * The host will send this Flow Search Engine (FSE) operation message for
  6671. * every flow add/delete operation.
  6672. * The FSE operation includes FSE full cache invalidation or individual entry
  6673. * invalidation.
  6674. * This message can be sent per SOC or per PDEV which is differentiated
  6675. * by pdev id values.
  6676. *
  6677. * |31 16|15 8|7 1|0|
  6678. * |-------------------------------------------------------------|
  6679. * | reserved | pdev_id | MSG_TYPE |
  6680. * |-------------------------------------------------------------|
  6681. * | reserved | operation |I|
  6682. * |-------------------------------------------------------------|
  6683. * | ip_src_addr_31_0 |
  6684. * |-------------------------------------------------------------|
  6685. * | ip_src_addr_63_32 |
  6686. * |-------------------------------------------------------------|
  6687. * | ip_src_addr_95_64 |
  6688. * |-------------------------------------------------------------|
  6689. * | ip_src_addr_127_96 |
  6690. * |-------------------------------------------------------------|
  6691. * | ip_dst_addr_31_0 |
  6692. * |-------------------------------------------------------------|
  6693. * | ip_dst_addr_63_32 |
  6694. * |-------------------------------------------------------------|
  6695. * | ip_dst_addr_95_64 |
  6696. * |-------------------------------------------------------------|
  6697. * | ip_dst_addr_127_96 |
  6698. * |-------------------------------------------------------------|
  6699. * | l4_dst_port | l4_src_port |
  6700. * | (32-bit SPI incase of IPsec) |
  6701. * |-------------------------------------------------------------|
  6702. * | reserved | l4_proto |
  6703. * |-------------------------------------------------------------|
  6704. *
  6705. * where I is 1-bit ipsec_valid.
  6706. *
  6707. * The following field definitions describe the format of the RX FSE operation
  6708. * message sent from the host to target for every add/delete flow entry to flow
  6709. * table.
  6710. *
  6711. * Header fields:
  6712. * dword0 - b'7:0 - msg_type: This will be set to
  6713. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6714. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6715. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6716. * specified pdev's LMAC ring.
  6717. * b'31:16 - reserved : Reserved for future use
  6718. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6719. * (Internet Protocol Security).
  6720. * IPsec describes the framework for providing security at
  6721. * IP layer. IPsec is defined for both versions of IP:
  6722. * IPV4 and IPV6.
  6723. * Please refer to htt_rx_flow_proto enumeration below for
  6724. * more info.
  6725. * ipsec_valid = 1 for IPSEC packets
  6726. * ipsec_valid = 0 for IP Packets
  6727. * b'7:1 - operation: This indicates types of FSE operation.
  6728. * Refer to htt_rx_fse_operation enumeration:
  6729. * 0 - No Cache Invalidation required
  6730. * 1 - Cache invalidate only one entry given by IP
  6731. * src/dest address at DWORD[2:9]
  6732. * 2 - Complete FSE Cache Invalidation
  6733. * 3 - FSE Disable
  6734. * 4 - FSE Enable
  6735. * b'31:8 - reserved: Reserved for future use
  6736. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6737. * for per flow addition/deletion
  6738. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6739. * and the subsequent 3 A_UINT32 will be padding bytes.
  6740. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6741. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6742. * from 0 to 65535 but only 0 to 1023 are designated as
  6743. * well-known ports. Refer to [RFC1700] for more details.
  6744. * This field is valid only if
  6745. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6746. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6747. * range from 0 to 65535 but only 0 to 1023 are designated
  6748. * as well-known ports. Refer to [RFC1700] for more details.
  6749. * This field is valid only if
  6750. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6751. * - SPI (31:0): Security Parameters Index is an
  6752. * identification tag added to the header while using IPsec
  6753. * for tunneling the IP traffici.
  6754. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6755. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6756. * Assigned Internet Protocol Numbers.
  6757. * l4_proto numbers for standard protocol like UDP/TCP
  6758. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6759. * l4_proto = 17 for UDP etc.
  6760. * b'31:8 - reserved: Reserved for future use.
  6761. *
  6762. */
  6763. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6764. A_UINT32 msg_type:8,
  6765. pdev_id:8,
  6766. reserved0:16;
  6767. A_UINT32 ipsec_valid:1,
  6768. operation:7,
  6769. reserved1:24;
  6770. A_UINT32 ip_src_addr_31_0;
  6771. A_UINT32 ip_src_addr_63_32;
  6772. A_UINT32 ip_src_addr_95_64;
  6773. A_UINT32 ip_src_addr_127_96;
  6774. A_UINT32 ip_dest_addr_31_0;
  6775. A_UINT32 ip_dest_addr_63_32;
  6776. A_UINT32 ip_dest_addr_95_64;
  6777. A_UINT32 ip_dest_addr_127_96;
  6778. union {
  6779. A_UINT32 spi;
  6780. struct {
  6781. A_UINT32 l4_src_port:16,
  6782. l4_dest_port:16;
  6783. } ip;
  6784. } u;
  6785. A_UINT32 l4_proto:8,
  6786. reserved:24;
  6787. } POSTPACK;
  6788. /**
  6789. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6790. *
  6791. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6792. *
  6793. * @details
  6794. * The host will send this Full monitor mode register configuration message.
  6795. * This message can be sent per SOC or per PDEV which is differentiated
  6796. * by pdev id values.
  6797. *
  6798. * |31 16|15 11|10 8|7 3|2|1|0|
  6799. * |-------------------------------------------------------------|
  6800. * | reserved | pdev_id | MSG_TYPE |
  6801. * |-------------------------------------------------------------|
  6802. * | reserved |Release Ring |N|Z|E|
  6803. * |-------------------------------------------------------------|
  6804. *
  6805. * where E is 1-bit full monitor mode enable/disable.
  6806. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6807. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6808. *
  6809. * The following field definitions describe the format of the full monitor
  6810. * mode configuration message sent from the host to target for each pdev.
  6811. *
  6812. * Header fields:
  6813. * dword0 - b'7:0 - msg_type: This will be set to
  6814. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6815. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6816. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6817. * specified pdev's LMAC ring.
  6818. * b'31:16 - reserved : Reserved for future use.
  6819. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6820. * monitor mode rxdma register is to be enabled or disabled.
  6821. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6822. * additional descriptors at ppdu end for zero mpdus
  6823. * enabled or disabled.
  6824. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6825. * additional descriptors at ppdu end for non zero mpdus
  6826. * enabled or disabled.
  6827. * b'10:3 - release_ring: This indicates the destination ring
  6828. * selection for the descriptor at the end of PPDU
  6829. * 0 - REO ring select
  6830. * 1 - FW ring select
  6831. * 2 - SW ring select
  6832. * 3 - Release ring select
  6833. * Refer to htt_rx_full_mon_release_ring.
  6834. * b'31:11 - reserved for future use
  6835. */
  6836. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6837. A_UINT32 msg_type:8,
  6838. pdev_id:8,
  6839. reserved0:16;
  6840. A_UINT32 full_monitor_mode_enable:1,
  6841. addnl_descs_zero_mpdus_end:1,
  6842. addnl_descs_non_zero_mpdus_end:1,
  6843. release_ring:8,
  6844. reserved1:21;
  6845. } POSTPACK;
  6846. /**
  6847. * Enumeration for full monitor mode destination ring select
  6848. * 0 - REO destination ring select
  6849. * 1 - FW destination ring select
  6850. * 2 - SW destination ring select
  6851. * 3 - Release destination ring select
  6852. */
  6853. enum htt_rx_full_mon_release_ring {
  6854. HTT_RX_MON_RING_REO,
  6855. HTT_RX_MON_RING_FW,
  6856. HTT_RX_MON_RING_SW,
  6857. HTT_RX_MON_RING_RELEASE,
  6858. };
  6859. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6860. /* DWORD 0: Pdev ID */
  6861. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6862. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6863. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6864. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6865. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6866. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6867. do { \
  6868. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6869. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6870. } while (0)
  6871. /* DWORD 1:ENABLE */
  6872. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6873. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6874. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6875. do { \
  6876. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6877. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6878. } while (0)
  6879. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6880. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6881. /* DWORD 1:ZERO_MPDU */
  6882. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6883. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6884. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6885. do { \
  6886. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6887. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6888. } while (0)
  6889. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6890. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6891. /* DWORD 1:NON_ZERO_MPDU */
  6892. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6893. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6894. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6895. do { \
  6896. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6897. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6898. } while (0)
  6899. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6900. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6901. /* DWORD 1:RELEASE_RINGS */
  6902. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6903. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6904. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6905. do { \
  6906. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6907. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6908. } while (0)
  6909. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6910. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6911. /**
  6912. * Enumeration for IP Protocol or IPSEC Protocol
  6913. * IPsec describes the framework for providing security at IP layer.
  6914. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6915. */
  6916. enum htt_rx_flow_proto {
  6917. HTT_RX_FLOW_IP_PROTO,
  6918. HTT_RX_FLOW_IPSEC_PROTO,
  6919. };
  6920. /**
  6921. * Enumeration for FSE Cache Invalidation
  6922. * 0 - No Cache Invalidation required
  6923. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6924. * 2 - Complete FSE Cache Invalidation
  6925. * 3 - FSE Disable
  6926. * 4 - FSE Enable
  6927. */
  6928. enum htt_rx_fse_operation {
  6929. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6930. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6931. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6932. HTT_RX_FSE_DISABLE,
  6933. HTT_RX_FSE_ENABLE,
  6934. };
  6935. /* DWORD 0: Pdev ID */
  6936. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6937. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6938. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6939. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6940. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6941. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6942. do { \
  6943. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6944. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6945. } while (0)
  6946. /* DWORD 1:IP PROTO or IPSEC */
  6947. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6948. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6949. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6950. do { \
  6951. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6952. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6953. } while (0)
  6954. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6955. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6956. /* DWORD 1:FSE Operation */
  6957. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6958. #define HTT_RX_FSE_OPERATION_S 1
  6959. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6960. do { \
  6961. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6962. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6963. } while (0)
  6964. #define HTT_RX_FSE_OPERATION_GET(word) \
  6965. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6966. /* DWORD 2-9:IP Address */
  6967. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6968. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6969. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6970. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6971. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6972. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6973. do { \
  6974. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6975. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6976. } while (0)
  6977. /* DWORD 10:Source Port Number */
  6978. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6979. #define HTT_RX_FSE_SOURCEPORT_S 0
  6980. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6981. do { \
  6982. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6983. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6984. } while (0)
  6985. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6986. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6987. /* DWORD 11:Destination Port Number */
  6988. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6989. #define HTT_RX_FSE_DESTPORT_S 16
  6990. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6991. do { \
  6992. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6993. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6994. } while (0)
  6995. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6996. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6997. /* DWORD 10-11:SPI (In case of IPSEC) */
  6998. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6999. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7000. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7001. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7002. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7003. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7004. do { \
  7005. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7006. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7007. } while (0)
  7008. /* DWORD 12:L4 PROTO */
  7009. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7010. #define HTT_RX_FSE_L4_PROTO_S 0
  7011. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7012. do { \
  7013. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7014. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7015. } while (0)
  7016. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7017. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7018. /**
  7019. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7020. *
  7021. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7022. *
  7023. * |31 24|23 |15 8|7 2|1|0|
  7024. * |----------------+----------------+----------------+----------------|
  7025. * | reserved | pdev_id | msg_type |
  7026. * |---------------------------------+----------------+----------------|
  7027. * | reserved |E|F|
  7028. * |---------------------------------+----------------+----------------|
  7029. * Where E = Configure the target to provide the 3-tuple hash value in
  7030. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7031. * F = Configure the target to provide the 3-tuple hash value in
  7032. * flow_id_toeplitz field of rx_msdu_start tlv
  7033. *
  7034. * The following field definitions describe the format of the 3 tuple hash value
  7035. * message sent from the host to target as part of initialization sequence.
  7036. *
  7037. * Header fields:
  7038. * dword0 - b'7:0 - msg_type: This will be set to
  7039. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7040. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7041. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7042. * specified pdev's LMAC ring.
  7043. * b'31:16 - reserved : Reserved for future use
  7044. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7045. * b'1 - toeplitz_hash_2_or_4_field_enable
  7046. * b'31:2 - reserved : Reserved for future use
  7047. * ---------+------+----------------------------------------------------------
  7048. * bit1 | bit0 | Functionality
  7049. * ---------+------+----------------------------------------------------------
  7050. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7051. * | | in flow_id_toeplitz field
  7052. * ---------+------+----------------------------------------------------------
  7053. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7054. * | | in toeplitz_hash_2_or_4 field
  7055. * ---------+------+----------------------------------------------------------
  7056. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7057. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7058. * ---------+------+----------------------------------------------------------
  7059. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7060. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7061. * | | toeplitz_hash_2_or_4 field
  7062. *----------------------------------------------------------------------------
  7063. */
  7064. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7065. A_UINT32 msg_type :8,
  7066. pdev_id :8,
  7067. reserved0 :16;
  7068. A_UINT32 flow_id_toeplitz_field_enable :1,
  7069. toeplitz_hash_2_or_4_field_enable :1,
  7070. reserved1 :30;
  7071. } POSTPACK;
  7072. /* DWORD0 : pdev_id configuration Macros */
  7073. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7074. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7075. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7076. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7077. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7078. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7079. do { \
  7080. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7081. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7082. } while (0)
  7083. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7084. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7085. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7086. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7087. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7088. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7089. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7090. do { \
  7091. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7092. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7093. } while (0)
  7094. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7095. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7096. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7097. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7098. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7099. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7100. do { \
  7101. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7102. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7103. } while (0)
  7104. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7105. /**
  7106. * @brief host --> target Host PA Address Size
  7107. *
  7108. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7109. *
  7110. * @details
  7111. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7112. * provide the physical start address and size of each of the memory
  7113. * areas within host DDR that the target FW may need to access.
  7114. *
  7115. * For example, the host can use this message to allow the target FW
  7116. * to set up access to the host's pools of TQM link descriptors.
  7117. * The message would appear as follows:
  7118. *
  7119. * |31 24|23 16|15 8|7 0|
  7120. * |----------------+----------------+----------------+----------------|
  7121. * | reserved | num_entries | msg_type |
  7122. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7123. * | mem area 0 size |
  7124. * |----------------+----------------+----------------+----------------|
  7125. * | mem area 0 physical_address_lo |
  7126. * |----------------+----------------+----------------+----------------|
  7127. * | mem area 0 physical_address_hi |
  7128. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7129. * | mem area 1 size |
  7130. * |----------------+----------------+----------------+----------------|
  7131. * | mem area 1 physical_address_lo |
  7132. * |----------------+----------------+----------------+----------------|
  7133. * | mem area 1 physical_address_hi |
  7134. * |----------------+----------------+----------------+----------------|
  7135. * ...
  7136. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7137. * | mem area N size |
  7138. * |----------------+----------------+----------------+----------------|
  7139. * | mem area N physical_address_lo |
  7140. * |----------------+----------------+----------------+----------------|
  7141. * | mem area N physical_address_hi |
  7142. * |----------------+----------------+----------------+----------------|
  7143. *
  7144. * The message is interpreted as follows:
  7145. * dword0 - b'0:7 - msg_type: This will be set to
  7146. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7147. * b'8:15 - number_entries: Indicated the number of host memory
  7148. * areas specified within the remainder of the message
  7149. * b'16:31 - reserved.
  7150. * dword1 - b'0:31 - memory area 0 size in bytes
  7151. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7152. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7153. * and similar for memory area 1 through memory area N.
  7154. */
  7155. PREPACK struct htt_h2t_host_paddr_size {
  7156. A_UINT32 msg_type: 8,
  7157. num_entries: 8,
  7158. reserved: 16;
  7159. } POSTPACK;
  7160. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7161. A_UINT32 size;
  7162. A_UINT32 physical_address_lo;
  7163. A_UINT32 physical_address_hi;
  7164. } POSTPACK;
  7165. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7166. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7167. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7168. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7169. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7170. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7171. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7172. do { \
  7173. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7174. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7175. } while (0)
  7176. /**
  7177. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7178. *
  7179. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7180. *
  7181. * @details
  7182. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7183. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7184. *
  7185. * The message would appear as follows:
  7186. *
  7187. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7188. * |---------------------------------+---+---+----------+-+-----------|
  7189. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7190. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7191. *
  7192. *
  7193. * The message is interpreted as follows:
  7194. * dword0 - b'0:7 - msg_type: This will be set to
  7195. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7196. * b'8 - override bit to drive MSDUs to PPE ring
  7197. * b'9:13 - REO destination ring indication
  7198. * b'14 - Multi buffer msdu override enable bit
  7199. * b'15 - Intra BSS override
  7200. * b'16 - Decap raw override
  7201. * b'17 - Decap Native wifi override
  7202. * b'18 - IP frag override
  7203. * b'19:31 - reserved
  7204. */
  7205. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7206. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7207. override: 1,
  7208. reo_destination_indication: 5,
  7209. multi_buffer_msdu_override_en: 1,
  7210. intra_bss_override: 1,
  7211. decap_raw_override: 1,
  7212. decap_nwifi_override: 1,
  7213. ip_frag_override: 1,
  7214. reserved: 13;
  7215. } POSTPACK;
  7216. /* DWORD 0: Override */
  7217. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7218. #define HTT_PPE_CFG_OVERRIDE_S 8
  7219. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7220. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7221. HTT_PPE_CFG_OVERRIDE_S)
  7222. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7223. do { \
  7224. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7225. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7226. } while (0)
  7227. /* DWORD 0: REO Destination Indication*/
  7228. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7229. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7230. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7231. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7232. HTT_PPE_CFG_REO_DEST_IND_S)
  7233. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7234. do { \
  7235. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7236. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7237. } while (0)
  7238. /* DWORD 0: Multi buffer MSDU override */
  7239. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7240. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7241. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7242. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7243. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7244. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7245. do { \
  7246. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7247. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7248. } while (0)
  7249. /* DWORD 0: Intra BSS override */
  7250. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7251. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7252. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7253. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7254. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7255. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7256. do { \
  7257. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7258. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7259. } while (0)
  7260. /* DWORD 0: Decap RAW override */
  7261. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7262. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7263. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7264. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7265. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7266. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7267. do { \
  7268. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7269. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7270. } while (0)
  7271. /* DWORD 0: Decap NWIFI override */
  7272. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7273. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7274. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7275. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7276. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7277. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7278. do { \
  7279. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7280. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7281. } while (0)
  7282. /* DWORD 0: IP frag override */
  7283. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7284. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7285. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7286. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7287. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7288. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7289. do { \
  7290. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7291. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7292. } while (0)
  7293. /*
  7294. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7295. *
  7296. * @details
  7297. * The following field definitions describe the format of the HTT host
  7298. * to target FW VDEV TX RX stats retrieve message.
  7299. * The message specifies the type of stats the host wants to retrieve.
  7300. *
  7301. * |31 27|26 25|24 17|16|15 8|7 0|
  7302. * |-----------------------------------------------------------|
  7303. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7304. * |-----------------------------------------------------------|
  7305. * | vdev_id lower bitmask |
  7306. * |-----------------------------------------------------------|
  7307. * | vdev_id upper bitmask |
  7308. * |-----------------------------------------------------------|
  7309. * Header fields:
  7310. * Where:
  7311. * dword0 - b'7:0 - msg_type: This will be set to
  7312. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7313. * b'15:8 - pdev id
  7314. * b'16(E) - Enable/Disable the vdev HW stats
  7315. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7316. * b'25:26(R) - Reset stats bits
  7317. * 0: don't reset stats
  7318. * 1: reset stats once
  7319. * 2: reset stats at the start of each periodic interval
  7320. * b'27:31 - reserved for future use
  7321. * dword1 - b'0:31 - vdev_id lower bitmask
  7322. * dword2 - b'0:31 - vdev_id upper bitmask
  7323. */
  7324. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7325. A_UINT32 msg_type :8,
  7326. pdev_id :8,
  7327. enable :1,
  7328. periodic_interval :8,
  7329. reset_stats_bits :2,
  7330. reserved0 :5;
  7331. A_UINT32 vdev_id_lower_bitmask;
  7332. A_UINT32 vdev_id_upper_bitmask;
  7333. } POSTPACK;
  7334. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7335. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7336. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7337. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7338. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7339. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7340. do { \
  7341. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7342. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7343. } while (0)
  7344. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7345. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7346. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7347. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7348. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7349. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7350. do { \
  7351. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7352. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7353. } while (0)
  7354. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7355. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7356. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7357. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7358. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7359. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7360. do { \
  7361. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7362. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7363. } while (0)
  7364. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7365. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7366. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7367. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7368. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7369. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7370. do { \
  7371. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7372. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7373. } while (0)
  7374. /*=== target -> host messages ===============================================*/
  7375. enum htt_t2h_msg_type {
  7376. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7377. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7378. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7379. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7380. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7381. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7382. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7383. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7384. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7385. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7386. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7387. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7388. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7389. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7390. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7391. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7392. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7393. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7394. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7395. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7396. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7397. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7398. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7399. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7400. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7401. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7402. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7403. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7404. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7405. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7406. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7407. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7408. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7409. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7410. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7411. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7412. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7413. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7414. /* TX_OFFLOAD_DELIVER_IND:
  7415. * Forward the target's locally-generated packets to the host,
  7416. * to provide to the monitor mode interface.
  7417. */
  7418. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7419. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7420. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7421. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7422. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7423. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7424. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7425. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7426. HTT_T2H_MSG_TYPE_TEST,
  7427. /* keep this last */
  7428. HTT_T2H_NUM_MSGS
  7429. };
  7430. /*
  7431. * HTT target to host message type -
  7432. * stored in bits 7:0 of the first word of the message
  7433. */
  7434. #define HTT_T2H_MSG_TYPE_M 0xff
  7435. #define HTT_T2H_MSG_TYPE_S 0
  7436. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7437. do { \
  7438. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7439. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7440. } while (0)
  7441. #define HTT_T2H_MSG_TYPE_GET(word) \
  7442. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7443. /**
  7444. * @brief target -> host version number confirmation message definition
  7445. *
  7446. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7447. *
  7448. * |31 24|23 16|15 8|7 0|
  7449. * |----------------+----------------+----------------+----------------|
  7450. * | reserved | major number | minor number | msg type |
  7451. * |-------------------------------------------------------------------|
  7452. * : option request TLV (optional) |
  7453. * :...................................................................:
  7454. *
  7455. * The VER_CONF message may consist of a single 4-byte word, or may be
  7456. * extended with TLVs that specify HTT options selected by the target.
  7457. * The following option TLVs may be appended to the VER_CONF message:
  7458. * - LL_BUS_ADDR_SIZE
  7459. * - HL_SUPPRESS_TX_COMPL_IND
  7460. * - MAX_TX_QUEUE_GROUPS
  7461. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7462. * may be appended to the VER_CONF message (but only one TLV of each type).
  7463. *
  7464. * Header fields:
  7465. * - MSG_TYPE
  7466. * Bits 7:0
  7467. * Purpose: identifies this as a version number confirmation message
  7468. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7469. * - VER_MINOR
  7470. * Bits 15:8
  7471. * Purpose: Specify the minor number of the HTT message library version
  7472. * in use by the target firmware.
  7473. * The minor number specifies the specific revision within a range
  7474. * of fundamentally compatible HTT message definition revisions.
  7475. * Compatible revisions involve adding new messages or perhaps
  7476. * adding new fields to existing messages, in a backwards-compatible
  7477. * manner.
  7478. * Incompatible revisions involve changing the message type values,
  7479. * or redefining existing messages.
  7480. * Value: minor number
  7481. * - VER_MAJOR
  7482. * Bits 15:8
  7483. * Purpose: Specify the major number of the HTT message library version
  7484. * in use by the target firmware.
  7485. * The major number specifies the family of minor revisions that are
  7486. * fundamentally compatible with each other, but not with prior or
  7487. * later families.
  7488. * Value: major number
  7489. */
  7490. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7491. #define HTT_VER_CONF_MINOR_S 8
  7492. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7493. #define HTT_VER_CONF_MAJOR_S 16
  7494. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7495. do { \
  7496. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7497. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7498. } while (0)
  7499. #define HTT_VER_CONF_MINOR_GET(word) \
  7500. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7501. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7502. do { \
  7503. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7504. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7505. } while (0)
  7506. #define HTT_VER_CONF_MAJOR_GET(word) \
  7507. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7508. #define HTT_VER_CONF_BYTES 4
  7509. /**
  7510. * @brief - target -> host HTT Rx In order indication message
  7511. *
  7512. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7513. *
  7514. * @details
  7515. *
  7516. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7517. * |----------------+-------------------+---------------------+---------------|
  7518. * | peer ID | P| F| O| ext TID | msg type |
  7519. * |--------------------------------------------------------------------------|
  7520. * | MSDU count | Reserved | vdev id |
  7521. * |--------------------------------------------------------------------------|
  7522. * | MSDU 0 bus address (bits 31:0) |
  7523. #if HTT_PADDR64
  7524. * | MSDU 0 bus address (bits 63:32) |
  7525. #endif
  7526. * |--------------------------------------------------------------------------|
  7527. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7528. * |--------------------------------------------------------------------------|
  7529. * | MSDU 1 bus address (bits 31:0) |
  7530. #if HTT_PADDR64
  7531. * | MSDU 1 bus address (bits 63:32) |
  7532. #endif
  7533. * |--------------------------------------------------------------------------|
  7534. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7535. * |--------------------------------------------------------------------------|
  7536. */
  7537. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7538. *
  7539. * @details
  7540. * bits
  7541. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7542. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7543. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7544. * | | frag | | | | fail |chksum fail|
  7545. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7546. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7547. */
  7548. struct htt_rx_in_ord_paddr_ind_hdr_t
  7549. {
  7550. A_UINT32 /* word 0 */
  7551. msg_type: 8,
  7552. ext_tid: 5,
  7553. offload: 1,
  7554. frag: 1,
  7555. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7556. peer_id: 16;
  7557. A_UINT32 /* word 1 */
  7558. vap_id: 8,
  7559. /* NOTE:
  7560. * This reserved_1 field is not truly reserved - certain targets use
  7561. * this field internally to store debug information, and do not zero
  7562. * out the contents of the field before uploading the message to the
  7563. * host. Thus, any host-target communication supported by this field
  7564. * is limited to using values that are never used by the debug
  7565. * information stored by certain targets in the reserved_1 field.
  7566. * In particular, the targets in question don't use the value 0x3
  7567. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7568. * so this previously-unused value within these bits is available to
  7569. * use as the host / target PKT_CAPTURE_MODE flag.
  7570. */
  7571. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7572. /* if pkt_capture_mode == 0x3, host should
  7573. * send rx frames to monitor mode interface
  7574. */
  7575. msdu_cnt: 16;
  7576. };
  7577. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7578. {
  7579. A_UINT32 dma_addr;
  7580. A_UINT32
  7581. length: 16,
  7582. fw_desc: 8,
  7583. msdu_info:8;
  7584. };
  7585. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7586. {
  7587. A_UINT32 dma_addr_lo;
  7588. A_UINT32 dma_addr_hi;
  7589. A_UINT32
  7590. length: 16,
  7591. fw_desc: 8,
  7592. msdu_info:8;
  7593. };
  7594. #if HTT_PADDR64
  7595. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7596. #else
  7597. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7598. #endif
  7599. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7600. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7601. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7602. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7603. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7604. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7605. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7606. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7607. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7608. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7609. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7610. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7611. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7612. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7613. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7614. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7615. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7616. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7617. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7618. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7619. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7620. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7621. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7622. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7623. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7624. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7625. /* for systems using 64-bit format for bus addresses */
  7626. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7627. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7628. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7629. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7630. /* for systems using 32-bit format for bus addresses */
  7631. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7632. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7633. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7634. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7635. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7636. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7637. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7638. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7639. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7640. do { \
  7641. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7642. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7643. } while (0)
  7644. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7645. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7646. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7647. do { \
  7648. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7649. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7650. } while (0)
  7651. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7652. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7653. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7654. do { \
  7655. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7656. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7657. } while (0)
  7658. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7659. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7660. /*
  7661. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7662. * deliver the rx frames to the monitor mode interface.
  7663. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7664. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7665. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7666. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7667. */
  7668. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7669. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7670. do { \
  7671. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7672. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7673. } while (0)
  7674. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7675. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7676. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7677. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7680. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7681. } while (0)
  7682. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7683. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7684. /* for systems using 64-bit format for bus addresses */
  7685. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7686. do { \
  7687. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7688. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7689. } while (0)
  7690. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7691. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7692. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7693. do { \
  7694. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7695. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7696. } while (0)
  7697. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7698. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7699. /* for systems using 32-bit format for bus addresses */
  7700. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7701. do { \
  7702. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7703. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7704. } while (0)
  7705. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7706. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7707. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7708. do { \
  7709. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7710. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7711. } while (0)
  7712. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7713. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7714. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7715. do { \
  7716. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7717. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7718. } while (0)
  7719. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7720. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7721. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7722. do { \
  7723. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7724. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7725. } while (0)
  7726. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7727. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7728. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7729. do { \
  7730. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7731. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7732. } while (0)
  7733. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7734. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7735. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7736. do { \
  7737. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7738. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7739. } while (0)
  7740. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7741. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7742. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7743. do { \
  7744. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7745. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7746. } while (0)
  7747. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7748. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7749. /* definitions used within target -> host rx indication message */
  7750. PREPACK struct htt_rx_ind_hdr_prefix_t
  7751. {
  7752. A_UINT32 /* word 0 */
  7753. msg_type: 8,
  7754. ext_tid: 5,
  7755. release_valid: 1,
  7756. flush_valid: 1,
  7757. reserved0: 1,
  7758. peer_id: 16;
  7759. A_UINT32 /* word 1 */
  7760. flush_start_seq_num: 6,
  7761. flush_end_seq_num: 6,
  7762. release_start_seq_num: 6,
  7763. release_end_seq_num: 6,
  7764. num_mpdu_ranges: 8;
  7765. } POSTPACK;
  7766. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7767. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7768. #define HTT_TGT_RSSI_INVALID 0x80
  7769. PREPACK struct htt_rx_ppdu_desc_t
  7770. {
  7771. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7772. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7773. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7774. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7775. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7776. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7777. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7778. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7779. A_UINT32 /* word 0 */
  7780. rssi_cmb: 8,
  7781. timestamp_submicrosec: 8,
  7782. phy_err_code: 8,
  7783. phy_err: 1,
  7784. legacy_rate: 4,
  7785. legacy_rate_sel: 1,
  7786. end_valid: 1,
  7787. start_valid: 1;
  7788. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7789. union {
  7790. A_UINT32 /* word 1 */
  7791. rssi0_pri20: 8,
  7792. rssi0_ext20: 8,
  7793. rssi0_ext40: 8,
  7794. rssi0_ext80: 8;
  7795. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7796. } u0;
  7797. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7798. union {
  7799. A_UINT32 /* word 2 */
  7800. rssi1_pri20: 8,
  7801. rssi1_ext20: 8,
  7802. rssi1_ext40: 8,
  7803. rssi1_ext80: 8;
  7804. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7805. } u1;
  7806. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7807. union {
  7808. A_UINT32 /* word 3 */
  7809. rssi2_pri20: 8,
  7810. rssi2_ext20: 8,
  7811. rssi2_ext40: 8,
  7812. rssi2_ext80: 8;
  7813. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7814. } u2;
  7815. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7816. union {
  7817. A_UINT32 /* word 4 */
  7818. rssi3_pri20: 8,
  7819. rssi3_ext20: 8,
  7820. rssi3_ext40: 8,
  7821. rssi3_ext80: 8;
  7822. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7823. } u3;
  7824. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7825. A_UINT32 tsf32; /* word 5 */
  7826. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7827. A_UINT32 timestamp_microsec; /* word 6 */
  7828. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7829. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7830. A_UINT32 /* word 7 */
  7831. vht_sig_a1: 24,
  7832. preamble_type: 8;
  7833. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7834. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7835. A_UINT32 /* word 8 */
  7836. vht_sig_a2: 24,
  7837. /* sa_ant_matrix
  7838. * For cases where a single rx chain has options to be connected to
  7839. * different rx antennas, show which rx antennas were in use during
  7840. * receipt of a given PPDU.
  7841. * This sa_ant_matrix provides a bitmask of the antennas used while
  7842. * receiving this frame.
  7843. */
  7844. sa_ant_matrix: 8;
  7845. } POSTPACK;
  7846. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7847. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7848. PREPACK struct htt_rx_ind_hdr_suffix_t
  7849. {
  7850. A_UINT32 /* word 0 */
  7851. fw_rx_desc_bytes: 16,
  7852. reserved0: 16;
  7853. } POSTPACK;
  7854. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7855. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7856. PREPACK struct htt_rx_ind_hdr_t
  7857. {
  7858. struct htt_rx_ind_hdr_prefix_t prefix;
  7859. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7860. struct htt_rx_ind_hdr_suffix_t suffix;
  7861. } POSTPACK;
  7862. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7863. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7864. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7865. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7866. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7867. /*
  7868. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7869. * the offset into the HTT rx indication message at which the
  7870. * FW rx PPDU descriptor resides
  7871. */
  7872. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7873. /*
  7874. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7875. * the offset into the HTT rx indication message at which the
  7876. * header suffix (FW rx MSDU byte count) resides
  7877. */
  7878. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7879. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7880. /*
  7881. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7882. * the offset into the HTT rx indication message at which the per-MSDU
  7883. * information starts
  7884. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7885. * per-MSDU information portion of the message. The per-MSDU info itself
  7886. * starts at byte 12.
  7887. */
  7888. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7889. /**
  7890. * @brief target -> host rx indication message definition
  7891. *
  7892. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7893. *
  7894. * @details
  7895. * The following field definitions describe the format of the rx indication
  7896. * message sent from the target to the host.
  7897. * The message consists of three major sections:
  7898. * 1. a fixed-length header
  7899. * 2. a variable-length list of firmware rx MSDU descriptors
  7900. * 3. one or more 4-octet MPDU range information elements
  7901. * The fixed length header itself has two sub-sections
  7902. * 1. the message meta-information, including identification of the
  7903. * sender and type of the received data, and a 4-octet flush/release IE
  7904. * 2. the firmware rx PPDU descriptor
  7905. *
  7906. * The format of the message is depicted below.
  7907. * in this depiction, the following abbreviations are used for information
  7908. * elements within the message:
  7909. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7910. * elements associated with the PPDU start are valid.
  7911. * Specifically, the following fields are valid only if SV is set:
  7912. * RSSI (all variants), L, legacy rate, preamble type, service,
  7913. * VHT-SIG-A
  7914. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7915. * elements associated with the PPDU end are valid.
  7916. * Specifically, the following fields are valid only if EV is set:
  7917. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7918. * - L - Legacy rate selector - if legacy rates are used, this flag
  7919. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7920. * (L == 0) PHY.
  7921. * - P - PHY error flag - boolean indication of whether the rx frame had
  7922. * a PHY error
  7923. *
  7924. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7925. * |----------------+-------------------+---------------------+---------------|
  7926. * | peer ID | |RV|FV| ext TID | msg type |
  7927. * |--------------------------------------------------------------------------|
  7928. * | num | release | release | flush | flush |
  7929. * | MPDU | end | start | end | start |
  7930. * | ranges | seq num | seq num | seq num | seq num |
  7931. * |==========================================================================|
  7932. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7933. * |V|V| | rate | | | timestamp | RSSI |
  7934. * |--------------------------------------------------------------------------|
  7935. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7936. * |--------------------------------------------------------------------------|
  7937. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7938. * |--------------------------------------------------------------------------|
  7939. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7940. * |--------------------------------------------------------------------------|
  7941. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7942. * |--------------------------------------------------------------------------|
  7943. * | TSF LSBs |
  7944. * |--------------------------------------------------------------------------|
  7945. * | microsec timestamp |
  7946. * |--------------------------------------------------------------------------|
  7947. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7948. * |--------------------------------------------------------------------------|
  7949. * | service | HT-SIG / VHT-SIG-A2 |
  7950. * |==========================================================================|
  7951. * | reserved | FW rx desc bytes |
  7952. * |--------------------------------------------------------------------------|
  7953. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7954. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7955. * |--------------------------------------------------------------------------|
  7956. * : : :
  7957. * |--------------------------------------------------------------------------|
  7958. * | alignment | MSDU Rx |
  7959. * | padding | desc Bn |
  7960. * |--------------------------------------------------------------------------|
  7961. * | reserved | MPDU range status | MPDU count |
  7962. * |--------------------------------------------------------------------------|
  7963. * : reserved : MPDU range status : MPDU count :
  7964. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7965. *
  7966. * Header fields:
  7967. * - MSG_TYPE
  7968. * Bits 7:0
  7969. * Purpose: identifies this as an rx indication message
  7970. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7971. * - EXT_TID
  7972. * Bits 12:8
  7973. * Purpose: identify the traffic ID of the rx data, including
  7974. * special "extended" TID values for multicast, broadcast, and
  7975. * non-QoS data frames
  7976. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7977. * - FLUSH_VALID (FV)
  7978. * Bit 13
  7979. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7980. * is valid
  7981. * Value:
  7982. * 1 -> flush IE is valid and needs to be processed
  7983. * 0 -> flush IE is not valid and should be ignored
  7984. * - REL_VALID (RV)
  7985. * Bit 13
  7986. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7987. * is valid
  7988. * Value:
  7989. * 1 -> release IE is valid and needs to be processed
  7990. * 0 -> release IE is not valid and should be ignored
  7991. * - PEER_ID
  7992. * Bits 31:16
  7993. * Purpose: Identify, by ID, which peer sent the rx data
  7994. * Value: ID of the peer who sent the rx data
  7995. * - FLUSH_SEQ_NUM_START
  7996. * Bits 5:0
  7997. * Purpose: Indicate the start of a series of MPDUs to flush
  7998. * Not all MPDUs within this series are necessarily valid - the host
  7999. * must check each sequence number within this range to see if the
  8000. * corresponding MPDU is actually present.
  8001. * This field is only valid if the FV bit is set.
  8002. * Value:
  8003. * The sequence number for the first MPDUs to check to flush.
  8004. * The sequence number is masked by 0x3f.
  8005. * - FLUSH_SEQ_NUM_END
  8006. * Bits 11:6
  8007. * Purpose: Indicate the end of a series of MPDUs to flush
  8008. * Value:
  8009. * The sequence number one larger than the sequence number of the
  8010. * last MPDU to check to flush.
  8011. * The sequence number is masked by 0x3f.
  8012. * Not all MPDUs within this series are necessarily valid - the host
  8013. * must check each sequence number within this range to see if the
  8014. * corresponding MPDU is actually present.
  8015. * This field is only valid if the FV bit is set.
  8016. * - REL_SEQ_NUM_START
  8017. * Bits 17:12
  8018. * Purpose: Indicate the start of a series of MPDUs to release.
  8019. * All MPDUs within this series are present and valid - the host
  8020. * need not check each sequence number within this range to see if
  8021. * the corresponding MPDU is actually present.
  8022. * This field is only valid if the RV bit is set.
  8023. * Value:
  8024. * The sequence number for the first MPDUs to check to release.
  8025. * The sequence number is masked by 0x3f.
  8026. * - REL_SEQ_NUM_END
  8027. * Bits 23:18
  8028. * Purpose: Indicate the end of a series of MPDUs to release.
  8029. * Value:
  8030. * The sequence number one larger than the sequence number of the
  8031. * last MPDU to check to release.
  8032. * The sequence number is masked by 0x3f.
  8033. * All MPDUs within this series are present and valid - the host
  8034. * need not check each sequence number within this range to see if
  8035. * the corresponding MPDU is actually present.
  8036. * This field is only valid if the RV bit is set.
  8037. * - NUM_MPDU_RANGES
  8038. * Bits 31:24
  8039. * Purpose: Indicate how many ranges of MPDUs are present.
  8040. * Each MPDU range consists of a series of contiguous MPDUs within the
  8041. * rx frame sequence which all have the same MPDU status.
  8042. * Value: 1-63 (typically a small number, like 1-3)
  8043. *
  8044. * Rx PPDU descriptor fields:
  8045. * - RSSI_CMB
  8046. * Bits 7:0
  8047. * Purpose: Combined RSSI from all active rx chains, across the active
  8048. * bandwidth.
  8049. * Value: RSSI dB units w.r.t. noise floor
  8050. * - TIMESTAMP_SUBMICROSEC
  8051. * Bits 15:8
  8052. * Purpose: high-resolution timestamp
  8053. * Value:
  8054. * Sub-microsecond time of PPDU reception.
  8055. * This timestamp ranges from [0,MAC clock MHz).
  8056. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8057. * to form a high-resolution, large range rx timestamp.
  8058. * - PHY_ERR_CODE
  8059. * Bits 23:16
  8060. * Purpose:
  8061. * If the rx frame processing resulted in a PHY error, indicate what
  8062. * type of rx PHY error occurred.
  8063. * Value:
  8064. * This field is valid if the "P" (PHY_ERR) flag is set.
  8065. * TBD: document/specify the values for this field
  8066. * - PHY_ERR
  8067. * Bit 24
  8068. * Purpose: indicate whether the rx PPDU had a PHY error
  8069. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8070. * - LEGACY_RATE
  8071. * Bits 28:25
  8072. * Purpose:
  8073. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8074. * specify which rate was used.
  8075. * Value:
  8076. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8077. * flag.
  8078. * If LEGACY_RATE_SEL is 0:
  8079. * 0x8: OFDM 48 Mbps
  8080. * 0x9: OFDM 24 Mbps
  8081. * 0xA: OFDM 12 Mbps
  8082. * 0xB: OFDM 6 Mbps
  8083. * 0xC: OFDM 54 Mbps
  8084. * 0xD: OFDM 36 Mbps
  8085. * 0xE: OFDM 18 Mbps
  8086. * 0xF: OFDM 9 Mbps
  8087. * If LEGACY_RATE_SEL is 1:
  8088. * 0x8: CCK 11 Mbps long preamble
  8089. * 0x9: CCK 5.5 Mbps long preamble
  8090. * 0xA: CCK 2 Mbps long preamble
  8091. * 0xB: CCK 1 Mbps long preamble
  8092. * 0xC: CCK 11 Mbps short preamble
  8093. * 0xD: CCK 5.5 Mbps short preamble
  8094. * 0xE: CCK 2 Mbps short preamble
  8095. * - LEGACY_RATE_SEL
  8096. * Bit 29
  8097. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8098. * Value:
  8099. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8100. * used a legacy rate.
  8101. * 0 -> OFDM, 1 -> CCK
  8102. * - END_VALID
  8103. * Bit 30
  8104. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8105. * the start of the PPDU are valid. Specifically, the following
  8106. * fields are only valid if END_VALID is set:
  8107. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8108. * TIMESTAMP_SUBMICROSEC
  8109. * Value:
  8110. * 0 -> rx PPDU desc end fields are not valid
  8111. * 1 -> rx PPDU desc end fields are valid
  8112. * - START_VALID
  8113. * Bit 31
  8114. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8115. * the end of the PPDU are valid. Specifically, the following
  8116. * fields are only valid if START_VALID is set:
  8117. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8118. * VHT-SIG-A
  8119. * Value:
  8120. * 0 -> rx PPDU desc start fields are not valid
  8121. * 1 -> rx PPDU desc start fields are valid
  8122. * - RSSI0_PRI20
  8123. * Bits 7:0
  8124. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8125. * Value: RSSI dB units w.r.t. noise floor
  8126. *
  8127. * - RSSI0_EXT20
  8128. * Bits 7:0
  8129. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8130. * (if the rx bandwidth was >= 40 MHz)
  8131. * Value: RSSI dB units w.r.t. noise floor
  8132. * - RSSI0_EXT40
  8133. * Bits 7:0
  8134. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8135. * (if the rx bandwidth was >= 80 MHz)
  8136. * Value: RSSI dB units w.r.t. noise floor
  8137. * - RSSI0_EXT80
  8138. * Bits 7:0
  8139. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8140. * (if the rx bandwidth was >= 160 MHz)
  8141. * Value: RSSI dB units w.r.t. noise floor
  8142. *
  8143. * - RSSI1_PRI20
  8144. * Bits 7:0
  8145. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8146. * Value: RSSI dB units w.r.t. noise floor
  8147. * - RSSI1_EXT20
  8148. * Bits 7:0
  8149. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8150. * (if the rx bandwidth was >= 40 MHz)
  8151. * Value: RSSI dB units w.r.t. noise floor
  8152. * - RSSI1_EXT40
  8153. * Bits 7:0
  8154. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8155. * (if the rx bandwidth was >= 80 MHz)
  8156. * Value: RSSI dB units w.r.t. noise floor
  8157. * - RSSI1_EXT80
  8158. * Bits 7:0
  8159. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8160. * (if the rx bandwidth was >= 160 MHz)
  8161. * Value: RSSI dB units w.r.t. noise floor
  8162. *
  8163. * - RSSI2_PRI20
  8164. * Bits 7:0
  8165. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8166. * Value: RSSI dB units w.r.t. noise floor
  8167. * - RSSI2_EXT20
  8168. * Bits 7:0
  8169. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8170. * (if the rx bandwidth was >= 40 MHz)
  8171. * Value: RSSI dB units w.r.t. noise floor
  8172. * - RSSI2_EXT40
  8173. * Bits 7:0
  8174. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8175. * (if the rx bandwidth was >= 80 MHz)
  8176. * Value: RSSI dB units w.r.t. noise floor
  8177. * - RSSI2_EXT80
  8178. * Bits 7:0
  8179. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8180. * (if the rx bandwidth was >= 160 MHz)
  8181. * Value: RSSI dB units w.r.t. noise floor
  8182. *
  8183. * - RSSI3_PRI20
  8184. * Bits 7:0
  8185. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8186. * Value: RSSI dB units w.r.t. noise floor
  8187. * - RSSI3_EXT20
  8188. * Bits 7:0
  8189. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8190. * (if the rx bandwidth was >= 40 MHz)
  8191. * Value: RSSI dB units w.r.t. noise floor
  8192. * - RSSI3_EXT40
  8193. * Bits 7:0
  8194. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8195. * (if the rx bandwidth was >= 80 MHz)
  8196. * Value: RSSI dB units w.r.t. noise floor
  8197. * - RSSI3_EXT80
  8198. * Bits 7:0
  8199. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8200. * (if the rx bandwidth was >= 160 MHz)
  8201. * Value: RSSI dB units w.r.t. noise floor
  8202. *
  8203. * - TSF32
  8204. * Bits 31:0
  8205. * Purpose: specify the time the rx PPDU was received, in TSF units
  8206. * Value: 32 LSBs of the TSF
  8207. * - TIMESTAMP_MICROSEC
  8208. * Bits 31:0
  8209. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8210. * Value: PPDU rx time, in microseconds
  8211. * - VHT_SIG_A1
  8212. * Bits 23:0
  8213. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8214. * from the rx PPDU
  8215. * Value:
  8216. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8217. * VHT-SIG-A1 data.
  8218. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8219. * first 24 bits of the HT-SIG data.
  8220. * Otherwise, this field is invalid.
  8221. * Refer to the the 802.11 protocol for the definition of the
  8222. * HT-SIG and VHT-SIG-A1 fields
  8223. * - VHT_SIG_A2
  8224. * Bits 23:0
  8225. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8226. * from the rx PPDU
  8227. * Value:
  8228. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8229. * VHT-SIG-A2 data.
  8230. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8231. * last 24 bits of the HT-SIG data.
  8232. * Otherwise, this field is invalid.
  8233. * Refer to the the 802.11 protocol for the definition of the
  8234. * HT-SIG and VHT-SIG-A2 fields
  8235. * - PREAMBLE_TYPE
  8236. * Bits 31:24
  8237. * Purpose: indicate the PHY format of the received burst
  8238. * Value:
  8239. * 0x4: Legacy (OFDM/CCK)
  8240. * 0x8: HT
  8241. * 0x9: HT with TxBF
  8242. * 0xC: VHT
  8243. * 0xD: VHT with TxBF
  8244. * - SERVICE
  8245. * Bits 31:24
  8246. * Purpose: TBD
  8247. * Value: TBD
  8248. *
  8249. * Rx MSDU descriptor fields:
  8250. * - FW_RX_DESC_BYTES
  8251. * Bits 15:0
  8252. * Purpose: Indicate how many bytes in the Rx indication are used for
  8253. * FW Rx descriptors
  8254. *
  8255. * Payload fields:
  8256. * - MPDU_COUNT
  8257. * Bits 7:0
  8258. * Purpose: Indicate how many sequential MPDUs share the same status.
  8259. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8260. * - MPDU_STATUS
  8261. * Bits 15:8
  8262. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8263. * received successfully.
  8264. * Value:
  8265. * 0x1: success
  8266. * 0x2: FCS error
  8267. * 0x3: duplicate error
  8268. * 0x4: replay error
  8269. * 0x5: invalid peer
  8270. */
  8271. /* header fields */
  8272. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8273. #define HTT_RX_IND_EXT_TID_S 8
  8274. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8275. #define HTT_RX_IND_FLUSH_VALID_S 13
  8276. #define HTT_RX_IND_REL_VALID_M 0x4000
  8277. #define HTT_RX_IND_REL_VALID_S 14
  8278. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8279. #define HTT_RX_IND_PEER_ID_S 16
  8280. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8281. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8282. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8283. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8284. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8285. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8286. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8287. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8288. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8289. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8290. /* rx PPDU descriptor fields */
  8291. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8292. #define HTT_RX_IND_RSSI_CMB_S 0
  8293. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8294. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8295. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8296. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8297. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8298. #define HTT_RX_IND_PHY_ERR_S 24
  8299. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8300. #define HTT_RX_IND_LEGACY_RATE_S 25
  8301. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8302. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8303. #define HTT_RX_IND_END_VALID_M 0x40000000
  8304. #define HTT_RX_IND_END_VALID_S 30
  8305. #define HTT_RX_IND_START_VALID_M 0x80000000
  8306. #define HTT_RX_IND_START_VALID_S 31
  8307. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8308. #define HTT_RX_IND_RSSI_PRI20_S 0
  8309. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8310. #define HTT_RX_IND_RSSI_EXT20_S 8
  8311. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8312. #define HTT_RX_IND_RSSI_EXT40_S 16
  8313. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8314. #define HTT_RX_IND_RSSI_EXT80_S 24
  8315. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8316. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8317. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8318. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8319. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8320. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8321. #define HTT_RX_IND_SERVICE_M 0xff000000
  8322. #define HTT_RX_IND_SERVICE_S 24
  8323. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8324. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8325. /* rx MSDU descriptor fields */
  8326. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8327. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8328. /* payload fields */
  8329. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8330. #define HTT_RX_IND_MPDU_COUNT_S 0
  8331. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8332. #define HTT_RX_IND_MPDU_STATUS_S 8
  8333. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8334. do { \
  8335. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8336. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8337. } while (0)
  8338. #define HTT_RX_IND_EXT_TID_GET(word) \
  8339. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8340. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8341. do { \
  8342. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8343. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8344. } while (0)
  8345. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8346. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8347. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8348. do { \
  8349. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8350. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8351. } while (0)
  8352. #define HTT_RX_IND_REL_VALID_GET(word) \
  8353. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8354. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8355. do { \
  8356. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8357. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8358. } while (0)
  8359. #define HTT_RX_IND_PEER_ID_GET(word) \
  8360. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8361. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8362. do { \
  8363. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8364. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8365. } while (0)
  8366. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8367. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8368. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8369. do { \
  8370. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8371. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8372. } while (0)
  8373. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8374. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8375. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8376. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8377. do { \
  8378. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8379. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8380. } while (0)
  8381. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8382. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8383. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8384. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8385. do { \
  8386. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8387. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8388. } while (0)
  8389. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8390. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8391. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8392. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8393. do { \
  8394. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8395. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8396. } while (0)
  8397. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8398. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8399. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8400. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8401. do { \
  8402. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8403. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8404. } while (0)
  8405. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8406. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8407. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8408. /* FW rx PPDU descriptor fields */
  8409. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8410. do { \
  8411. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8412. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8413. } while (0)
  8414. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8415. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8416. HTT_RX_IND_RSSI_CMB_S)
  8417. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8418. do { \
  8419. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8420. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8421. } while (0)
  8422. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8423. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8424. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8425. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8426. do { \
  8427. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8428. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8429. } while (0)
  8430. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8431. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8432. HTT_RX_IND_PHY_ERR_CODE_S)
  8433. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8434. do { \
  8435. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8436. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8437. } while (0)
  8438. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8439. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8440. HTT_RX_IND_PHY_ERR_S)
  8441. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8442. do { \
  8443. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8444. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8445. } while (0)
  8446. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8447. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8448. HTT_RX_IND_LEGACY_RATE_S)
  8449. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8450. do { \
  8451. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8452. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8453. } while (0)
  8454. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8455. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8456. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8457. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8458. do { \
  8459. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8460. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8461. } while (0)
  8462. #define HTT_RX_IND_END_VALID_GET(word) \
  8463. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8464. HTT_RX_IND_END_VALID_S)
  8465. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8466. do { \
  8467. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8468. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8469. } while (0)
  8470. #define HTT_RX_IND_START_VALID_GET(word) \
  8471. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8472. HTT_RX_IND_START_VALID_S)
  8473. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8474. do { \
  8475. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8476. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8477. } while (0)
  8478. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8479. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8480. HTT_RX_IND_RSSI_PRI20_S)
  8481. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8482. do { \
  8483. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8484. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8485. } while (0)
  8486. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8487. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8488. HTT_RX_IND_RSSI_EXT20_S)
  8489. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8490. do { \
  8491. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8492. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8493. } while (0)
  8494. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8495. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8496. HTT_RX_IND_RSSI_EXT40_S)
  8497. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8498. do { \
  8499. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8500. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8501. } while (0)
  8502. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8503. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8504. HTT_RX_IND_RSSI_EXT80_S)
  8505. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8506. do { \
  8507. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8508. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8509. } while (0)
  8510. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8511. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8512. HTT_RX_IND_VHT_SIG_A1_S)
  8513. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8514. do { \
  8515. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8516. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8517. } while (0)
  8518. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8519. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8520. HTT_RX_IND_VHT_SIG_A2_S)
  8521. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8522. do { \
  8523. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8524. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8525. } while (0)
  8526. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8527. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8528. HTT_RX_IND_PREAMBLE_TYPE_S)
  8529. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8530. do { \
  8531. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8532. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8533. } while (0)
  8534. #define HTT_RX_IND_SERVICE_GET(word) \
  8535. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8536. HTT_RX_IND_SERVICE_S)
  8537. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8538. do { \
  8539. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8540. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8541. } while (0)
  8542. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8543. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8544. HTT_RX_IND_SA_ANT_MATRIX_S)
  8545. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8546. do { \
  8547. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8548. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8549. } while (0)
  8550. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8551. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8552. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8553. do { \
  8554. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8555. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8556. } while (0)
  8557. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8558. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8559. #define HTT_RX_IND_HL_BYTES \
  8560. (HTT_RX_IND_HDR_BYTES + \
  8561. 4 /* single FW rx MSDU descriptor */ + \
  8562. 4 /* single MPDU range information element */)
  8563. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8564. /* Could we use one macro entry? */
  8565. #define HTT_WORD_SET(word, field, value) \
  8566. do { \
  8567. HTT_CHECK_SET_VAL(field, value); \
  8568. (word) |= ((value) << field ## _S); \
  8569. } while (0)
  8570. #define HTT_WORD_GET(word, field) \
  8571. (((word) & field ## _M) >> field ## _S)
  8572. PREPACK struct hl_htt_rx_ind_base {
  8573. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8574. } POSTPACK;
  8575. /*
  8576. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8577. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8578. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8579. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8580. * htt_rx_ind_hl_rx_desc_t.
  8581. */
  8582. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8583. struct htt_rx_ind_hl_rx_desc_t {
  8584. A_UINT8 ver;
  8585. A_UINT8 len;
  8586. struct {
  8587. A_UINT8
  8588. first_msdu: 1,
  8589. last_msdu: 1,
  8590. c3_failed: 1,
  8591. c4_failed: 1,
  8592. ipv6: 1,
  8593. tcp: 1,
  8594. udp: 1,
  8595. reserved: 1;
  8596. } flags;
  8597. /* NOTE: no reserved space - don't append any new fields here */
  8598. };
  8599. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8600. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8601. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8602. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8603. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8604. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8605. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8606. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8607. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8608. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8609. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8610. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8611. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8612. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8613. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8614. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8615. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8616. /* This structure is used in HL, the basic descriptor information
  8617. * used by host. the structure is translated by FW from HW desc
  8618. * or generated by FW. But in HL monitor mode, the host would use
  8619. * the same structure with LL.
  8620. */
  8621. PREPACK struct hl_htt_rx_desc_base {
  8622. A_UINT32
  8623. seq_num:12,
  8624. encrypted:1,
  8625. chan_info_present:1,
  8626. resv0:2,
  8627. mcast_bcast:1,
  8628. fragment:1,
  8629. key_id_oct:8,
  8630. resv1:6;
  8631. A_UINT32
  8632. pn_31_0;
  8633. union {
  8634. struct {
  8635. A_UINT16 pn_47_32;
  8636. A_UINT16 pn_63_48;
  8637. } pn16;
  8638. A_UINT32 pn_63_32;
  8639. } u0;
  8640. A_UINT32
  8641. pn_95_64;
  8642. A_UINT32
  8643. pn_127_96;
  8644. } POSTPACK;
  8645. /*
  8646. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8647. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8648. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8649. * Please see htt_chan_change_t for description of the fields.
  8650. */
  8651. PREPACK struct htt_chan_info_t
  8652. {
  8653. A_UINT32 primary_chan_center_freq_mhz: 16,
  8654. contig_chan1_center_freq_mhz: 16;
  8655. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8656. phy_mode: 8,
  8657. reserved: 8;
  8658. } POSTPACK;
  8659. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8660. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8661. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8662. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8663. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8664. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8665. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8666. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8667. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8668. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8669. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8670. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8671. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8672. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8673. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8674. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8675. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8676. /* Channel information */
  8677. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8678. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8679. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8680. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8681. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8682. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8683. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8684. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8685. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8686. do { \
  8687. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8688. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8689. } while (0)
  8690. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8691. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8692. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8693. do { \
  8694. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8695. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8696. } while (0)
  8697. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8698. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8699. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8700. do { \
  8701. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8702. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8703. } while (0)
  8704. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8705. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8706. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8707. do { \
  8708. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8709. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8710. } while (0)
  8711. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8712. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8713. /*
  8714. * @brief target -> host message definition for FW offloaded pkts
  8715. *
  8716. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8717. *
  8718. * @details
  8719. * The following field definitions describe the format of the firmware
  8720. * offload deliver message sent from the target to the host.
  8721. *
  8722. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8723. *
  8724. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8725. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8726. * | reserved_1 | msg type |
  8727. * |--------------------------------------------------------------------------|
  8728. * | phy_timestamp_l32 |
  8729. * |--------------------------------------------------------------------------|
  8730. * | WORD2 (see below) |
  8731. * |--------------------------------------------------------------------------|
  8732. * | seqno | framectrl |
  8733. * |--------------------------------------------------------------------------|
  8734. * | reserved_3 | vdev_id | tid_num|
  8735. * |--------------------------------------------------------------------------|
  8736. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8737. * |--------------------------------------------------------------------------|
  8738. *
  8739. * where:
  8740. * STAT = status
  8741. * F = format (802.3 vs. 802.11)
  8742. *
  8743. * definition for word 2
  8744. *
  8745. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8746. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8747. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8748. * |--------------------------------------------------------------------------|
  8749. *
  8750. * where:
  8751. * PR = preamble
  8752. * BF = beamformed
  8753. */
  8754. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8755. {
  8756. A_UINT32 /* word 0 */
  8757. msg_type:8, /* [ 7: 0] */
  8758. reserved_1:24; /* [31: 8] */
  8759. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8760. A_UINT32 /* word 2 */
  8761. /* preamble:
  8762. * 0-OFDM,
  8763. * 1-CCk,
  8764. * 2-HT,
  8765. * 3-VHT
  8766. */
  8767. preamble: 2, /* [1:0] */
  8768. /* mcs:
  8769. * In case of HT preamble interpret
  8770. * MCS along with NSS.
  8771. * Valid values for HT are 0 to 7.
  8772. * HT mcs 0 with NSS 2 is mcs 8.
  8773. * Valid values for VHT are 0 to 9.
  8774. */
  8775. mcs: 4, /* [5:2] */
  8776. /* rate:
  8777. * This is applicable only for
  8778. * CCK and OFDM preamble type
  8779. * rate 0: OFDM 48 Mbps,
  8780. * 1: OFDM 24 Mbps,
  8781. * 2: OFDM 12 Mbps
  8782. * 3: OFDM 6 Mbps
  8783. * 4: OFDM 54 Mbps
  8784. * 5: OFDM 36 Mbps
  8785. * 6: OFDM 18 Mbps
  8786. * 7: OFDM 9 Mbps
  8787. * rate 0: CCK 11 Mbps Long
  8788. * 1: CCK 5.5 Mbps Long
  8789. * 2: CCK 2 Mbps Long
  8790. * 3: CCK 1 Mbps Long
  8791. * 4: CCK 11 Mbps Short
  8792. * 5: CCK 5.5 Mbps Short
  8793. * 6: CCK 2 Mbps Short
  8794. */
  8795. rate : 3, /* [ 8: 6] */
  8796. rssi : 8, /* [16: 9] units=dBm */
  8797. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8798. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8799. stbc : 1, /* [22] */
  8800. sgi : 1, /* [23] */
  8801. ldpc : 1, /* [24] */
  8802. beamformed: 1, /* [25] */
  8803. reserved_2: 6; /* [31:26] */
  8804. A_UINT32 /* word 3 */
  8805. framectrl:16, /* [15: 0] */
  8806. seqno:16; /* [31:16] */
  8807. A_UINT32 /* word 4 */
  8808. tid_num:5, /* [ 4: 0] actual TID number */
  8809. vdev_id:8, /* [12: 5] */
  8810. reserved_3:19; /* [31:13] */
  8811. A_UINT32 /* word 5 */
  8812. /* status:
  8813. * 0: tx_ok
  8814. * 1: retry
  8815. * 2: drop
  8816. * 3: filtered
  8817. * 4: abort
  8818. * 5: tid delete
  8819. * 6: sw abort
  8820. * 7: dropped by peer migration
  8821. */
  8822. status:3, /* [2:0] */
  8823. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8824. tx_mpdu_bytes:16, /* [19:4] */
  8825. /* Indicates retry count of offloaded/local generated Data tx frames */
  8826. tx_retry_cnt:6, /* [25:20] */
  8827. reserved_4:6; /* [31:26] */
  8828. } POSTPACK;
  8829. /* FW offload deliver ind message header fields */
  8830. /* DWORD one */
  8831. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8832. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8833. /* DWORD two */
  8834. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8835. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8836. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8837. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8838. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8839. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8840. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8841. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8842. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8843. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8844. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8845. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8846. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8847. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8848. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8849. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8850. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8851. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8852. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8853. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8854. /* DWORD three*/
  8855. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8856. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8857. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8858. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8859. /* DWORD four */
  8860. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8861. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8862. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8863. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8864. /* DWORD five */
  8865. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8866. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8867. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8868. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8869. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8870. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8871. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8872. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8873. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8874. do { \
  8875. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8876. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8877. } while (0)
  8878. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8879. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8880. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8881. do { \
  8882. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8883. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8884. } while (0)
  8885. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8886. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8887. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8888. do { \
  8889. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8890. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8891. } while (0)
  8892. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8893. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8894. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8895. do { \
  8896. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8897. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8898. } while (0)
  8899. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8900. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8901. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8902. do { \
  8903. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8904. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8905. } while (0)
  8906. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8907. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8908. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8909. do { \
  8910. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8911. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8912. } while (0)
  8913. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8914. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8915. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8916. do { \
  8917. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8918. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8919. } while (0)
  8920. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8921. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8922. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8923. do { \
  8924. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8925. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8926. } while (0)
  8927. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8928. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8929. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8930. do { \
  8931. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8932. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8933. } while (0)
  8934. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8935. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8936. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8937. do { \
  8938. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8939. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8940. } while (0)
  8941. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8942. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8943. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8944. do { \
  8945. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8946. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8947. } while (0)
  8948. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8949. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8950. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8951. do { \
  8952. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8953. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8954. } while (0)
  8955. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8956. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8957. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8958. do { \
  8959. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8960. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8961. } while (0)
  8962. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8963. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8964. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8965. do { \
  8966. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8967. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8968. } while (0)
  8969. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8970. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8971. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8972. do { \
  8973. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8974. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8975. } while (0)
  8976. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8977. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8978. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8979. do { \
  8980. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8981. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8982. } while (0)
  8983. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8984. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8985. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8986. do { \
  8987. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8988. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8989. } while (0)
  8990. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8991. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8992. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8993. do { \
  8994. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8995. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8996. } while (0)
  8997. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8998. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  8999. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9000. do { \
  9001. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9002. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9003. } while (0)
  9004. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9005. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9006. /*
  9007. * @brief target -> host rx reorder flush message definition
  9008. *
  9009. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9010. *
  9011. * @details
  9012. * The following field definitions describe the format of the rx flush
  9013. * message sent from the target to the host.
  9014. * The message consists of a 4-octet header, followed by one or more
  9015. * 4-octet payload information elements.
  9016. *
  9017. * |31 24|23 8|7 0|
  9018. * |--------------------------------------------------------------|
  9019. * | TID | peer ID | msg type |
  9020. * |--------------------------------------------------------------|
  9021. * | seq num end | seq num start | MPDU status | reserved |
  9022. * |--------------------------------------------------------------|
  9023. * First DWORD:
  9024. * - MSG_TYPE
  9025. * Bits 7:0
  9026. * Purpose: identifies this as an rx flush message
  9027. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9028. * - PEER_ID
  9029. * Bits 23:8 (only bits 18:8 actually used)
  9030. * Purpose: identify which peer's rx data is being flushed
  9031. * Value: (rx) peer ID
  9032. * - TID
  9033. * Bits 31:24 (only bits 27:24 actually used)
  9034. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9035. * Value: traffic identifier
  9036. * Second DWORD:
  9037. * - MPDU_STATUS
  9038. * Bits 15:8
  9039. * Purpose:
  9040. * Indicate whether the flushed MPDUs should be discarded or processed.
  9041. * Value:
  9042. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9043. * stages of rx processing
  9044. * other: discard the MPDUs
  9045. * It is anticipated that flush messages will always have
  9046. * MPDU status == 1, but the status flag is included for
  9047. * flexibility.
  9048. * - SEQ_NUM_START
  9049. * Bits 23:16
  9050. * Purpose:
  9051. * Indicate the start of a series of consecutive MPDUs being flushed.
  9052. * Not all MPDUs within this range are necessarily valid - the host
  9053. * must check each sequence number within this range to see if the
  9054. * corresponding MPDU is actually present.
  9055. * Value:
  9056. * The sequence number for the first MPDU in the sequence.
  9057. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9058. * - SEQ_NUM_END
  9059. * Bits 30:24
  9060. * Purpose:
  9061. * Indicate the end of a series of consecutive MPDUs being flushed.
  9062. * Value:
  9063. * The sequence number one larger than the sequence number of the
  9064. * last MPDU being flushed.
  9065. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9066. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9067. * are to be released for further rx processing.
  9068. * Not all MPDUs within this range are necessarily valid - the host
  9069. * must check each sequence number within this range to see if the
  9070. * corresponding MPDU is actually present.
  9071. */
  9072. /* first DWORD */
  9073. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9074. #define HTT_RX_FLUSH_PEER_ID_S 8
  9075. #define HTT_RX_FLUSH_TID_M 0xff000000
  9076. #define HTT_RX_FLUSH_TID_S 24
  9077. /* second DWORD */
  9078. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9079. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9080. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9081. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9082. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9083. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9084. #define HTT_RX_FLUSH_BYTES 8
  9085. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9086. do { \
  9087. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9088. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9089. } while (0)
  9090. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9091. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9092. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9093. do { \
  9094. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9095. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9096. } while (0)
  9097. #define HTT_RX_FLUSH_TID_GET(word) \
  9098. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9099. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9100. do { \
  9101. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9102. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9103. } while (0)
  9104. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9105. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9106. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9107. do { \
  9108. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9109. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9110. } while (0)
  9111. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9112. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9113. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9114. do { \
  9115. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9116. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9117. } while (0)
  9118. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9119. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9120. /*
  9121. * @brief target -> host rx pn check indication message
  9122. *
  9123. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9124. *
  9125. * @details
  9126. * The following field definitions describe the format of the Rx PN check
  9127. * indication message sent from the target to the host.
  9128. * The message consists of a 4-octet header, followed by the start and
  9129. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9130. * IE is one octet containing the sequence number that failed the PN
  9131. * check.
  9132. *
  9133. * |31 24|23 8|7 0|
  9134. * |--------------------------------------------------------------|
  9135. * | TID | peer ID | msg type |
  9136. * |--------------------------------------------------------------|
  9137. * | Reserved | PN IE count | seq num end | seq num start|
  9138. * |--------------------------------------------------------------|
  9139. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9140. * |--------------------------------------------------------------|
  9141. * First DWORD:
  9142. * - MSG_TYPE
  9143. * Bits 7:0
  9144. * Purpose: Identifies this as an rx pn check indication message
  9145. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9146. * - PEER_ID
  9147. * Bits 23:8 (only bits 18:8 actually used)
  9148. * Purpose: identify which peer
  9149. * Value: (rx) peer ID
  9150. * - TID
  9151. * Bits 31:24 (only bits 27:24 actually used)
  9152. * Purpose: identify traffic identifier
  9153. * Value: traffic identifier
  9154. * Second DWORD:
  9155. * - SEQ_NUM_START
  9156. * Bits 7:0
  9157. * Purpose:
  9158. * Indicates the starting sequence number of the MPDU in this
  9159. * series of MPDUs that went though PN check.
  9160. * Value:
  9161. * The sequence number for the first MPDU in the sequence.
  9162. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9163. * - SEQ_NUM_END
  9164. * Bits 15:8
  9165. * Purpose:
  9166. * Indicates the ending sequence number of the MPDU in this
  9167. * series of MPDUs that went though PN check.
  9168. * Value:
  9169. * The sequence number one larger then the sequence number of the last
  9170. * MPDU being flushed.
  9171. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9172. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9173. * for invalid PN numbers and are ready to be released for further processing.
  9174. * Not all MPDUs within this range are necessarily valid - the host
  9175. * must check each sequence number within this range to see if the
  9176. * corresponding MPDU is actually present.
  9177. * - PN_IE_COUNT
  9178. * Bits 23:16
  9179. * Purpose:
  9180. * Used to determine the variable number of PN information elements in this
  9181. * message
  9182. *
  9183. * PN information elements:
  9184. * - PN_IE_x-
  9185. * Purpose:
  9186. * Each PN information element contains the sequence number of the MPDU that
  9187. * has failed the target PN check.
  9188. * Value:
  9189. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9190. * that failed the PN check.
  9191. */
  9192. /* first DWORD */
  9193. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9194. #define HTT_RX_PN_IND_PEER_ID_S 8
  9195. #define HTT_RX_PN_IND_TID_M 0xff000000
  9196. #define HTT_RX_PN_IND_TID_S 24
  9197. /* second DWORD */
  9198. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9199. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9200. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9201. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9202. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9203. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9204. #define HTT_RX_PN_IND_BYTES 8
  9205. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9206. do { \
  9207. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9208. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9209. } while (0)
  9210. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9211. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9212. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9213. do { \
  9214. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9215. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9216. } while (0)
  9217. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9218. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9219. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9220. do { \
  9221. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9222. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9223. } while (0)
  9224. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9225. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9226. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9227. do { \
  9228. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9229. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9230. } while (0)
  9231. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9232. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9233. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9234. do { \
  9235. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9236. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9237. } while (0)
  9238. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9239. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9240. /*
  9241. * @brief target -> host rx offload deliver message for LL system
  9242. *
  9243. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9244. *
  9245. * @details
  9246. * In a low latency system this message is sent whenever the offload
  9247. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9248. * The DMA of the actual packets into host memory is done before sending out
  9249. * this message. This message indicates only how many MSDUs to reap. The
  9250. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9251. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9252. * DMA'd by the MAC directly into host memory these packets do not contain
  9253. * the MAC descriptors in the header portion of the packet. Instead they contain
  9254. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9255. * message, the packets are delivered directly to the NW stack without going
  9256. * through the regular reorder buffering and PN checking path since it has
  9257. * already been done in target.
  9258. *
  9259. * |31 24|23 16|15 8|7 0|
  9260. * |-----------------------------------------------------------------------|
  9261. * | Total MSDU count | reserved | msg type |
  9262. * |-----------------------------------------------------------------------|
  9263. *
  9264. * @brief target -> host rx offload deliver message for HL system
  9265. *
  9266. * @details
  9267. * In a high latency system this message is sent whenever the offload manager
  9268. * flushes out the packets it has coalesced in its coalescing buffer. The
  9269. * actual packets are also carried along with this message. When the host
  9270. * receives this message, it is expected to deliver these packets to the NW
  9271. * stack directly instead of routing them through the reorder buffering and
  9272. * PN checking path since it has already been done in target.
  9273. *
  9274. * |31 24|23 16|15 8|7 0|
  9275. * |-----------------------------------------------------------------------|
  9276. * | Total MSDU count | reserved | msg type |
  9277. * |-----------------------------------------------------------------------|
  9278. * | peer ID | MSDU length |
  9279. * |-----------------------------------------------------------------------|
  9280. * | MSDU payload | FW Desc | tid | vdev ID |
  9281. * |-----------------------------------------------------------------------|
  9282. * | MSDU payload contd. |
  9283. * |-----------------------------------------------------------------------|
  9284. * | peer ID | MSDU length |
  9285. * |-----------------------------------------------------------------------|
  9286. * | MSDU payload | FW Desc | tid | vdev ID |
  9287. * |-----------------------------------------------------------------------|
  9288. * | MSDU payload contd. |
  9289. * |-----------------------------------------------------------------------|
  9290. *
  9291. */
  9292. /* first DWORD */
  9293. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9294. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9295. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9296. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9297. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9298. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9299. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9300. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9301. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9302. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9303. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9304. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9305. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9306. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9307. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9308. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9309. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9310. do { \
  9311. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9312. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9313. } while (0)
  9314. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9315. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9316. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9317. do { \
  9318. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9319. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9320. } while (0)
  9321. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9322. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9323. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9324. do { \
  9325. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9326. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9327. } while (0)
  9328. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9329. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9330. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9331. do { \
  9332. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9333. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9334. } while (0)
  9335. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9336. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9337. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9338. do { \
  9339. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9340. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9341. } while (0)
  9342. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9343. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9344. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9345. do { \
  9346. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9347. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9348. } while (0)
  9349. /**
  9350. * @brief target -> host rx peer map/unmap message definition
  9351. *
  9352. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9353. *
  9354. * @details
  9355. * The following diagram shows the format of the rx peer map message sent
  9356. * from the target to the host. This layout assumes the target operates
  9357. * as little-endian.
  9358. *
  9359. * This message always contains a SW peer ID. The main purpose of the
  9360. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9361. * with, so that the host can use that peer ID to determine which peer
  9362. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9363. * other purposes, such as identifying during tx completions which peer
  9364. * the tx frames in question were transmitted to.
  9365. *
  9366. * In certain generations of chips, the peer map message also contains
  9367. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9368. * to identify which peer the frame needs to be forwarded to (i.e. the
  9369. * peer assocated with the Destination MAC Address within the packet),
  9370. * and particularly which vdev needs to transmit the frame (for cases
  9371. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9372. * meaning as AST_INDEX_0.
  9373. * This DA-based peer ID that is provided for certain rx frames
  9374. * (the rx frames that need to be re-transmitted as tx frames)
  9375. * is the ID that the HW uses for referring to the peer in question,
  9376. * rather than the peer ID that the SW+FW use to refer to the peer.
  9377. *
  9378. *
  9379. * |31 24|23 16|15 8|7 0|
  9380. * |-----------------------------------------------------------------------|
  9381. * | SW peer ID | VDEV ID | msg type |
  9382. * |-----------------------------------------------------------------------|
  9383. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9384. * |-----------------------------------------------------------------------|
  9385. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9386. * |-----------------------------------------------------------------------|
  9387. *
  9388. *
  9389. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9390. *
  9391. * The following diagram shows the format of the rx peer unmap message sent
  9392. * from the target to the host.
  9393. *
  9394. * |31 24|23 16|15 8|7 0|
  9395. * |-----------------------------------------------------------------------|
  9396. * | SW peer ID | VDEV ID | msg type |
  9397. * |-----------------------------------------------------------------------|
  9398. *
  9399. * The following field definitions describe the format of the rx peer map
  9400. * and peer unmap messages sent from the target to the host.
  9401. * - MSG_TYPE
  9402. * Bits 7:0
  9403. * Purpose: identifies this as an rx peer map or peer unmap message
  9404. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9405. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9406. * - VDEV_ID
  9407. * Bits 15:8
  9408. * Purpose: Indicates which virtual device the peer is associated
  9409. * with.
  9410. * Value: vdev ID (used in the host to look up the vdev object)
  9411. * - PEER_ID (a.k.a. SW_PEER_ID)
  9412. * Bits 31:16
  9413. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9414. * freeing (unmap)
  9415. * Value: (rx) peer ID
  9416. * - MAC_ADDR_L32 (peer map only)
  9417. * Bits 31:0
  9418. * Purpose: Identifies which peer node the peer ID is for.
  9419. * Value: lower 4 bytes of peer node's MAC address
  9420. * - MAC_ADDR_U16 (peer map only)
  9421. * Bits 15:0
  9422. * Purpose: Identifies which peer node the peer ID is for.
  9423. * Value: upper 2 bytes of peer node's MAC address
  9424. * - HW_PEER_ID
  9425. * Bits 31:16
  9426. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9427. * address, so for rx frames marked for rx --> tx forwarding, the
  9428. * host can determine from the HW peer ID provided as meta-data with
  9429. * the rx frame which peer the frame is supposed to be forwarded to.
  9430. * Value: ID used by the MAC HW to identify the peer
  9431. */
  9432. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9433. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9434. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9435. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9436. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9437. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9438. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9439. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9440. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9441. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9442. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9443. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9444. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9445. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9446. do { \
  9447. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9448. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9449. } while (0)
  9450. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9451. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9452. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9453. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9454. do { \
  9455. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9456. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9457. } while (0)
  9458. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9459. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9460. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9461. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9462. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9463. do { \
  9464. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9465. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9466. } while (0)
  9467. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9468. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9469. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9470. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9471. #define HTT_RX_PEER_MAP_BYTES 12
  9472. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9473. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9474. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9475. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9476. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9477. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9478. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9479. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9480. #define HTT_RX_PEER_UNMAP_BYTES 4
  9481. /**
  9482. * @brief target -> host rx peer map V2 message definition
  9483. *
  9484. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9485. *
  9486. * @details
  9487. * The following diagram shows the format of the rx peer map v2 message sent
  9488. * from the target to the host. This layout assumes the target operates
  9489. * as little-endian.
  9490. *
  9491. * This message always contains a SW peer ID. The main purpose of the
  9492. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9493. * with, so that the host can use that peer ID to determine which peer
  9494. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9495. * other purposes, such as identifying during tx completions which peer
  9496. * the tx frames in question were transmitted to.
  9497. *
  9498. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9499. * is used during rx --> tx frame forwarding to identify which peer the
  9500. * frame needs to be forwarded to (i.e. the peer assocated with the
  9501. * Destination MAC Address within the packet), and particularly which vdev
  9502. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9503. * This DA-based peer ID that is provided for certain rx frames
  9504. * (the rx frames that need to be re-transmitted as tx frames)
  9505. * is the ID that the HW uses for referring to the peer in question,
  9506. * rather than the peer ID that the SW+FW use to refer to the peer.
  9507. *
  9508. * The HW peer id here is the same meaning as AST_INDEX_0.
  9509. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9510. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9511. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9512. * AST is valid.
  9513. *
  9514. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9515. * |-------------------------------------------------------------------------|
  9516. * | SW peer ID | VDEV ID | msg type |
  9517. * |-------------------------------------------------------------------------|
  9518. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9519. * |-------------------------------------------------------------------------|
  9520. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9521. * |-------------------------------------------------------------------------|
  9522. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9523. * |-------------------------------------------------------------------------|
  9524. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9525. * |-------------------------------------------------------------------------|
  9526. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9527. * |-------------------------------------------------------------------------|
  9528. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9529. * |-------------------------------------------------------------------------|
  9530. * | Reserved_2 |
  9531. * |-------------------------------------------------------------------------|
  9532. * Where:
  9533. * NH = Next Hop
  9534. * ASTVM = AST valid mask
  9535. * OA = on-chip AST valid bit
  9536. * ASTFM = AST flow mask
  9537. *
  9538. * The following field definitions describe the format of the rx peer map v2
  9539. * messages sent from the target to the host.
  9540. * - MSG_TYPE
  9541. * Bits 7:0
  9542. * Purpose: identifies this as an rx peer map v2 message
  9543. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9544. * - VDEV_ID
  9545. * Bits 15:8
  9546. * Purpose: Indicates which virtual device the peer is associated with.
  9547. * Value: vdev ID (used in the host to look up the vdev object)
  9548. * - SW_PEER_ID
  9549. * Bits 31:16
  9550. * Purpose: The peer ID (index) that WAL is allocating
  9551. * Value: (rx) peer ID
  9552. * - MAC_ADDR_L32
  9553. * Bits 31:0
  9554. * Purpose: Identifies which peer node the peer ID is for.
  9555. * Value: lower 4 bytes of peer node's MAC address
  9556. * - MAC_ADDR_U16
  9557. * Bits 15:0
  9558. * Purpose: Identifies which peer node the peer ID is for.
  9559. * Value: upper 2 bytes of peer node's MAC address
  9560. * - HW_PEER_ID / AST_INDEX_0
  9561. * Bits 31:16
  9562. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9563. * address, so for rx frames marked for rx --> tx forwarding, the
  9564. * host can determine from the HW peer ID provided as meta-data with
  9565. * the rx frame which peer the frame is supposed to be forwarded to.
  9566. * Value: ID used by the MAC HW to identify the peer
  9567. * - AST_HASH_VALUE
  9568. * Bits 15:0
  9569. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9570. * override feature.
  9571. * - NEXT_HOP
  9572. * Bit 16
  9573. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9574. * (Wireless Distribution System).
  9575. * - AST_VALID_MASK
  9576. * Bits 19:17
  9577. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9578. * - ONCHIP_AST_VALID_FLAG
  9579. * Bit 20
  9580. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9581. * is valid.
  9582. * - AST_INDEX_1
  9583. * Bits 15:0
  9584. * Purpose: indicate the second AST index for this peer
  9585. * - AST_0_FLOW_MASK
  9586. * Bits 19:16
  9587. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9588. * - AST_1_FLOW_MASK
  9589. * Bits 23:20
  9590. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9591. * - AST_2_FLOW_MASK
  9592. * Bits 27:24
  9593. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9594. * - AST_3_FLOW_MASK
  9595. * Bits 31:28
  9596. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9597. * - AST_INDEX_2
  9598. * Bits 15:0
  9599. * Purpose: indicate the third AST index for this peer
  9600. * - TID_VALID_HI_PRI
  9601. * Bits 23:16
  9602. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9603. * - TID_VALID_LOW_PRI
  9604. * Bits 31:24
  9605. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9606. * - AST_INDEX_3
  9607. * Bits 15:0
  9608. * Purpose: indicate the fourth AST index for this peer
  9609. * - ONCHIP_AST_IDX / RESERVED
  9610. * Bits 31:16
  9611. * Purpose: This field is valid only when split AST feature is enabled.
  9612. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9613. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9614. * address, this ast_idx is used for LMAC modules for RXPCU.
  9615. * Value: ID used by the LMAC HW to identify the peer
  9616. */
  9617. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9618. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9619. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9620. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9621. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9622. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9623. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9624. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9625. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9626. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9627. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9628. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9629. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9630. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9631. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9632. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9633. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9634. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9635. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9636. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9637. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9638. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9639. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9640. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9641. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9642. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9643. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9644. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9645. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9646. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9647. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9648. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9649. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9650. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9651. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9652. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9653. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9654. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9655. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9656. do { \
  9657. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9658. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9659. } while (0)
  9660. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9661. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9662. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9663. do { \
  9664. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9665. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9666. } while (0)
  9667. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9668. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9669. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9670. do { \
  9671. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9672. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9673. } while (0)
  9674. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9675. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9676. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9677. do { \
  9678. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9679. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9680. } while (0)
  9681. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9682. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9683. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9684. do { \
  9685. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9686. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9687. } while (0)
  9688. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9689. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9690. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9691. do { \
  9692. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9693. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9694. } while (0)
  9695. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9696. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9697. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9698. do { \
  9699. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9700. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9701. } while (0)
  9702. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9703. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9704. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9705. do { \
  9706. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9707. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9708. } while (0)
  9709. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9710. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9711. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9712. do { \
  9713. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9714. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9715. } while (0)
  9716. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9717. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9718. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9719. do { \
  9720. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9721. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9722. } while (0)
  9723. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9724. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9725. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9726. do { \
  9727. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9728. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9729. } while (0)
  9730. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9731. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9732. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9733. do { \
  9734. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9735. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9736. } while (0)
  9737. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9738. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9739. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9740. do { \
  9741. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9742. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9743. } while (0)
  9744. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9745. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9746. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9747. do { \
  9748. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9749. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9750. } while (0)
  9751. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9752. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9753. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9754. do { \
  9755. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9756. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9757. } while (0)
  9758. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9759. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9760. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9761. do { \
  9762. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9763. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9764. } while (0)
  9765. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9766. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9767. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9768. do { \
  9769. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9770. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9771. } while (0)
  9772. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9773. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9774. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9775. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9776. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9777. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9778. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9779. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9780. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9781. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9782. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9783. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9784. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9785. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9786. /**
  9787. * @brief target -> host rx peer map V3 message definition
  9788. *
  9789. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9790. *
  9791. * @details
  9792. * The following diagram shows the format of the rx peer map v3 message sent
  9793. * from the target to the host.
  9794. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9795. * This layout assumes the target operates as little-endian.
  9796. *
  9797. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9798. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9799. * | SW peer ID | VDEV ID | msg type |
  9800. * |-----------------+--------------------+-----------------+-----------------|
  9801. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9802. * |-----------------+--------------------+-----------------+-----------------|
  9803. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9804. * |-----------------+--------+-----------+-----------------+-----------------|
  9805. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9806. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9807. * | (8bits) | | (4bits) | |
  9808. * |-----------------+--------+--+--+--+--------------------------------------|
  9809. * | RESERVED |E |O | | |
  9810. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9811. * | |V |V | | |
  9812. * |-----------------+--------------------+-----------------------------------|
  9813. * | HTT_MSDU_IDX_ | RESERVED | |
  9814. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9815. * | (8bits) | | |
  9816. * |-----------------+--------------------+-----------------------------------|
  9817. * | Reserved_2 |
  9818. * |--------------------------------------------------------------------------|
  9819. * | Reserved_3 |
  9820. * |--------------------------------------------------------------------------|
  9821. *
  9822. * Where:
  9823. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9824. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9825. * NH = Next Hop
  9826. * The following field definitions describe the format of the rx peer map v3
  9827. * messages sent from the target to the host.
  9828. * - MSG_TYPE
  9829. * Bits 7:0
  9830. * Purpose: identifies this as a peer map v3 message
  9831. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9832. * - VDEV_ID
  9833. * Bits 15:8
  9834. * Purpose: Indicates which virtual device the peer is associated with.
  9835. * - SW_PEER_ID
  9836. * Bits 31:16
  9837. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9838. * - MAC_ADDR_L32
  9839. * Bits 31:0
  9840. * Purpose: Identifies which peer node the peer ID is for.
  9841. * Value: lower 4 bytes of peer node's MAC address
  9842. * - MAC_ADDR_U16
  9843. * Bits 15:0
  9844. * Purpose: Identifies which peer node the peer ID is for.
  9845. * Value: upper 2 bytes of peer node's MAC address
  9846. * - MULTICAST_SW_PEER_ID
  9847. * Bits 31:16
  9848. * Purpose: The multicast peer ID (index)
  9849. * Value: set to HTT_INVALID_PEER if not valid
  9850. * - HW_PEER_ID / AST_INDEX
  9851. * Bits 15:0
  9852. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9853. * address, so for rx frames marked for rx --> tx forwarding, the
  9854. * host can determine from the HW peer ID provided as meta-data with
  9855. * the rx frame which peer the frame is supposed to be forwarded to.
  9856. * - CACHE_SET_NUM
  9857. * Bits 19:16
  9858. * Purpose: Cache Set Number for AST_INDEX
  9859. * Cache set number that should be used to cache the index based
  9860. * search results, for address and flow search.
  9861. * This value should be equal to LSB 4 bits of the hash value
  9862. * of match data, in case of search index points to an entry which
  9863. * may be used in content based search also. The value can be
  9864. * anything when the entry pointed by search index will not be
  9865. * used for content based search.
  9866. * - HTT_MSDU_IDX_VALID_MASK
  9867. * Bits 31:24
  9868. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9869. * - ONCHIP_AST_IDX / RESERVED
  9870. * Bits 15:0
  9871. * Purpose: This field is valid only when split AST feature is enabled.
  9872. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9873. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9874. * address, this ast_idx is used for LMAC modules for RXPCU.
  9875. * - NEXT_HOP
  9876. * Bits 16
  9877. * Purpose: Flag indicates next_hop AST entry used for WDS
  9878. * (Wireless Distribution System).
  9879. * - ONCHIP_AST_VALID
  9880. * Bits 17
  9881. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9882. * - EXT_AST_VALID
  9883. * Bits 18
  9884. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9885. * - EXT_AST_INDEX
  9886. * Bits 15:0
  9887. * Purpose: This field describes Extended AST index
  9888. * Valid if EXT_AST_VALID flag set
  9889. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9890. * Bits 31:24
  9891. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9892. */
  9893. /* dword 0 */
  9894. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9895. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9896. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9897. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9898. /* dword 1 */
  9899. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9900. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9901. /* dword 2 */
  9902. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9903. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9904. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9905. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9906. /* dword 3 */
  9907. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9908. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9909. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9910. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9911. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9912. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9913. /* dword 4 */
  9914. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9915. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9916. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9917. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9918. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9919. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9920. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9921. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9922. /* dword 5 */
  9923. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9924. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9925. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9926. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9927. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9928. do { \
  9929. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9930. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9931. } while (0)
  9932. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9933. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9934. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9935. do { \
  9936. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9937. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9938. } while (0)
  9939. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9940. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9941. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9942. do { \
  9943. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9944. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9945. } while (0)
  9946. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9947. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9948. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9949. do { \
  9950. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9951. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9952. } while (0)
  9953. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9954. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9955. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9956. do { \
  9957. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9958. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9959. } while (0)
  9960. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9961. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9962. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9963. do { \
  9964. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9965. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9966. } while (0)
  9967. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9968. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9969. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9970. do { \
  9971. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9972. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9973. } while (0)
  9974. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9975. (((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)
  9976. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9977. do { \
  9978. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9979. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9980. } while (0)
  9981. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9982. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9983. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9984. do { \
  9985. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9986. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9987. } while (0)
  9988. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9989. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9990. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9991. do { \
  9992. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9993. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9994. } while (0)
  9995. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9996. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9997. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  9998. do { \
  9999. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10000. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10001. } while (0)
  10002. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10003. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10004. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10005. do { \
  10006. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10007. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10008. } while (0)
  10009. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10010. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10011. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10012. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10013. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10014. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10015. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10016. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10017. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10018. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10019. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10020. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10021. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10022. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10023. /**
  10024. * @brief target -> host rx peer unmap V2 message definition
  10025. *
  10026. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10027. *
  10028. * The following diagram shows the format of the rx peer unmap message sent
  10029. * from the target to the host.
  10030. *
  10031. * |31 24|23 16|15 8|7 0|
  10032. * |-----------------------------------------------------------------------|
  10033. * | SW peer ID | VDEV ID | msg type |
  10034. * |-----------------------------------------------------------------------|
  10035. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10036. * |-----------------------------------------------------------------------|
  10037. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10038. * |-----------------------------------------------------------------------|
  10039. * | Peer Delete Duration |
  10040. * |-----------------------------------------------------------------------|
  10041. * | Reserved_0 | WDS Free Count |
  10042. * |-----------------------------------------------------------------------|
  10043. * | Reserved_1 |
  10044. * |-----------------------------------------------------------------------|
  10045. * | Reserved_2 |
  10046. * |-----------------------------------------------------------------------|
  10047. *
  10048. *
  10049. * The following field definitions describe the format of the rx peer unmap
  10050. * messages sent from the target to the host.
  10051. * - MSG_TYPE
  10052. * Bits 7:0
  10053. * Purpose: identifies this as an rx peer unmap v2 message
  10054. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10055. * - VDEV_ID
  10056. * Bits 15:8
  10057. * Purpose: Indicates which virtual device the peer is associated
  10058. * with.
  10059. * Value: vdev ID (used in the host to look up the vdev object)
  10060. * - SW_PEER_ID
  10061. * Bits 31:16
  10062. * Purpose: The peer ID (index) that WAL is freeing
  10063. * Value: (rx) peer ID
  10064. * - MAC_ADDR_L32
  10065. * Bits 31:0
  10066. * Purpose: Identifies which peer node the peer ID is for.
  10067. * Value: lower 4 bytes of peer node's MAC address
  10068. * - MAC_ADDR_U16
  10069. * Bits 15:0
  10070. * Purpose: Identifies which peer node the peer ID is for.
  10071. * Value: upper 2 bytes of peer node's MAC address
  10072. * - NEXT_HOP
  10073. * Bits 16
  10074. * Purpose: Bit indicates next_hop AST entry used for WDS
  10075. * (Wireless Distribution System).
  10076. * - PEER_DELETE_DURATION
  10077. * Bits 31:0
  10078. * Purpose: Time taken to delete peer, in msec,
  10079. * Used for monitoring / debugging PEER delete response delay
  10080. * - PEER_WDS_FREE_COUNT
  10081. * Bits 15:0
  10082. * Purpose: Count of WDS entries deleted associated to peer deleted
  10083. */
  10084. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10085. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10086. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10087. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10088. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10089. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10090. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10091. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10092. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10093. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10094. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10095. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10096. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10097. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10098. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10099. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10100. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10101. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10102. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10103. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10104. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10105. do { \
  10106. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10107. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10108. } while (0)
  10109. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10110. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10111. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10112. do { \
  10113. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10114. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10115. } while (0)
  10116. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10117. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10118. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10119. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10120. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10121. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10122. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10123. /**
  10124. * @brief target -> host rx peer mlo map message definition
  10125. *
  10126. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10127. *
  10128. * @details
  10129. * The following diagram shows the format of the rx mlo peer map message sent
  10130. * from the target to the host. This layout assumes the target operates
  10131. * as little-endian.
  10132. *
  10133. * MCC:
  10134. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10135. *
  10136. * WIN:
  10137. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10138. * It will be sent on the Assoc Link.
  10139. *
  10140. * This message always contains a MLO peer ID. The main purpose of the
  10141. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10142. * with, so that the host can use that MLO peer ID to determine which peer
  10143. * transmitted the rx frame.
  10144. *
  10145. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10146. * |-------------------------------------------------------------------------|
  10147. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10148. * |-------------------------------------------------------------------------|
  10149. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10150. * |-------------------------------------------------------------------------|
  10151. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10152. * |-------------------------------------------------------------------------|
  10153. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10154. * |-------------------------------------------------------------------------|
  10155. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10156. * |-------------------------------------------------------------------------|
  10157. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10158. * |-------------------------------------------------------------------------|
  10159. * |RSVD |
  10160. * |-------------------------------------------------------------------------|
  10161. * |RSVD |
  10162. * |-------------------------------------------------------------------------|
  10163. * | htt_tlv_hdr_t |
  10164. * |-------------------------------------------------------------------------|
  10165. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10166. * |-------------------------------------------------------------------------|
  10167. * | htt_tlv_hdr_t |
  10168. * |-------------------------------------------------------------------------|
  10169. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10170. * |-------------------------------------------------------------------------|
  10171. * | htt_tlv_hdr_t |
  10172. * |-------------------------------------------------------------------------|
  10173. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10174. * |-------------------------------------------------------------------------|
  10175. *
  10176. * Where:
  10177. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10178. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10179. * V (valid) - 1 Bit Bit17
  10180. * CHIPID - 3 Bits
  10181. * TIDMASK - 8 Bits
  10182. * CACHE_SET_NUM - 8 Bits
  10183. *
  10184. * The following field definitions describe the format of the rx MLO peer map
  10185. * messages sent from the target to the host.
  10186. * - MSG_TYPE
  10187. * Bits 7:0
  10188. * Purpose: identifies this as an rx mlo peer map message
  10189. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10190. *
  10191. * - MLO_PEER_ID
  10192. * Bits 23:8
  10193. * Purpose: The MLO peer ID (index).
  10194. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10195. * Value: MLO peer ID
  10196. *
  10197. * - NUMLINK
  10198. * Bits: 26:24 (3Bits)
  10199. * Purpose: Indicate the max number of logical links supported per client.
  10200. * Value: number of logical links
  10201. *
  10202. * - PRC
  10203. * Bits: 29:27 (3Bits)
  10204. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10205. * if there is migration of the primary chip.
  10206. * Value: Primary REO CHIPID
  10207. *
  10208. * - MAC_ADDR_L32
  10209. * Bits 31:0
  10210. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10211. * Value: lower 4 bytes of peer node's MAC address
  10212. *
  10213. * - MAC_ADDR_U16
  10214. * Bits 15:0
  10215. * Purpose: Identifies which peer node the peer ID is for.
  10216. * Value: upper 2 bytes of peer node's MAC address
  10217. *
  10218. * - PRIMARY_TCL_AST_IDX
  10219. * Bits 15:0
  10220. * Purpose: Primary TCL AST index for this peer.
  10221. *
  10222. * - V
  10223. * 1 Bit Position 16
  10224. * Purpose: If the ast idx is valid.
  10225. *
  10226. * - CHIPID
  10227. * Bits 19:17
  10228. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10229. *
  10230. * - TIDMASK
  10231. * Bits 27:20
  10232. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10233. *
  10234. * - CACHE_SET_NUM
  10235. * Bits 31:28
  10236. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10237. * Cache set number that should be used to cache the index based
  10238. * search results, for address and flow search.
  10239. * This value should be equal to LSB four bits of the hash value
  10240. * of match data, in case of search index points to an entry which
  10241. * may be used in content based search also. The value can be
  10242. * anything when the entry pointed by search index will not be
  10243. * used for content based search.
  10244. *
  10245. * - htt_tlv_hdr_t
  10246. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10247. *
  10248. * Bits 11:0
  10249. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10250. *
  10251. * Bits 23:12
  10252. * Purpose: Length, Length of the value that follows the header
  10253. *
  10254. * Bits 31:28
  10255. * Purpose: Reserved.
  10256. *
  10257. *
  10258. * - SW_PEER_ID
  10259. * Bits 15:0
  10260. * Purpose: The peer ID (index) that WAL is allocating
  10261. * Value: (rx) peer ID
  10262. *
  10263. * - VDEV_ID
  10264. * Bits 23:16
  10265. * Purpose: Indicates which virtual device the peer is associated with.
  10266. * Value: vdev ID (used in the host to look up the vdev object)
  10267. *
  10268. * - CHIPID
  10269. * Bits 26:24
  10270. * Purpose: Indicates which Chip id the peer is associated with.
  10271. * Value: chip ID (Provided by Host as part of QMI exchange)
  10272. */
  10273. typedef enum {
  10274. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10275. } MLO_PEER_MAP_TLV_TAG_ID;
  10276. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10277. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10278. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10279. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10280. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10281. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10282. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10283. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10284. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10285. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10286. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10287. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10288. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10289. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10290. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10291. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10292. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10293. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10294. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10295. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10296. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10297. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10298. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10299. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10300. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10301. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10302. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10303. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10304. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10305. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10306. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10307. do { \
  10308. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10309. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10310. } while (0)
  10311. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10312. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10313. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10314. do { \
  10315. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10316. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10317. } while (0)
  10318. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10319. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10320. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10321. do { \
  10322. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10323. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10324. } while (0)
  10325. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10326. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10327. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10328. do { \
  10329. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10330. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10331. } while (0)
  10332. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10333. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10334. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10335. do { \
  10336. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10337. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10338. } while (0)
  10339. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10340. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10341. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10342. do { \
  10343. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10344. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10345. } while (0)
  10346. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10347. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10348. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10349. do { \
  10350. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10351. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10352. } while (0)
  10353. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10354. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10355. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10356. do { \
  10357. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10358. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10359. } while (0)
  10360. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10361. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10362. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10363. do { \
  10364. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10365. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10366. } while (0)
  10367. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10368. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10369. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10370. do { \
  10371. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10372. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10373. } while (0)
  10374. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10375. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10376. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10377. do { \
  10378. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10379. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10380. } while (0)
  10381. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10382. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10383. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10384. do { \
  10385. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10386. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10387. } while (0)
  10388. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10389. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10390. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10391. do { \
  10392. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10393. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10394. } while (0)
  10395. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10396. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10397. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10398. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10399. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10400. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10401. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10402. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10403. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10404. *
  10405. * The following diagram shows the format of the rx mlo peer unmap message sent
  10406. * from the target to the host.
  10407. *
  10408. * |31 24|23 16|15 8|7 0|
  10409. * |-----------------------------------------------------------------------|
  10410. * | RSVD_24_31 | MLO peer ID | msg type |
  10411. * |-----------------------------------------------------------------------|
  10412. */
  10413. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10414. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10415. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10416. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10417. /**
  10418. * @brief target -> host message specifying security parameters
  10419. *
  10420. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10421. *
  10422. * @details
  10423. * The following diagram shows the format of the security specification
  10424. * message sent from the target to the host.
  10425. * This security specification message tells the host whether a PN check is
  10426. * necessary on rx data frames, and if so, how large the PN counter is.
  10427. * This message also tells the host about the security processing to apply
  10428. * to defragmented rx frames - specifically, whether a Message Integrity
  10429. * Check is required, and the Michael key to use.
  10430. *
  10431. * |31 24|23 16|15|14 8|7 0|
  10432. * |-----------------------------------------------------------------------|
  10433. * | peer ID | U| security type | msg type |
  10434. * |-----------------------------------------------------------------------|
  10435. * | Michael Key K0 |
  10436. * |-----------------------------------------------------------------------|
  10437. * | Michael Key K1 |
  10438. * |-----------------------------------------------------------------------|
  10439. * | WAPI RSC Low0 |
  10440. * |-----------------------------------------------------------------------|
  10441. * | WAPI RSC Low1 |
  10442. * |-----------------------------------------------------------------------|
  10443. * | WAPI RSC Hi0 |
  10444. * |-----------------------------------------------------------------------|
  10445. * | WAPI RSC Hi1 |
  10446. * |-----------------------------------------------------------------------|
  10447. *
  10448. * The following field definitions describe the format of the security
  10449. * indication message sent from the target to the host.
  10450. * - MSG_TYPE
  10451. * Bits 7:0
  10452. * Purpose: identifies this as a security specification message
  10453. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10454. * - SEC_TYPE
  10455. * Bits 14:8
  10456. * Purpose: specifies which type of security applies to the peer
  10457. * Value: htt_sec_type enum value
  10458. * - UNICAST
  10459. * Bit 15
  10460. * Purpose: whether this security is applied to unicast or multicast data
  10461. * Value: 1 -> unicast, 0 -> multicast
  10462. * - PEER_ID
  10463. * Bits 31:16
  10464. * Purpose: The ID number for the peer the security specification is for
  10465. * Value: peer ID
  10466. * - MICHAEL_KEY_K0
  10467. * Bits 31:0
  10468. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10469. * Value: Michael Key K0 (if security type is TKIP)
  10470. * - MICHAEL_KEY_K1
  10471. * Bits 31:0
  10472. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10473. * Value: Michael Key K1 (if security type is TKIP)
  10474. * - WAPI_RSC_LOW0
  10475. * Bits 31:0
  10476. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10477. * Value: WAPI RSC Low0 (if security type is WAPI)
  10478. * - WAPI_RSC_LOW1
  10479. * Bits 31:0
  10480. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10481. * Value: WAPI RSC Low1 (if security type is WAPI)
  10482. * - WAPI_RSC_HI0
  10483. * Bits 31:0
  10484. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10485. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10486. * - WAPI_RSC_HI1
  10487. * Bits 31:0
  10488. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10489. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10490. */
  10491. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10492. #define HTT_SEC_IND_SEC_TYPE_S 8
  10493. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10494. #define HTT_SEC_IND_UNICAST_S 15
  10495. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10496. #define HTT_SEC_IND_PEER_ID_S 16
  10497. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10498. do { \
  10499. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10500. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10501. } while (0)
  10502. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10503. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10504. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10505. do { \
  10506. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10507. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10508. } while (0)
  10509. #define HTT_SEC_IND_UNICAST_GET(word) \
  10510. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10511. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10512. do { \
  10513. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10514. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10515. } while (0)
  10516. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10517. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10518. #define HTT_SEC_IND_BYTES 28
  10519. /**
  10520. * @brief target -> host rx ADDBA / DELBA message definitions
  10521. *
  10522. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10523. *
  10524. * @details
  10525. * The following diagram shows the format of the rx ADDBA message sent
  10526. * from the target to the host:
  10527. *
  10528. * |31 20|19 16|15 8|7 0|
  10529. * |---------------------------------------------------------------------|
  10530. * | peer ID | TID | window size | msg type |
  10531. * |---------------------------------------------------------------------|
  10532. *
  10533. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10534. *
  10535. * The following diagram shows the format of the rx DELBA message sent
  10536. * from the target to the host:
  10537. *
  10538. * |31 20|19 16|15 10|9 8|7 0|
  10539. * |---------------------------------------------------------------------|
  10540. * | peer ID | TID | window size | IR| msg type |
  10541. * |---------------------------------------------------------------------|
  10542. *
  10543. * The following field definitions describe the format of the rx ADDBA
  10544. * and DELBA messages sent from the target to the host.
  10545. * - MSG_TYPE
  10546. * Bits 7:0
  10547. * Purpose: identifies this as an rx ADDBA or DELBA message
  10548. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10549. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10550. * - IR (initiator / recipient)
  10551. * Bits 9:8 (DELBA only)
  10552. * Purpose: specify whether the DELBA handshake was initiated by the
  10553. * local STA/AP, or by the peer STA/AP
  10554. * Value:
  10555. * 0 - unspecified
  10556. * 1 - initiator (a.k.a. originator)
  10557. * 2 - recipient (a.k.a. responder)
  10558. * 3 - unused / reserved
  10559. * - WIN_SIZE
  10560. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10561. * Purpose: Specifies the length of the block ack window (max = 64).
  10562. * Value:
  10563. * block ack window length specified by the received ADDBA/DELBA
  10564. * management message.
  10565. * - TID
  10566. * Bits 19:16
  10567. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10568. * Value:
  10569. * TID specified by the received ADDBA or DELBA management message.
  10570. * - PEER_ID
  10571. * Bits 31:20
  10572. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10573. * Value:
  10574. * ID (hash value) used by the host for fast, direct lookup of
  10575. * host SW peer info, including rx reorder states.
  10576. */
  10577. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10578. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10579. #define HTT_RX_ADDBA_TID_M 0xf0000
  10580. #define HTT_RX_ADDBA_TID_S 16
  10581. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10582. #define HTT_RX_ADDBA_PEER_ID_S 20
  10583. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10584. do { \
  10585. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10586. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10587. } while (0)
  10588. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10589. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10590. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10591. do { \
  10592. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10593. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10594. } while (0)
  10595. #define HTT_RX_ADDBA_TID_GET(word) \
  10596. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10597. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10598. do { \
  10599. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10600. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10601. } while (0)
  10602. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10603. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10604. #define HTT_RX_ADDBA_BYTES 4
  10605. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10606. #define HTT_RX_DELBA_INITIATOR_S 8
  10607. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10608. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10609. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10610. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10611. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10612. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10613. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10614. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10615. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10616. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10617. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10618. do { \
  10619. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10620. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10621. } while (0)
  10622. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10623. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10624. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10625. do { \
  10626. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10627. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10628. } while (0)
  10629. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10630. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10631. #define HTT_RX_DELBA_BYTES 4
  10632. /**
  10633. * @brief tx queue group information element definition
  10634. *
  10635. * @details
  10636. * The following diagram shows the format of the tx queue group
  10637. * information element, which can be included in target --> host
  10638. * messages to specify the number of tx "credits" (tx descriptors
  10639. * for LL, or tx buffers for HL) available to a particular group
  10640. * of host-side tx queues, and which host-side tx queues belong to
  10641. * the group.
  10642. *
  10643. * |31|30 24|23 16|15|14|13 0|
  10644. * |------------------------------------------------------------------------|
  10645. * | X| reserved | tx queue grp ID | A| S| credit count |
  10646. * |------------------------------------------------------------------------|
  10647. * | vdev ID mask | AC mask |
  10648. * |------------------------------------------------------------------------|
  10649. *
  10650. * The following definitions describe the fields within the tx queue group
  10651. * information element:
  10652. * - credit_count
  10653. * Bits 13:1
  10654. * Purpose: specify how many tx credits are available to the tx queue group
  10655. * Value: An absolute or relative, positive or negative credit value
  10656. * The 'A' bit specifies whether the value is absolute or relative.
  10657. * The 'S' bit specifies whether the value is positive or negative.
  10658. * A negative value can only be relative, not absolute.
  10659. * An absolute value replaces any prior credit value the host has for
  10660. * the tx queue group in question.
  10661. * A relative value is added to the prior credit value the host has for
  10662. * the tx queue group in question.
  10663. * - sign
  10664. * Bit 14
  10665. * Purpose: specify whether the credit count is positive or negative
  10666. * Value: 0 -> positive, 1 -> negative
  10667. * - absolute
  10668. * Bit 15
  10669. * Purpose: specify whether the credit count is absolute or relative
  10670. * Value: 0 -> relative, 1 -> absolute
  10671. * - txq_group_id
  10672. * Bits 23:16
  10673. * Purpose: indicate which tx queue group's credit and/or membership are
  10674. * being specified
  10675. * Value: 0 to max_tx_queue_groups-1
  10676. * - reserved
  10677. * Bits 30:16
  10678. * Value: 0x0
  10679. * - eXtension
  10680. * Bit 31
  10681. * Purpose: specify whether another tx queue group info element follows
  10682. * Value: 0 -> no more tx queue group information elements
  10683. * 1 -> another tx queue group information element immediately follows
  10684. * - ac_mask
  10685. * Bits 15:0
  10686. * Purpose: specify which Access Categories belong to the tx queue group
  10687. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10688. * the tx queue group.
  10689. * The AC bit-mask values are obtained by left-shifting by the
  10690. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10691. * - vdev_id_mask
  10692. * Bits 31:16
  10693. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10694. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10695. * belong to the tx queue group.
  10696. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10697. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10698. */
  10699. PREPACK struct htt_txq_group {
  10700. A_UINT32
  10701. credit_count: 14,
  10702. sign: 1,
  10703. absolute: 1,
  10704. tx_queue_group_id: 8,
  10705. reserved0: 7,
  10706. extension: 1;
  10707. A_UINT32
  10708. ac_mask: 16,
  10709. vdev_id_mask: 16;
  10710. } POSTPACK;
  10711. /* first word */
  10712. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10713. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10714. #define HTT_TXQ_GROUP_SIGN_S 14
  10715. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10716. #define HTT_TXQ_GROUP_ABS_S 15
  10717. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10718. #define HTT_TXQ_GROUP_ID_S 16
  10719. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10720. #define HTT_TXQ_GROUP_EXT_S 31
  10721. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10722. /* second word */
  10723. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10724. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10725. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10726. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10727. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10728. do { \
  10729. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10730. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10731. } while (0)
  10732. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10733. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10734. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10735. do { \
  10736. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10737. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10738. } while (0)
  10739. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10740. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10741. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10742. do { \
  10743. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10744. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10745. } while (0)
  10746. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10747. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10748. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10749. do { \
  10750. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10751. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10752. } while (0)
  10753. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10754. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10755. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10756. do { \
  10757. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10758. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10759. } while (0)
  10760. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10761. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10762. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10763. do { \
  10764. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10765. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10766. } while (0)
  10767. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10768. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10769. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10770. do { \
  10771. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10772. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10773. } while (0)
  10774. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10775. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10776. /**
  10777. * @brief target -> host TX completion indication message definition
  10778. *
  10779. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10780. *
  10781. * @details
  10782. * The following diagram shows the format of the TX completion indication sent
  10783. * from the target to the host
  10784. *
  10785. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10786. * |-------------------------------------------------------------------|
  10787. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10788. * |-------------------------------------------------------------------|
  10789. * payload:| MSDU1 ID | MSDU0 ID |
  10790. * |-------------------------------------------------------------------|
  10791. * : MSDU3 ID | MSDU2 ID :
  10792. * |-------------------------------------------------------------------|
  10793. * | struct htt_tx_compl_ind_append_retries |
  10794. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10795. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10796. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10797. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10798. * |-------------------------------------------------------------------|
  10799. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10800. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10801. * | MSDU0 tx_tsf64_low |
  10802. * |-------------------------------------------------------------------|
  10803. * | MSDU0 tx_tsf64_high |
  10804. * |-------------------------------------------------------------------|
  10805. * | MSDU1 tx_tsf64_low |
  10806. * |-------------------------------------------------------------------|
  10807. * | MSDU1 tx_tsf64_high |
  10808. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10809. * | phy_timestamp |
  10810. * |-------------------------------------------------------------------|
  10811. * | rate specs (see below) |
  10812. * |-------------------------------------------------------------------|
  10813. * | seqctrl | framectrl |
  10814. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10815. * Where:
  10816. * A0 = append (a.k.a. append0)
  10817. * A1 = append1
  10818. * TP = MSDU tx power presence
  10819. * A2 = append2
  10820. * A3 = append3
  10821. * A4 = append4
  10822. *
  10823. * The following field definitions describe the format of the TX completion
  10824. * indication sent from the target to the host
  10825. * Header fields:
  10826. * - msg_type
  10827. * Bits 7:0
  10828. * Purpose: identifies this as HTT TX completion indication
  10829. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10830. * - status
  10831. * Bits 10:8
  10832. * Purpose: the TX completion status of payload fragmentations descriptors
  10833. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10834. * - tid
  10835. * Bits 14:11
  10836. * Purpose: the tid associated with those fragmentation descriptors. It is
  10837. * valid or not, depending on the tid_invalid bit.
  10838. * Value: 0 to 15
  10839. * - tid_invalid
  10840. * Bits 15:15
  10841. * Purpose: this bit indicates whether the tid field is valid or not
  10842. * Value: 0 indicates valid; 1 indicates invalid
  10843. * - num
  10844. * Bits 23:16
  10845. * Purpose: the number of payload in this indication
  10846. * Value: 1 to 255
  10847. * - append (a.k.a. append0)
  10848. * Bits 24:24
  10849. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10850. * the number of tx retries for one MSDU at the end of this message
  10851. * Value: 0 indicates no appending; 1 indicates appending
  10852. * - append1
  10853. * Bits 25:25
  10854. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10855. * contains the timestamp info for each TX msdu id in payload.
  10856. * The order of the timestamps matches the order of the MSDU IDs.
  10857. * Note that a big-endian host needs to account for the reordering
  10858. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10859. * conversion) when determining which tx timestamp corresponds to
  10860. * which MSDU ID.
  10861. * Value: 0 indicates no appending; 1 indicates appending
  10862. * - msdu_tx_power_presence
  10863. * Bits 26:26
  10864. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10865. * for each MSDU referenced by the TX_COMPL_IND message.
  10866. * The tx power is reported in 0.5 dBm units.
  10867. * The order of the per-MSDU tx power reports matches the order
  10868. * of the MSDU IDs.
  10869. * Note that a big-endian host needs to account for the reordering
  10870. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10871. * conversion) when determining which Tx Power corresponds to
  10872. * which MSDU ID.
  10873. * Value: 0 indicates MSDU tx power reports are not appended,
  10874. * 1 indicates MSDU tx power reports are appended
  10875. * - append2
  10876. * Bits 27:27
  10877. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10878. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10879. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10880. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10881. * for each MSDU, for convenience.
  10882. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10883. * this append2 bit is set).
  10884. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10885. * dB above the noise floor.
  10886. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10887. * 1 indicates MSDU ACK RSSI values are appended.
  10888. * - append3
  10889. * Bits 28:28
  10890. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10891. * contains the tx tsf info based on wlan global TSF for
  10892. * each TX msdu id in payload.
  10893. * The order of the tx tsf matches the order of the MSDU IDs.
  10894. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10895. * values to indicate the the lower 32 bits and higher 32 bits of
  10896. * the tx tsf.
  10897. * The tx_tsf64 here represents the time MSDU was acked and the
  10898. * tx_tsf64 has microseconds units.
  10899. * Value: 0 indicates no appending; 1 indicates appending
  10900. * - append4
  10901. * Bits 29:29
  10902. * Purpose: Indicate whether data frame control fields and fields required
  10903. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10904. * message. The order of the this message matches the order of
  10905. * the MSDU IDs.
  10906. * Value: 0 indicates frame control fields and fields required for
  10907. * radio tap header values are not appended,
  10908. * 1 indicates frame control fields and fields required for
  10909. * radio tap header values are appended.
  10910. * Payload fields:
  10911. * - hmsdu_id
  10912. * Bits 15:0
  10913. * Purpose: this ID is used to track the Tx buffer in host
  10914. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10915. */
  10916. PREPACK struct htt_tx_data_hdr_information {
  10917. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10918. A_UINT32 /* word 1 */
  10919. /* preamble:
  10920. * 0-OFDM,
  10921. * 1-CCk,
  10922. * 2-HT,
  10923. * 3-VHT
  10924. */
  10925. preamble: 2, /* [1:0] */
  10926. /* mcs:
  10927. * In case of HT preamble interpret
  10928. * MCS along with NSS.
  10929. * Valid values for HT are 0 to 7.
  10930. * HT mcs 0 with NSS 2 is mcs 8.
  10931. * Valid values for VHT are 0 to 9.
  10932. */
  10933. mcs: 4, /* [5:2] */
  10934. /* rate:
  10935. * This is applicable only for
  10936. * CCK and OFDM preamble type
  10937. * rate 0: OFDM 48 Mbps,
  10938. * 1: OFDM 24 Mbps,
  10939. * 2: OFDM 12 Mbps
  10940. * 3: OFDM 6 Mbps
  10941. * 4: OFDM 54 Mbps
  10942. * 5: OFDM 36 Mbps
  10943. * 6: OFDM 18 Mbps
  10944. * 7: OFDM 9 Mbps
  10945. * rate 0: CCK 11 Mbps Long
  10946. * 1: CCK 5.5 Mbps Long
  10947. * 2: CCK 2 Mbps Long
  10948. * 3: CCK 1 Mbps Long
  10949. * 4: CCK 11 Mbps Short
  10950. * 5: CCK 5.5 Mbps Short
  10951. * 6: CCK 2 Mbps Short
  10952. */
  10953. rate : 3, /* [ 8: 6] */
  10954. rssi : 8, /* [16: 9] units=dBm */
  10955. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10956. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10957. stbc : 1, /* [22] */
  10958. sgi : 1, /* [23] */
  10959. ldpc : 1, /* [24] */
  10960. beamformed: 1, /* [25] */
  10961. /* tx_retry_cnt:
  10962. * Indicates retry count of data tx frames provided by the host.
  10963. */
  10964. tx_retry_cnt: 6; /* [31:26] */
  10965. A_UINT32 /* word 2 */
  10966. framectrl:16, /* [15: 0] */
  10967. seqno:16; /* [31:16] */
  10968. } POSTPACK;
  10969. #define HTT_TX_COMPL_IND_STATUS_S 8
  10970. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10971. #define HTT_TX_COMPL_IND_TID_S 11
  10972. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10973. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10974. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10975. #define HTT_TX_COMPL_IND_NUM_S 16
  10976. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10977. #define HTT_TX_COMPL_IND_APPEND_S 24
  10978. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10979. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10980. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10981. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10982. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10983. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10984. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10985. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10986. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10987. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10988. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10989. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10990. do { \
  10991. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10992. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10993. } while (0)
  10994. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10995. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10996. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10997. do { \
  10998. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  10999. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11000. } while (0)
  11001. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11002. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11003. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11004. do { \
  11005. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11006. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11007. } while (0)
  11008. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11009. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11010. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11011. do { \
  11012. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11013. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11014. } while (0)
  11015. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11016. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11017. HTT_TX_COMPL_IND_TID_INV_S)
  11018. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11019. do { \
  11020. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11021. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11022. } while (0)
  11023. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11024. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11025. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11026. do { \
  11027. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11028. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11029. } while (0)
  11030. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11031. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11032. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11033. do { \
  11034. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11035. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11036. } while (0)
  11037. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11038. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11039. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11040. do { \
  11041. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11042. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11043. } while (0)
  11044. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11045. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11046. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11047. do { \
  11048. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11049. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11050. } while (0)
  11051. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11052. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11053. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11054. do { \
  11055. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11056. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11057. } while (0)
  11058. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11059. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11060. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11061. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11062. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11063. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11064. #define HTT_TX_COMPL_IND_STAT_OK 0
  11065. /* DISCARD:
  11066. * current meaning:
  11067. * MSDUs were queued for transmission but filtered by HW or SW
  11068. * without any over the air attempts
  11069. * legacy meaning (HL Rome):
  11070. * MSDUs were discarded by the target FW without any over the air
  11071. * attempts due to lack of space
  11072. */
  11073. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11074. /* NO_ACK:
  11075. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11076. */
  11077. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11078. /* POSTPONE:
  11079. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11080. * be downloaded again later (in the appropriate order), when they are
  11081. * deliverable.
  11082. */
  11083. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11084. /*
  11085. * The PEER_DEL tx completion status is used for HL cases
  11086. * where the peer the frame is for has been deleted.
  11087. * The host has already discarded its copy of the frame, but
  11088. * it still needs the tx completion to restore its credit.
  11089. */
  11090. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11091. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11092. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11093. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11094. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11095. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11096. PREPACK struct htt_tx_compl_ind_base {
  11097. A_UINT32 hdr;
  11098. A_UINT16 payload[1/*or more*/];
  11099. } POSTPACK;
  11100. PREPACK struct htt_tx_compl_ind_append_retries {
  11101. A_UINT16 msdu_id;
  11102. A_UINT8 tx_retries;
  11103. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11104. 0: this is the last append_retries struct */
  11105. } POSTPACK;
  11106. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11107. A_UINT32 timestamp[1/*or more*/];
  11108. } POSTPACK;
  11109. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11110. A_UINT32 tx_tsf64_low;
  11111. A_UINT32 tx_tsf64_high;
  11112. } POSTPACK;
  11113. /* htt_tx_data_hdr_information payload extension fields: */
  11114. /* DWORD zero */
  11115. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11116. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11117. /* DWORD one */
  11118. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11119. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11120. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11121. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11122. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11123. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11124. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11125. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11126. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11127. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11128. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11129. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11130. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11131. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11132. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11133. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11134. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11135. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11136. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11137. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11138. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11139. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11140. /* DWORD two */
  11141. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11142. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11143. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11144. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11145. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11146. do { \
  11147. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11148. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11149. } while (0)
  11150. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11151. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11152. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11153. do { \
  11154. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11155. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11156. } while (0)
  11157. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11158. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11159. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11160. do { \
  11161. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11162. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11163. } while (0)
  11164. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11165. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11166. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11167. do { \
  11168. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11169. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11170. } while (0)
  11171. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11172. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11173. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11174. do { \
  11175. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11176. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11177. } while (0)
  11178. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11179. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11180. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11181. do { \
  11182. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11183. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11184. } while (0)
  11185. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11186. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11187. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11188. do { \
  11189. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11190. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11191. } while (0)
  11192. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11193. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11194. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11195. do { \
  11196. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11197. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11198. } while (0)
  11199. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11200. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11201. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11202. do { \
  11203. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11204. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11205. } while (0)
  11206. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11207. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11208. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11209. do { \
  11210. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11211. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11212. } while (0)
  11213. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11214. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11215. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11216. do { \
  11217. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11218. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11219. } while (0)
  11220. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11221. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11222. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11223. do { \
  11224. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11225. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11226. } while (0)
  11227. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11228. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11229. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11230. do { \
  11231. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11232. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11233. } while (0)
  11234. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11235. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11236. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11237. do { \
  11238. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11239. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11240. } while (0)
  11241. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11242. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11243. /**
  11244. * @brief target -> host rate-control update indication message
  11245. *
  11246. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11247. *
  11248. * @details
  11249. * The following diagram shows the format of the RC Update message
  11250. * sent from the target to the host, while processing the tx-completion
  11251. * of a transmitted PPDU.
  11252. *
  11253. * |31 24|23 16|15 8|7 0|
  11254. * |-------------------------------------------------------------|
  11255. * | peer ID | vdev ID | msg_type |
  11256. * |-------------------------------------------------------------|
  11257. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11258. * |-------------------------------------------------------------|
  11259. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11260. * |-------------------------------------------------------------|
  11261. * | : |
  11262. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11263. * | : |
  11264. * |-------------------------------------------------------------|
  11265. * | : |
  11266. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11267. * | : |
  11268. * |-------------------------------------------------------------|
  11269. * : :
  11270. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11271. *
  11272. */
  11273. typedef struct {
  11274. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11275. A_UINT32 rate_code_flags;
  11276. A_UINT32 flags; /* Encodes information such as excessive
  11277. retransmission, aggregate, some info
  11278. from .11 frame control,
  11279. STBC, LDPC, (SGI and Tx Chain Mask
  11280. are encoded in ptx_rc->flags field),
  11281. AMPDU truncation (BT/time based etc.),
  11282. RTS/CTS attempt */
  11283. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11284. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11285. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11286. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11287. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11288. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11289. } HTT_RC_TX_DONE_PARAMS;
  11290. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11291. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11292. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11293. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11294. #define HTT_RC_UPDATE_VDEVID_S 8
  11295. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11296. #define HTT_RC_UPDATE_PEERID_S 16
  11297. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11298. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11299. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11300. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11301. do { \
  11302. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11303. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11304. } while (0)
  11305. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11306. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11307. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11308. do { \
  11309. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11310. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11311. } while (0)
  11312. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11313. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11314. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11315. do { \
  11316. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11317. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11318. } while (0)
  11319. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11320. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11321. /**
  11322. * @brief target -> host rx fragment indication message definition
  11323. *
  11324. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11325. *
  11326. * @details
  11327. * The following field definitions describe the format of the rx fragment
  11328. * indication message sent from the target to the host.
  11329. * The rx fragment indication message shares the format of the
  11330. * rx indication message, but not all fields from the rx indication message
  11331. * are relevant to the rx fragment indication message.
  11332. *
  11333. *
  11334. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11335. * |-----------+-------------------+---------------------+-------------|
  11336. * | peer ID | |FV| ext TID | msg type |
  11337. * |-------------------------------------------------------------------|
  11338. * | | flush | flush |
  11339. * | | end | start |
  11340. * | | seq num | seq num |
  11341. * |-------------------------------------------------------------------|
  11342. * | reserved | FW rx desc bytes |
  11343. * |-------------------------------------------------------------------|
  11344. * | | FW MSDU Rx |
  11345. * | | desc B0 |
  11346. * |-------------------------------------------------------------------|
  11347. * Header fields:
  11348. * - MSG_TYPE
  11349. * Bits 7:0
  11350. * Purpose: identifies this as an rx fragment indication message
  11351. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11352. * - EXT_TID
  11353. * Bits 12:8
  11354. * Purpose: identify the traffic ID of the rx data, including
  11355. * special "extended" TID values for multicast, broadcast, and
  11356. * non-QoS data frames
  11357. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11358. * - FLUSH_VALID (FV)
  11359. * Bit 13
  11360. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11361. * is valid
  11362. * Value:
  11363. * 1 -> flush IE is valid and needs to be processed
  11364. * 0 -> flush IE is not valid and should be ignored
  11365. * - PEER_ID
  11366. * Bits 31:16
  11367. * Purpose: Identify, by ID, which peer sent the rx data
  11368. * Value: ID of the peer who sent the rx data
  11369. * - FLUSH_SEQ_NUM_START
  11370. * Bits 5:0
  11371. * Purpose: Indicate the start of a series of MPDUs to flush
  11372. * Not all MPDUs within this series are necessarily valid - the host
  11373. * must check each sequence number within this range to see if the
  11374. * corresponding MPDU is actually present.
  11375. * This field is only valid if the FV bit is set.
  11376. * Value:
  11377. * The sequence number for the first MPDUs to check to flush.
  11378. * The sequence number is masked by 0x3f.
  11379. * - FLUSH_SEQ_NUM_END
  11380. * Bits 11:6
  11381. * Purpose: Indicate the end of a series of MPDUs to flush
  11382. * Value:
  11383. * The sequence number one larger than the sequence number of the
  11384. * last MPDU to check to flush.
  11385. * The sequence number is masked by 0x3f.
  11386. * Not all MPDUs within this series are necessarily valid - the host
  11387. * must check each sequence number within this range to see if the
  11388. * corresponding MPDU is actually present.
  11389. * This field is only valid if the FV bit is set.
  11390. * Rx descriptor fields:
  11391. * - FW_RX_DESC_BYTES
  11392. * Bits 15:0
  11393. * Purpose: Indicate how many bytes in the Rx indication are used for
  11394. * FW Rx descriptors
  11395. * Value: 1
  11396. */
  11397. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11398. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11399. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11400. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11401. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11402. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11403. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11404. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11405. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11406. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11407. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11408. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11409. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11410. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11411. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11412. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11413. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11414. #define HTT_RX_FRAG_IND_BYTES \
  11415. (4 /* msg hdr */ + \
  11416. 4 /* flush spec */ + \
  11417. 4 /* (unused) FW rx desc bytes spec */ + \
  11418. 4 /* FW rx desc */)
  11419. /**
  11420. * @brief target -> host test message definition
  11421. *
  11422. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11423. *
  11424. * @details
  11425. * The following field definitions describe the format of the test
  11426. * message sent from the target to the host.
  11427. * The message consists of a 4-octet header, followed by a variable
  11428. * number of 32-bit integer values, followed by a variable number
  11429. * of 8-bit character values.
  11430. *
  11431. * |31 16|15 8|7 0|
  11432. * |-----------------------------------------------------------|
  11433. * | num chars | num ints | msg type |
  11434. * |-----------------------------------------------------------|
  11435. * | int 0 |
  11436. * |-----------------------------------------------------------|
  11437. * | int 1 |
  11438. * |-----------------------------------------------------------|
  11439. * | ... |
  11440. * |-----------------------------------------------------------|
  11441. * | char 3 | char 2 | char 1 | char 0 |
  11442. * |-----------------------------------------------------------|
  11443. * | | | ... | char 4 |
  11444. * |-----------------------------------------------------------|
  11445. * - MSG_TYPE
  11446. * Bits 7:0
  11447. * Purpose: identifies this as a test message
  11448. * Value: HTT_MSG_TYPE_TEST
  11449. * - NUM_INTS
  11450. * Bits 15:8
  11451. * Purpose: indicate how many 32-bit integers follow the message header
  11452. * - NUM_CHARS
  11453. * Bits 31:16
  11454. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11455. */
  11456. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11457. #define HTT_RX_TEST_NUM_INTS_S 8
  11458. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11459. #define HTT_RX_TEST_NUM_CHARS_S 16
  11460. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11461. do { \
  11462. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11463. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11464. } while (0)
  11465. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11466. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11467. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11468. do { \
  11469. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11470. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11471. } while (0)
  11472. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11473. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11474. /**
  11475. * @brief target -> host packet log message
  11476. *
  11477. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11478. *
  11479. * @details
  11480. * The following field definitions describe the format of the packet log
  11481. * message sent from the target to the host.
  11482. * The message consists of a 4-octet header,followed by a variable number
  11483. * of 32-bit character values.
  11484. *
  11485. * |31 16|15 12|11 10|9 8|7 0|
  11486. * |------------------------------------------------------------------|
  11487. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11488. * |------------------------------------------------------------------|
  11489. * | payload |
  11490. * |------------------------------------------------------------------|
  11491. * - MSG_TYPE
  11492. * Bits 7:0
  11493. * Purpose: identifies this as a pktlog message
  11494. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11495. * - mac_id
  11496. * Bits 9:8
  11497. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11498. * Value: 0-3
  11499. * - pdev_id
  11500. * Bits 11:10
  11501. * Purpose: pdev_id
  11502. * Value: 0-3
  11503. * 0 (for rings at SOC level),
  11504. * 1/2/3 PDEV -> 0/1/2
  11505. * - payload_size
  11506. * Bits 31:16
  11507. * Purpose: explicitly specify the payload size
  11508. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11509. */
  11510. PREPACK struct htt_pktlog_msg {
  11511. A_UINT32 header;
  11512. A_UINT32 payload[1/* or more */];
  11513. } POSTPACK;
  11514. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11515. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11516. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11517. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11518. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11519. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11520. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11521. do { \
  11522. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11523. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11524. } while (0)
  11525. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11526. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11527. HTT_T2H_PKTLOG_MAC_ID_S)
  11528. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11529. do { \
  11530. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11531. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11532. } while (0)
  11533. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11534. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11535. HTT_T2H_PKTLOG_PDEV_ID_S)
  11536. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11537. do { \
  11538. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11539. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11540. } while (0)
  11541. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11542. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11543. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11544. /*
  11545. * Rx reorder statistics
  11546. * NB: all the fields must be defined in 4 octets size.
  11547. */
  11548. struct rx_reorder_stats {
  11549. /* Non QoS MPDUs received */
  11550. A_UINT32 deliver_non_qos;
  11551. /* MPDUs received in-order */
  11552. A_UINT32 deliver_in_order;
  11553. /* Flush due to reorder timer expired */
  11554. A_UINT32 deliver_flush_timeout;
  11555. /* Flush due to move out of window */
  11556. A_UINT32 deliver_flush_oow;
  11557. /* Flush due to DELBA */
  11558. A_UINT32 deliver_flush_delba;
  11559. /* MPDUs dropped due to FCS error */
  11560. A_UINT32 fcs_error;
  11561. /* MPDUs dropped due to monitor mode non-data packet */
  11562. A_UINT32 mgmt_ctrl;
  11563. /* Unicast-data MPDUs dropped due to invalid peer */
  11564. A_UINT32 invalid_peer;
  11565. /* MPDUs dropped due to duplication (non aggregation) */
  11566. A_UINT32 dup_non_aggr;
  11567. /* MPDUs dropped due to processed before */
  11568. A_UINT32 dup_past;
  11569. /* MPDUs dropped due to duplicate in reorder queue */
  11570. A_UINT32 dup_in_reorder;
  11571. /* Reorder timeout happened */
  11572. A_UINT32 reorder_timeout;
  11573. /* invalid bar ssn */
  11574. A_UINT32 invalid_bar_ssn;
  11575. /* reorder reset due to bar ssn */
  11576. A_UINT32 ssn_reset;
  11577. /* Flush due to delete peer */
  11578. A_UINT32 deliver_flush_delpeer;
  11579. /* Flush due to offload*/
  11580. A_UINT32 deliver_flush_offload;
  11581. /* Flush due to out of buffer*/
  11582. A_UINT32 deliver_flush_oob;
  11583. /* MPDUs dropped due to PN check fail */
  11584. A_UINT32 pn_fail;
  11585. /* MPDUs dropped due to unable to allocate memory */
  11586. A_UINT32 store_fail;
  11587. /* Number of times the tid pool alloc succeeded */
  11588. A_UINT32 tid_pool_alloc_succ;
  11589. /* Number of times the MPDU pool alloc succeeded */
  11590. A_UINT32 mpdu_pool_alloc_succ;
  11591. /* Number of times the MSDU pool alloc succeeded */
  11592. A_UINT32 msdu_pool_alloc_succ;
  11593. /* Number of times the tid pool alloc failed */
  11594. A_UINT32 tid_pool_alloc_fail;
  11595. /* Number of times the MPDU pool alloc failed */
  11596. A_UINT32 mpdu_pool_alloc_fail;
  11597. /* Number of times the MSDU pool alloc failed */
  11598. A_UINT32 msdu_pool_alloc_fail;
  11599. /* Number of times the tid pool freed */
  11600. A_UINT32 tid_pool_free;
  11601. /* Number of times the MPDU pool freed */
  11602. A_UINT32 mpdu_pool_free;
  11603. /* Number of times the MSDU pool freed */
  11604. A_UINT32 msdu_pool_free;
  11605. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11606. A_UINT32 msdu_queued;
  11607. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11608. A_UINT32 msdu_recycled;
  11609. /* Number of MPDUs with invalid peer but A2 found in AST */
  11610. A_UINT32 invalid_peer_a2_in_ast;
  11611. /* Number of MPDUs with invalid peer but A3 found in AST */
  11612. A_UINT32 invalid_peer_a3_in_ast;
  11613. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11614. A_UINT32 invalid_peer_bmc_mpdus;
  11615. /* Number of MSDUs with err attention word */
  11616. A_UINT32 rxdesc_err_att;
  11617. /* Number of MSDUs with flag of peer_idx_invalid */
  11618. A_UINT32 rxdesc_err_peer_idx_inv;
  11619. /* Number of MSDUs with flag of peer_idx_timeout */
  11620. A_UINT32 rxdesc_err_peer_idx_to;
  11621. /* Number of MSDUs with flag of overflow */
  11622. A_UINT32 rxdesc_err_ov;
  11623. /* Number of MSDUs with flag of msdu_length_err */
  11624. A_UINT32 rxdesc_err_msdu_len;
  11625. /* Number of MSDUs with flag of mpdu_length_err */
  11626. A_UINT32 rxdesc_err_mpdu_len;
  11627. /* Number of MSDUs with flag of tkip_mic_err */
  11628. A_UINT32 rxdesc_err_tkip_mic;
  11629. /* Number of MSDUs with flag of decrypt_err */
  11630. A_UINT32 rxdesc_err_decrypt;
  11631. /* Number of MSDUs with flag of fcs_err */
  11632. A_UINT32 rxdesc_err_fcs;
  11633. /* Number of Unicast (bc_mc bit is not set in attention word)
  11634. * frames with invalid peer handler
  11635. */
  11636. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11637. /* Number of unicast frame directly (direct bit is set in attention word)
  11638. * to DUT with invalid peer handler
  11639. */
  11640. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11641. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11642. * frames with invalid peer handler
  11643. */
  11644. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11645. /* Number of MSDUs dropped due to no first MSDU flag */
  11646. A_UINT32 rxdesc_no_1st_msdu;
  11647. /* Number of MSDUs droped due to ring overflow */
  11648. A_UINT32 msdu_drop_ring_ov;
  11649. /* Number of MSDUs dropped due to FC mismatch */
  11650. A_UINT32 msdu_drop_fc_mismatch;
  11651. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11652. A_UINT32 msdu_drop_mgmt_remote_ring;
  11653. /* Number of MSDUs dropped due to errors not reported in attention word */
  11654. A_UINT32 msdu_drop_misc;
  11655. /* Number of MSDUs go to offload before reorder */
  11656. A_UINT32 offload_msdu_wal;
  11657. /* Number of data frame dropped by offload after reorder */
  11658. A_UINT32 offload_msdu_reorder;
  11659. /* Number of MPDUs with sequence number in the past and within the BA window */
  11660. A_UINT32 dup_past_within_window;
  11661. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11662. A_UINT32 dup_past_outside_window;
  11663. /* Number of MSDUs with decrypt/MIC error */
  11664. A_UINT32 rxdesc_err_decrypt_mic;
  11665. /* Number of data MSDUs received on both local and remote rings */
  11666. A_UINT32 data_msdus_on_both_rings;
  11667. /* MPDUs never filled */
  11668. A_UINT32 holes_not_filled;
  11669. };
  11670. /*
  11671. * Rx Remote buffer statistics
  11672. * NB: all the fields must be defined in 4 octets size.
  11673. */
  11674. struct rx_remote_buffer_mgmt_stats {
  11675. /* Total number of MSDUs reaped for Rx processing */
  11676. A_UINT32 remote_reaped;
  11677. /* MSDUs recycled within firmware */
  11678. A_UINT32 remote_recycled;
  11679. /* MSDUs stored by Data Rx */
  11680. A_UINT32 data_rx_msdus_stored;
  11681. /* Number of HTT indications from WAL Rx MSDU */
  11682. A_UINT32 wal_rx_ind;
  11683. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11684. A_UINT32 wal_rx_ind_unconsumed;
  11685. /* Number of HTT indications from Data Rx MSDU */
  11686. A_UINT32 data_rx_ind;
  11687. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11688. A_UINT32 data_rx_ind_unconsumed;
  11689. /* Number of HTT indications from ATHBUF */
  11690. A_UINT32 athbuf_rx_ind;
  11691. /* Number of remote buffers requested for refill */
  11692. A_UINT32 refill_buf_req;
  11693. /* Number of remote buffers filled by the host */
  11694. A_UINT32 refill_buf_rsp;
  11695. /* Number of times MAC hw_index = f/w write_index */
  11696. A_INT32 mac_no_bufs;
  11697. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11698. A_INT32 fw_indices_equal;
  11699. /* Number of times f/w finds no buffers to post */
  11700. A_INT32 host_no_bufs;
  11701. };
  11702. /*
  11703. * TXBF MU/SU packets and NDPA statistics
  11704. * NB: all the fields must be defined in 4 octets size.
  11705. */
  11706. struct rx_txbf_musu_ndpa_pkts_stats {
  11707. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11708. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11709. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11710. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11711. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11712. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11713. };
  11714. /*
  11715. * htt_dbg_stats_status -
  11716. * present - The requested stats have been delivered in full.
  11717. * This indicates that either the stats information was contained
  11718. * in its entirety within this message, or else this message
  11719. * completes the delivery of the requested stats info that was
  11720. * partially delivered through earlier STATS_CONF messages.
  11721. * partial - The requested stats have been delivered in part.
  11722. * One or more subsequent STATS_CONF messages with the same
  11723. * cookie value will be sent to deliver the remainder of the
  11724. * information.
  11725. * error - The requested stats could not be delivered, for example due
  11726. * to a shortage of memory to construct a message holding the
  11727. * requested stats.
  11728. * invalid - The requested stat type is either not recognized, or the
  11729. * target is configured to not gather the stats type in question.
  11730. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11731. * series_done - This special value indicates that no further stats info
  11732. * elements are present within a series of stats info elems
  11733. * (within a stats upload confirmation message).
  11734. */
  11735. enum htt_dbg_stats_status {
  11736. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11737. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11738. HTT_DBG_STATS_STATUS_ERROR = 2,
  11739. HTT_DBG_STATS_STATUS_INVALID = 3,
  11740. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11741. };
  11742. /**
  11743. * @brief target -> host statistics upload
  11744. *
  11745. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11746. *
  11747. * @details
  11748. * The following field definitions describe the format of the HTT target
  11749. * to host stats upload confirmation message.
  11750. * The message contains a cookie echoed from the HTT host->target stats
  11751. * upload request, which identifies which request the confirmation is
  11752. * for, and a series of tag-length-value stats information elements.
  11753. * The tag-length header for each stats info element also includes a
  11754. * status field, to indicate whether the request for the stat type in
  11755. * question was fully met, partially met, unable to be met, or invalid
  11756. * (if the stat type in question is disabled in the target).
  11757. * A special value of all 1's in this status field is used to indicate
  11758. * the end of the series of stats info elements.
  11759. *
  11760. *
  11761. * |31 16|15 8|7 5|4 0|
  11762. * |------------------------------------------------------------|
  11763. * | reserved | msg type |
  11764. * |------------------------------------------------------------|
  11765. * | cookie LSBs |
  11766. * |------------------------------------------------------------|
  11767. * | cookie MSBs |
  11768. * |------------------------------------------------------------|
  11769. * | stats entry length | reserved | S |stat type|
  11770. * |------------------------------------------------------------|
  11771. * | |
  11772. * | type-specific stats info |
  11773. * | |
  11774. * |------------------------------------------------------------|
  11775. * | stats entry length | reserved | S |stat type|
  11776. * |------------------------------------------------------------|
  11777. * | |
  11778. * | type-specific stats info |
  11779. * | |
  11780. * |------------------------------------------------------------|
  11781. * | n/a | reserved | 111 | n/a |
  11782. * |------------------------------------------------------------|
  11783. * Header fields:
  11784. * - MSG_TYPE
  11785. * Bits 7:0
  11786. * Purpose: identifies this is a statistics upload confirmation message
  11787. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11788. * - COOKIE_LSBS
  11789. * Bits 31:0
  11790. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11791. * message with its preceding host->target stats request message.
  11792. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11793. * - COOKIE_MSBS
  11794. * Bits 31:0
  11795. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11796. * message with its preceding host->target stats request message.
  11797. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11798. *
  11799. * Stats Information Element tag-length header fields:
  11800. * - STAT_TYPE
  11801. * Bits 4:0
  11802. * Purpose: identifies the type of statistics info held in the
  11803. * following information element
  11804. * Value: htt_dbg_stats_type
  11805. * - STATUS
  11806. * Bits 7:5
  11807. * Purpose: indicate whether the requested stats are present
  11808. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11809. * the completion of the stats entry series
  11810. * - LENGTH
  11811. * Bits 31:16
  11812. * Purpose: indicate the stats information size
  11813. * Value: This field specifies the number of bytes of stats information
  11814. * that follows the element tag-length header.
  11815. * It is expected but not required that this length is a multiple of
  11816. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11817. * subsequent stats entry header will begin on a 4-byte aligned
  11818. * boundary.
  11819. */
  11820. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11821. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11822. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11823. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11824. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11825. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11826. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11827. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11828. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11829. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11830. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11831. do { \
  11832. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11833. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11834. } while (0)
  11835. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11836. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11837. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11838. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11839. do { \
  11840. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11841. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11842. } while (0)
  11843. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11844. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11845. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11846. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11847. do { \
  11848. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11849. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11850. } while (0)
  11851. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11852. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11853. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11854. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11855. #define HTT_MAX_AGGR 64
  11856. #define HTT_HL_MAX_AGGR 18
  11857. /**
  11858. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11859. *
  11860. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11861. *
  11862. * @details
  11863. * The following field definitions describe the format of the HTT host
  11864. * to target frag_desc/msdu_ext bank configuration message.
  11865. * The message contains the based address and the min and max id of the
  11866. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11867. * MSDU_EXT/FRAG_DESC.
  11868. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11869. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11870. * the hardware does the mapping/translation.
  11871. *
  11872. * Total banks that can be configured is configured to 16.
  11873. *
  11874. * This should be called before any TX has be initiated by the HTT
  11875. *
  11876. * |31 16|15 8|7 5|4 0|
  11877. * |------------------------------------------------------------|
  11878. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11879. * |------------------------------------------------------------|
  11880. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11881. #if HTT_PADDR64
  11882. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11883. #endif
  11884. * |------------------------------------------------------------|
  11885. * | ... |
  11886. * |------------------------------------------------------------|
  11887. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11888. #if HTT_PADDR64
  11889. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11890. #endif
  11891. * |------------------------------------------------------------|
  11892. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11893. * |------------------------------------------------------------|
  11894. * | ... |
  11895. * |------------------------------------------------------------|
  11896. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11897. * |------------------------------------------------------------|
  11898. * Header fields:
  11899. * - MSG_TYPE
  11900. * Bits 7:0
  11901. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11902. * for systems with 64-bit format for bus addresses:
  11903. * - BANKx_BASE_ADDRESS_LO
  11904. * Bits 31:0
  11905. * Purpose: Provide a mechanism to specify the base address of the
  11906. * MSDU_EXT bank physical/bus address.
  11907. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11908. * - BANKx_BASE_ADDRESS_HI
  11909. * Bits 31:0
  11910. * Purpose: Provide a mechanism to specify the base address of the
  11911. * MSDU_EXT bank physical/bus address.
  11912. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11913. * for systems with 32-bit format for bus addresses:
  11914. * - BANKx_BASE_ADDRESS
  11915. * Bits 31:0
  11916. * Purpose: Provide a mechanism to specify the base address of the
  11917. * MSDU_EXT bank physical/bus address.
  11918. * Value: MSDU_EXT bank physical / bus address
  11919. * - BANKx_MIN_ID
  11920. * Bits 15:0
  11921. * Purpose: Provide a mechanism to specify the min index that needs to
  11922. * mapped.
  11923. * - BANKx_MAX_ID
  11924. * Bits 31:16
  11925. * Purpose: Provide a mechanism to specify the max index that needs to
  11926. * mapped.
  11927. *
  11928. */
  11929. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11930. * safe value.
  11931. * @note MAX supported banks is 16.
  11932. */
  11933. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11934. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11935. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11936. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11937. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11938. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11939. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11940. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11941. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11942. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11943. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11944. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11945. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11946. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11947. do { \
  11948. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11949. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11950. } while (0)
  11951. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11952. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11953. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11954. do { \
  11955. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11956. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11957. } while (0)
  11958. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11959. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11960. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11961. do { \
  11962. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11963. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11964. } while (0)
  11965. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11966. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11967. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11968. do { \
  11969. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11970. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11971. } while (0)
  11972. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11973. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11974. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11975. do { \
  11976. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11977. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11978. } while (0)
  11979. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11980. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11981. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11982. do { \
  11983. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11984. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11985. } while (0)
  11986. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11987. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11988. /*
  11989. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11990. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11991. * addresses are stored in a XXX-bit field.
  11992. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11993. * htt_tx_frag_desc64_bank_cfg_t structs.
  11994. */
  11995. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11996. _paddr_bits_, \
  11997. _paddr__bank_base_address_) \
  11998. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  11999. /** word 0 \
  12000. * msg_type: 8, \
  12001. * pdev_id: 2, \
  12002. * swap: 1, \
  12003. * reserved0: 5, \
  12004. * num_banks: 8, \
  12005. * desc_size: 8; \
  12006. */ \
  12007. A_UINT32 word0; \
  12008. /* \
  12009. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12010. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12011. * the second A_UINT32). \
  12012. */ \
  12013. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12014. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12015. } POSTPACK
  12016. /* define htt_tx_frag_desc32_bank_cfg_t */
  12017. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12018. /* define htt_tx_frag_desc64_bank_cfg_t */
  12019. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12020. /*
  12021. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12022. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12023. */
  12024. #if HTT_PADDR64
  12025. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12026. #else
  12027. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12028. #endif
  12029. /**
  12030. * @brief target -> host HTT TX Credit total count update message definition
  12031. *
  12032. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12033. *
  12034. *|31 16|15|14 9| 8 |7 0 |
  12035. *|---------------------+--+----------+-------+----------|
  12036. *|cur htt credit delta | Q| reserved | sign | msg type |
  12037. *|------------------------------------------------------|
  12038. *
  12039. * Header fields:
  12040. * - MSG_TYPE
  12041. * Bits 7:0
  12042. * Purpose: identifies this as a htt tx credit delta update message
  12043. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12044. * - SIGN
  12045. * Bits 8
  12046. * identifies whether credit delta is positive or negative
  12047. * Value:
  12048. * - 0x0: credit delta is positive, rebalance in some buffers
  12049. * - 0x1: credit delta is negative, rebalance out some buffers
  12050. * - reserved
  12051. * Bits 14:9
  12052. * Value: 0x0
  12053. * - TXQ_GRP
  12054. * Bit 15
  12055. * Purpose: indicates whether any tx queue group information elements
  12056. * are appended to the tx credit update message
  12057. * Value: 0 -> no tx queue group information element is present
  12058. * 1 -> a tx queue group information element immediately follows
  12059. * - DELTA_COUNT
  12060. * Bits 31:16
  12061. * Purpose: Specify current htt credit delta absolute count
  12062. */
  12063. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12064. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12065. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12066. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12067. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12068. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12069. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12070. do { \
  12071. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12072. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12073. } while (0)
  12074. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12075. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12076. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12077. do { \
  12078. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12079. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12080. } while (0)
  12081. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12082. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12083. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12084. do { \
  12085. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12086. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12087. } while (0)
  12088. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12089. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12090. #define HTT_TX_CREDIT_MSG_BYTES 4
  12091. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12092. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12093. /**
  12094. * @brief HTT WDI_IPA Operation Response Message
  12095. *
  12096. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12097. *
  12098. * @details
  12099. * HTT WDI_IPA Operation Response message is sent by target
  12100. * to host confirming suspend or resume operation.
  12101. * |31 24|23 16|15 8|7 0|
  12102. * |----------------+----------------+----------------+----------------|
  12103. * | op_code | Rsvd | msg_type |
  12104. * |-------------------------------------------------------------------|
  12105. * | Rsvd | Response len |
  12106. * |-------------------------------------------------------------------|
  12107. * | |
  12108. * | Response-type specific info |
  12109. * | |
  12110. * | |
  12111. * |-------------------------------------------------------------------|
  12112. * Header fields:
  12113. * - MSG_TYPE
  12114. * Bits 7:0
  12115. * Purpose: Identifies this as WDI_IPA Operation Response message
  12116. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12117. * - OP_CODE
  12118. * Bits 31:16
  12119. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12120. * value: = enum htt_wdi_ipa_op_code
  12121. * - RSP_LEN
  12122. * Bits 16:0
  12123. * Purpose: length for the response-type specific info
  12124. * value: = length in bytes for response-type specific info
  12125. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12126. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12127. */
  12128. PREPACK struct htt_wdi_ipa_op_response_t
  12129. {
  12130. /* DWORD 0: flags and meta-data */
  12131. A_UINT32
  12132. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12133. reserved1: 8,
  12134. op_code: 16;
  12135. A_UINT32
  12136. rsp_len: 16,
  12137. reserved2: 16;
  12138. } POSTPACK;
  12139. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12140. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12141. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12142. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12143. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12144. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12145. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12146. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12147. do { \
  12148. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12149. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12150. } while (0)
  12151. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12152. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12153. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12154. do { \
  12155. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12156. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12157. } while (0)
  12158. enum htt_phy_mode {
  12159. htt_phy_mode_11a = 0,
  12160. htt_phy_mode_11g = 1,
  12161. htt_phy_mode_11b = 2,
  12162. htt_phy_mode_11g_only = 3,
  12163. htt_phy_mode_11na_ht20 = 4,
  12164. htt_phy_mode_11ng_ht20 = 5,
  12165. htt_phy_mode_11na_ht40 = 6,
  12166. htt_phy_mode_11ng_ht40 = 7,
  12167. htt_phy_mode_11ac_vht20 = 8,
  12168. htt_phy_mode_11ac_vht40 = 9,
  12169. htt_phy_mode_11ac_vht80 = 10,
  12170. htt_phy_mode_11ac_vht20_2g = 11,
  12171. htt_phy_mode_11ac_vht40_2g = 12,
  12172. htt_phy_mode_11ac_vht80_2g = 13,
  12173. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12174. htt_phy_mode_11ac_vht160 = 15,
  12175. htt_phy_mode_max,
  12176. };
  12177. /**
  12178. * @brief target -> host HTT channel change indication
  12179. *
  12180. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12181. *
  12182. * @details
  12183. * Specify when a channel change occurs.
  12184. * This allows the host to precisely determine which rx frames arrived
  12185. * on the old channel and which rx frames arrived on the new channel.
  12186. *
  12187. *|31 |7 0 |
  12188. *|-------------------------------------------+----------|
  12189. *| reserved | msg type |
  12190. *|------------------------------------------------------|
  12191. *| primary_chan_center_freq_mhz |
  12192. *|------------------------------------------------------|
  12193. *| contiguous_chan1_center_freq_mhz |
  12194. *|------------------------------------------------------|
  12195. *| contiguous_chan2_center_freq_mhz |
  12196. *|------------------------------------------------------|
  12197. *| phy_mode |
  12198. *|------------------------------------------------------|
  12199. *
  12200. * Header fields:
  12201. * - MSG_TYPE
  12202. * Bits 7:0
  12203. * Purpose: identifies this as a htt channel change indication message
  12204. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12205. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12206. * Bits 31:0
  12207. * Purpose: identify the (center of the) new 20 MHz primary channel
  12208. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12209. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12210. * Bits 31:0
  12211. * Purpose: identify the (center of the) contiguous frequency range
  12212. * comprising the new channel.
  12213. * For example, if the new channel is a 80 MHz channel extending
  12214. * 60 MHz beyond the primary channel, this field would be 30 larger
  12215. * than the primary channel center frequency field.
  12216. * Value: center frequency of the contiguous frequency range comprising
  12217. * the full channel in MHz units
  12218. * (80+80 channels also use the CONTIG_CHAN2 field)
  12219. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12220. * Bits 31:0
  12221. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12222. * within a VHT 80+80 channel.
  12223. * This field is only relevant for VHT 80+80 channels.
  12224. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12225. * channel (arbitrary value for cases besides VHT 80+80)
  12226. * - PHY_MODE
  12227. * Bits 31:0
  12228. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12229. * and band
  12230. * Value: htt_phy_mode enum value
  12231. */
  12232. PREPACK struct htt_chan_change_t
  12233. {
  12234. /* DWORD 0: flags and meta-data */
  12235. A_UINT32
  12236. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12237. reserved1: 24;
  12238. A_UINT32 primary_chan_center_freq_mhz;
  12239. A_UINT32 contig_chan1_center_freq_mhz;
  12240. A_UINT32 contig_chan2_center_freq_mhz;
  12241. A_UINT32 phy_mode;
  12242. } POSTPACK;
  12243. /*
  12244. * Due to historical / backwards-compatibility reasons, maintain the
  12245. * below htt_chan_change_msg struct definition, which needs to be
  12246. * consistent with the above htt_chan_change_t struct definition
  12247. * (aside from the htt_chan_change_t definition including the msg_type
  12248. * dword within the message, and the htt_chan_change_msg only containing
  12249. * the payload of the message that follows the msg_type dword).
  12250. */
  12251. PREPACK struct htt_chan_change_msg {
  12252. A_UINT32 chan_mhz; /* frequency in mhz */
  12253. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12254. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12255. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12256. } POSTPACK;
  12257. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12258. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12259. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12260. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12261. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12262. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12263. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12264. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12265. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12266. do { \
  12267. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12268. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12269. } while (0)
  12270. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12271. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12272. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12273. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12274. do { \
  12275. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12276. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12277. } while (0)
  12278. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12279. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12280. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12281. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12282. do { \
  12283. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12284. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12285. } while (0)
  12286. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12287. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12288. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12289. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12290. do { \
  12291. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12292. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12293. } while (0)
  12294. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12295. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12296. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12297. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12298. /**
  12299. * @brief rx offload packet error message
  12300. *
  12301. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12302. *
  12303. * @details
  12304. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12305. * of target payload like mic err.
  12306. *
  12307. * |31 24|23 16|15 8|7 0|
  12308. * |----------------+----------------+----------------+----------------|
  12309. * | tid | vdev_id | msg_sub_type | msg_type |
  12310. * |-------------------------------------------------------------------|
  12311. * : (sub-type dependent content) :
  12312. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12313. * Header fields:
  12314. * - msg_type
  12315. * Bits 7:0
  12316. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12317. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12318. * - msg_sub_type
  12319. * Bits 15:8
  12320. * Purpose: Identifies which type of rx error is reported by this message
  12321. * value: htt_rx_ofld_pkt_err_type
  12322. * - vdev_id
  12323. * Bits 23:16
  12324. * Purpose: Identifies which vdev received the erroneous rx frame
  12325. * value:
  12326. * - tid
  12327. * Bits 31:24
  12328. * Purpose: Identifies the traffic type of the rx frame
  12329. * value:
  12330. *
  12331. * - The payload fields used if the sub-type == MIC error are shown below.
  12332. * Note - MIC err is per MSDU, while PN is per MPDU.
  12333. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12334. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12335. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12336. * instead of sending separate HTT messages for each wrong MSDU within
  12337. * the MPDU.
  12338. *
  12339. * |31 24|23 16|15 8|7 0|
  12340. * |----------------+----------------+----------------+----------------|
  12341. * | Rsvd | key_id | peer_id |
  12342. * |-------------------------------------------------------------------|
  12343. * | receiver MAC addr 31:0 |
  12344. * |-------------------------------------------------------------------|
  12345. * | Rsvd | receiver MAC addr 47:32 |
  12346. * |-------------------------------------------------------------------|
  12347. * | transmitter MAC addr 31:0 |
  12348. * |-------------------------------------------------------------------|
  12349. * | Rsvd | transmitter MAC addr 47:32 |
  12350. * |-------------------------------------------------------------------|
  12351. * | PN 31:0 |
  12352. * |-------------------------------------------------------------------|
  12353. * | Rsvd | PN 47:32 |
  12354. * |-------------------------------------------------------------------|
  12355. * - peer_id
  12356. * Bits 15:0
  12357. * Purpose: identifies which peer is frame is from
  12358. * value:
  12359. * - key_id
  12360. * Bits 23:16
  12361. * Purpose: identifies key_id of rx frame
  12362. * value:
  12363. * - RA_31_0 (receiver MAC addr 31:0)
  12364. * Bits 31:0
  12365. * Purpose: identifies by MAC address which vdev received the frame
  12366. * value: MAC address lower 4 bytes
  12367. * - RA_47_32 (receiver MAC addr 47:32)
  12368. * Bits 15:0
  12369. * Purpose: identifies by MAC address which vdev received the frame
  12370. * value: MAC address upper 2 bytes
  12371. * - TA_31_0 (transmitter MAC addr 31:0)
  12372. * Bits 31:0
  12373. * Purpose: identifies by MAC address which peer transmitted the frame
  12374. * value: MAC address lower 4 bytes
  12375. * - TA_47_32 (transmitter MAC addr 47:32)
  12376. * Bits 15:0
  12377. * Purpose: identifies by MAC address which peer transmitted the frame
  12378. * value: MAC address upper 2 bytes
  12379. * - PN_31_0
  12380. * Bits 31:0
  12381. * Purpose: Identifies pn of rx frame
  12382. * value: PN lower 4 bytes
  12383. * - PN_47_32
  12384. * Bits 15:0
  12385. * Purpose: Identifies pn of rx frame
  12386. * value:
  12387. * TKIP or CCMP: PN upper 2 bytes
  12388. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12389. */
  12390. enum htt_rx_ofld_pkt_err_type {
  12391. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12392. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12393. };
  12394. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12395. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12396. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12397. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12398. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12399. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12400. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12401. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12402. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12403. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12404. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12405. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12406. do { \
  12407. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12408. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12409. } while (0)
  12410. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12411. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12412. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12413. do { \
  12414. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12415. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12416. } while (0)
  12417. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12418. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12419. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12420. do { \
  12421. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12422. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12423. } while (0)
  12424. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12425. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12426. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12427. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12428. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12429. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12430. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12431. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12432. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12433. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12434. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12435. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12436. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12437. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12438. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12439. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12440. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12441. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12442. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12443. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12444. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12445. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12446. do { \
  12447. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12448. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12449. } while (0)
  12450. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12451. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12452. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12453. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12454. do { \
  12455. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12456. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12457. } while (0)
  12458. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12459. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12460. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12461. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12462. do { \
  12463. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12464. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12465. } while (0)
  12466. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12467. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12468. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12469. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12470. do { \
  12471. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12472. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12473. } while (0)
  12474. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12475. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12476. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12477. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12478. do { \
  12479. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12480. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12481. } while (0)
  12482. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12483. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12484. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12485. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12486. do { \
  12487. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12488. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12489. } while (0)
  12490. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12491. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12492. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12493. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12494. do { \
  12495. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12496. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12497. } while (0)
  12498. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12499. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12500. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12501. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12502. do { \
  12503. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12504. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12505. } while (0)
  12506. /**
  12507. * @brief target -> host peer rate report message
  12508. *
  12509. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12510. *
  12511. * @details
  12512. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12513. * justified rate of all the peers.
  12514. *
  12515. * |31 24|23 16|15 8|7 0|
  12516. * |----------------+----------------+----------------+----------------|
  12517. * | peer_count | | msg_type |
  12518. * |-------------------------------------------------------------------|
  12519. * : Payload (variant number of peer rate report) :
  12520. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12521. * Header fields:
  12522. * - msg_type
  12523. * Bits 7:0
  12524. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12525. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12526. * - reserved
  12527. * Bits 15:8
  12528. * Purpose:
  12529. * value:
  12530. * - peer_count
  12531. * Bits 31:16
  12532. * Purpose: Specify how many peer rate report elements are present in the payload.
  12533. * value:
  12534. *
  12535. * Payload:
  12536. * There are variant number of peer rate report follow the first 32 bits.
  12537. * The peer rate report is defined as follows.
  12538. *
  12539. * |31 20|19 16|15 0|
  12540. * |-----------------------+---------+---------------------------------|-
  12541. * | reserved | phy | peer_id | \
  12542. * |-------------------------------------------------------------------| -> report #0
  12543. * | rate | /
  12544. * |-----------------------+---------+---------------------------------|-
  12545. * | reserved | phy | peer_id | \
  12546. * |-------------------------------------------------------------------| -> report #1
  12547. * | rate | /
  12548. * |-----------------------+---------+---------------------------------|-
  12549. * | reserved | phy | peer_id | \
  12550. * |-------------------------------------------------------------------| -> report #2
  12551. * | rate | /
  12552. * |-------------------------------------------------------------------|-
  12553. * : :
  12554. * : :
  12555. * : :
  12556. * :-------------------------------------------------------------------:
  12557. *
  12558. * - peer_id
  12559. * Bits 15:0
  12560. * Purpose: identify the peer
  12561. * value:
  12562. * - phy
  12563. * Bits 19:16
  12564. * Purpose: identify which phy is in use
  12565. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12566. * Please see enum htt_peer_report_phy_type for detail.
  12567. * - reserved
  12568. * Bits 31:20
  12569. * Purpose:
  12570. * value:
  12571. * - rate
  12572. * Bits 31:0
  12573. * Purpose: represent the justified rate of the peer specified by peer_id
  12574. * value:
  12575. */
  12576. enum htt_peer_rate_report_phy_type {
  12577. HTT_PEER_RATE_REPORT_11B = 0,
  12578. HTT_PEER_RATE_REPORT_11A_G,
  12579. HTT_PEER_RATE_REPORT_11N,
  12580. HTT_PEER_RATE_REPORT_11AC,
  12581. };
  12582. #define HTT_PEER_RATE_REPORT_SIZE 8
  12583. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12584. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12585. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12586. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12587. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12588. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12589. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12590. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12591. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12592. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12593. do { \
  12594. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12595. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12596. } while (0)
  12597. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12598. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12599. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12600. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12601. do { \
  12602. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12603. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12604. } while (0)
  12605. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12606. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12607. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12608. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12609. do { \
  12610. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12611. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12612. } while (0)
  12613. /**
  12614. * @brief target -> host flow pool map message
  12615. *
  12616. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12617. *
  12618. * @details
  12619. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12620. * a flow of descriptors.
  12621. *
  12622. * This message is in TLV format and indicates the parameters to be setup a
  12623. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12624. * receive descriptors from a specified pool.
  12625. *
  12626. * The message would appear as follows:
  12627. *
  12628. * |31 24|23 16|15 8|7 0|
  12629. * |----------------+----------------+----------------+----------------|
  12630. * header | reserved | num_flows | msg_type |
  12631. * |-------------------------------------------------------------------|
  12632. * | |
  12633. * : payload :
  12634. * | |
  12635. * |-------------------------------------------------------------------|
  12636. *
  12637. * The header field is one DWORD long and is interpreted as follows:
  12638. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12639. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12640. * this message
  12641. * b'16-31 - reserved: These bits are reserved for future use
  12642. *
  12643. * Payload:
  12644. * The payload would contain multiple objects of the following structure. Each
  12645. * object represents a flow.
  12646. *
  12647. * |31 24|23 16|15 8|7 0|
  12648. * |----------------+----------------+----------------+----------------|
  12649. * header | reserved | num_flows | msg_type |
  12650. * |-------------------------------------------------------------------|
  12651. * payload0| flow_type |
  12652. * |-------------------------------------------------------------------|
  12653. * | flow_id |
  12654. * |-------------------------------------------------------------------|
  12655. * | reserved0 | flow_pool_id |
  12656. * |-------------------------------------------------------------------|
  12657. * | reserved1 | flow_pool_size |
  12658. * |-------------------------------------------------------------------|
  12659. * | reserved2 |
  12660. * |-------------------------------------------------------------------|
  12661. * payload1| flow_type |
  12662. * |-------------------------------------------------------------------|
  12663. * | flow_id |
  12664. * |-------------------------------------------------------------------|
  12665. * | reserved0 | flow_pool_id |
  12666. * |-------------------------------------------------------------------|
  12667. * | reserved1 | flow_pool_size |
  12668. * |-------------------------------------------------------------------|
  12669. * | reserved2 |
  12670. * |-------------------------------------------------------------------|
  12671. * | . |
  12672. * | . |
  12673. * | . |
  12674. * |-------------------------------------------------------------------|
  12675. *
  12676. * Each payload is 5 DWORDS long and is interpreted as follows:
  12677. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12678. * this flow is associated. It can be VDEV, peer,
  12679. * or tid (AC). Based on enum htt_flow_type.
  12680. *
  12681. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12682. * object. For flow_type vdev it is set to the
  12683. * vdevid, for peer it is peerid and for tid, it is
  12684. * tid_num.
  12685. *
  12686. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12687. * in the host for this flow
  12688. * b'16:31 - reserved0: This field in reserved for the future. In case
  12689. * we have a hierarchical implementation (HCM) of
  12690. * pools, it can be used to indicate the ID of the
  12691. * parent-pool.
  12692. *
  12693. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12694. * Descriptors for this flow will be
  12695. * allocated from this pool in the host.
  12696. * b'16:31 - reserved1: This field in reserved for the future. In case
  12697. * we have a hierarchical implementation of pools,
  12698. * it can be used to indicate the max number of
  12699. * descriptors in the pool. The b'0:15 can be used
  12700. * to indicate min number of descriptors in the
  12701. * HCM scheme.
  12702. *
  12703. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12704. * we have a hierarchical implementation of pools,
  12705. * b'0:15 can be used to indicate the
  12706. * priority-based borrowing (PBB) threshold of
  12707. * the flow's pool. The b'16:31 are still left
  12708. * reserved.
  12709. */
  12710. enum htt_flow_type {
  12711. FLOW_TYPE_VDEV = 0,
  12712. /* Insert new flow types above this line */
  12713. };
  12714. PREPACK struct htt_flow_pool_map_payload_t {
  12715. A_UINT32 flow_type;
  12716. A_UINT32 flow_id;
  12717. A_UINT32 flow_pool_id:16,
  12718. reserved0:16;
  12719. A_UINT32 flow_pool_size:16,
  12720. reserved1:16;
  12721. A_UINT32 reserved2;
  12722. } POSTPACK;
  12723. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12724. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12725. (sizeof(struct htt_flow_pool_map_payload_t))
  12726. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12727. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12728. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12729. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12730. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12731. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12732. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12733. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12734. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12735. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12736. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12737. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12738. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12739. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12740. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12741. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12742. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12743. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12744. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12745. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12746. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12747. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12748. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12749. do { \
  12750. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12751. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12752. } while (0)
  12753. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12754. do { \
  12755. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12756. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12757. } while (0)
  12758. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12759. do { \
  12760. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12761. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12762. } while (0)
  12763. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12764. do { \
  12765. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12766. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12767. } while (0)
  12768. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12769. do { \
  12770. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12771. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12772. } while (0)
  12773. /**
  12774. * @brief target -> host flow pool unmap message
  12775. *
  12776. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12777. *
  12778. * @details
  12779. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12780. * down a flow of descriptors.
  12781. * This message indicates that for the flow (whose ID is provided) is wanting
  12782. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12783. * pool of descriptors from where descriptors are being allocated for this
  12784. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12785. * be unmapped by the host.
  12786. *
  12787. * The message would appear as follows:
  12788. *
  12789. * |31 24|23 16|15 8|7 0|
  12790. * |----------------+----------------+----------------+----------------|
  12791. * | reserved0 | msg_type |
  12792. * |-------------------------------------------------------------------|
  12793. * | flow_type |
  12794. * |-------------------------------------------------------------------|
  12795. * | flow_id |
  12796. * |-------------------------------------------------------------------|
  12797. * | reserved1 | flow_pool_id |
  12798. * |-------------------------------------------------------------------|
  12799. *
  12800. * The message is interpreted as follows:
  12801. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12802. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12803. * b'8:31 - reserved0: Reserved for future use
  12804. *
  12805. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12806. * this flow is associated. It can be VDEV, peer,
  12807. * or tid (AC). Based on enum htt_flow_type.
  12808. *
  12809. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12810. * object. For flow_type vdev it is set to the
  12811. * vdevid, for peer it is peerid and for tid, it is
  12812. * tid_num.
  12813. *
  12814. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12815. * used in the host for this flow
  12816. * b'16:31 - reserved0: This field in reserved for the future.
  12817. *
  12818. */
  12819. PREPACK struct htt_flow_pool_unmap_t {
  12820. A_UINT32 msg_type:8,
  12821. reserved0:24;
  12822. A_UINT32 flow_type;
  12823. A_UINT32 flow_id;
  12824. A_UINT32 flow_pool_id:16,
  12825. reserved1:16;
  12826. } POSTPACK;
  12827. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12828. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12829. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12830. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12831. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12832. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12833. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12834. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12835. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12836. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12837. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12838. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12839. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12840. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12841. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12842. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12843. do { \
  12844. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12845. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12846. } while (0)
  12847. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12848. do { \
  12849. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12850. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12851. } while (0)
  12852. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12853. do { \
  12854. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12855. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12856. } while (0)
  12857. /**
  12858. * @brief target -> host SRING setup done message
  12859. *
  12860. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12861. *
  12862. * @details
  12863. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12864. * SRNG ring setup is done
  12865. *
  12866. * This message indicates whether the last setup operation is successful.
  12867. * It will be sent to host when host set respose_required bit in
  12868. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12869. * The message would appear as follows:
  12870. *
  12871. * |31 24|23 16|15 8|7 0|
  12872. * |--------------- +----------------+----------------+----------------|
  12873. * | setup_status | ring_id | pdev_id | msg_type |
  12874. * |-------------------------------------------------------------------|
  12875. *
  12876. * The message is interpreted as follows:
  12877. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12878. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12879. * b'8:15 - pdev_id:
  12880. * 0 (for rings at SOC/UMAC level),
  12881. * 1/2/3 mac id (for rings at LMAC level)
  12882. * b'16:23 - ring_id: Identify the ring which is set up
  12883. * More details can be got from enum htt_srng_ring_id
  12884. * b'24:31 - setup_status: Indicate status of setup operation
  12885. * Refer to htt_ring_setup_status
  12886. */
  12887. PREPACK struct htt_sring_setup_done_t {
  12888. A_UINT32 msg_type: 8,
  12889. pdev_id: 8,
  12890. ring_id: 8,
  12891. setup_status: 8;
  12892. } POSTPACK;
  12893. enum htt_ring_setup_status {
  12894. htt_ring_setup_status_ok = 0,
  12895. htt_ring_setup_status_error,
  12896. };
  12897. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12898. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12899. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12900. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12901. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12902. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12903. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12904. do { \
  12905. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12906. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12907. } while (0)
  12908. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12909. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12910. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12911. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12912. HTT_SRING_SETUP_DONE_RING_ID_S)
  12913. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12914. do { \
  12915. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12916. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12917. } while (0)
  12918. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12919. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12920. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12921. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12922. HTT_SRING_SETUP_DONE_STATUS_S)
  12923. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12924. do { \
  12925. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12926. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12927. } while (0)
  12928. /**
  12929. * @brief target -> flow map flow info
  12930. *
  12931. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12932. *
  12933. * @details
  12934. * HTT TX map flow entry with tqm flow pointer
  12935. * Sent from firmware to host to add tqm flow pointer in corresponding
  12936. * flow search entry. Flow metadata is replayed back to host as part of this
  12937. * struct to enable host to find the specific flow search entry
  12938. *
  12939. * The message would appear as follows:
  12940. *
  12941. * |31 28|27 18|17 14|13 8|7 0|
  12942. * |-------+------------------------------------------+----------------|
  12943. * | rsvd0 | fse_hsh_idx | msg_type |
  12944. * |-------------------------------------------------------------------|
  12945. * | rsvd1 | tid | peer_id |
  12946. * |-------------------------------------------------------------------|
  12947. * | tqm_flow_pntr_lo |
  12948. * |-------------------------------------------------------------------|
  12949. * | tqm_flow_pntr_hi |
  12950. * |-------------------------------------------------------------------|
  12951. * | fse_meta_data |
  12952. * |-------------------------------------------------------------------|
  12953. *
  12954. * The message is interpreted as follows:
  12955. *
  12956. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12957. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12958. *
  12959. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12960. * for this flow entry
  12961. *
  12962. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12963. *
  12964. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12965. *
  12966. * dword1 - b'14:17 - tid
  12967. *
  12968. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12969. *
  12970. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12971. *
  12972. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12973. *
  12974. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12975. * given by host
  12976. */
  12977. PREPACK struct htt_tx_map_flow_info {
  12978. A_UINT32
  12979. msg_type: 8,
  12980. fse_hsh_idx: 20,
  12981. rsvd0: 4;
  12982. A_UINT32
  12983. peer_id: 14,
  12984. tid: 4,
  12985. rsvd1: 14;
  12986. A_UINT32 tqm_flow_pntr_lo;
  12987. A_UINT32 tqm_flow_pntr_hi;
  12988. struct htt_tx_flow_metadata fse_meta_data;
  12989. } POSTPACK;
  12990. /* DWORD 0 */
  12991. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12992. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12993. /* DWORD 1 */
  12994. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12995. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12996. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12997. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  12998. /* DWORD 0 */
  12999. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13000. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13001. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13002. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13003. do { \
  13004. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13005. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13006. } while (0)
  13007. /* DWORD 1 */
  13008. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13009. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13010. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13011. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13012. do { \
  13013. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13014. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13015. } while (0)
  13016. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13017. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13018. HTT_TX_MAP_FLOW_INFO_TID_S)
  13019. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13020. do { \
  13021. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13022. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13023. } while (0)
  13024. /*
  13025. * htt_dbg_ext_stats_status -
  13026. * present - The requested stats have been delivered in full.
  13027. * This indicates that either the stats information was contained
  13028. * in its entirety within this message, or else this message
  13029. * completes the delivery of the requested stats info that was
  13030. * partially delivered through earlier STATS_CONF messages.
  13031. * partial - The requested stats have been delivered in part.
  13032. * One or more subsequent STATS_CONF messages with the same
  13033. * cookie value will be sent to deliver the remainder of the
  13034. * information.
  13035. * error - The requested stats could not be delivered, for example due
  13036. * to a shortage of memory to construct a message holding the
  13037. * requested stats.
  13038. * invalid - The requested stat type is either not recognized, or the
  13039. * target is configured to not gather the stats type in question.
  13040. */
  13041. enum htt_dbg_ext_stats_status {
  13042. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13043. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13044. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13045. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13046. };
  13047. /**
  13048. * @brief target -> host ppdu stats upload
  13049. *
  13050. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13051. *
  13052. * @details
  13053. * The following field definitions describe the format of the HTT target
  13054. * to host ppdu stats indication message.
  13055. *
  13056. *
  13057. * |31 16|15 12|11 10|9 8|7 0 |
  13058. * |----------------------------------------------------------------------|
  13059. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13060. * |----------------------------------------------------------------------|
  13061. * | ppdu_id |
  13062. * |----------------------------------------------------------------------|
  13063. * | Timestamp in us |
  13064. * |----------------------------------------------------------------------|
  13065. * | reserved |
  13066. * |----------------------------------------------------------------------|
  13067. * | type-specific stats info |
  13068. * | (see htt_ppdu_stats.h) |
  13069. * |----------------------------------------------------------------------|
  13070. * Header fields:
  13071. * - MSG_TYPE
  13072. * Bits 7:0
  13073. * Purpose: Identifies this is a PPDU STATS indication
  13074. * message.
  13075. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13076. * - mac_id
  13077. * Bits 9:8
  13078. * Purpose: mac_id of this ppdu_id
  13079. * Value: 0-3
  13080. * - pdev_id
  13081. * Bits 11:10
  13082. * Purpose: pdev_id of this ppdu_id
  13083. * Value: 0-3
  13084. * 0 (for rings at SOC level),
  13085. * 1/2/3 PDEV -> 0/1/2
  13086. * - payload_size
  13087. * Bits 31:16
  13088. * Purpose: total tlv size
  13089. * Value: payload_size in bytes
  13090. */
  13091. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13092. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13093. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13094. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13095. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13096. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13097. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13098. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13099. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13100. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13101. do { \
  13102. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13103. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13104. } while (0)
  13105. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13106. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13107. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13108. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13109. do { \
  13110. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13111. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13112. } while (0)
  13113. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13114. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13115. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13116. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13117. do { \
  13118. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13119. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13120. } while (0)
  13121. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13122. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13123. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13124. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13125. do { \
  13126. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13127. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13128. } while (0)
  13129. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13130. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13131. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13132. /* htt_t2h_ppdu_stats_ind_hdr_t
  13133. * This struct contains the fields within the header of the
  13134. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13135. * stats info.
  13136. * This struct assumes little-endian layout, and thus is only
  13137. * suitable for use within processors known to be little-endian
  13138. * (such as the target).
  13139. * In contrast, the above macros provide endian-portable methods
  13140. * to get and set the bitfields within this PPDU_STATS_IND header.
  13141. */
  13142. typedef struct {
  13143. A_UINT32 msg_type: 8, /* bits 7:0 */
  13144. mac_id: 2, /* bits 9:8 */
  13145. pdev_id: 2, /* bits 11:10 */
  13146. reserved1: 4, /* bits 15:12 */
  13147. payload_size: 16; /* bits 31:16 */
  13148. A_UINT32 ppdu_id;
  13149. A_UINT32 timestamp_us;
  13150. A_UINT32 reserved2;
  13151. } htt_t2h_ppdu_stats_ind_hdr_t;
  13152. /**
  13153. * @brief target -> host extended statistics upload
  13154. *
  13155. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13156. *
  13157. * @details
  13158. * The following field definitions describe the format of the HTT target
  13159. * to host stats upload confirmation message.
  13160. * The message contains a cookie echoed from the HTT host->target stats
  13161. * upload request, which identifies which request the confirmation is
  13162. * for, and a single stats can span over multiple HTT stats indication
  13163. * due to the HTT message size limitation so every HTT ext stats indication
  13164. * will have tag-length-value stats information elements.
  13165. * The tag-length header for each HTT stats IND message also includes a
  13166. * status field, to indicate whether the request for the stat type in
  13167. * question was fully met, partially met, unable to be met, or invalid
  13168. * (if the stat type in question is disabled in the target).
  13169. * A Done bit 1's indicate the end of the of stats info elements.
  13170. *
  13171. *
  13172. * |31 16|15 12|11|10 8|7 5|4 0|
  13173. * |--------------------------------------------------------------|
  13174. * | reserved | msg type |
  13175. * |--------------------------------------------------------------|
  13176. * | cookie LSBs |
  13177. * |--------------------------------------------------------------|
  13178. * | cookie MSBs |
  13179. * |--------------------------------------------------------------|
  13180. * | stats entry length | rsvd | D| S | stat type |
  13181. * |--------------------------------------------------------------|
  13182. * | type-specific stats info |
  13183. * | (see htt_stats.h) |
  13184. * |--------------------------------------------------------------|
  13185. * Header fields:
  13186. * - MSG_TYPE
  13187. * Bits 7:0
  13188. * Purpose: Identifies this is a extended statistics upload confirmation
  13189. * message.
  13190. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13191. * - COOKIE_LSBS
  13192. * Bits 31:0
  13193. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13194. * message with its preceding host->target stats request message.
  13195. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13196. * - COOKIE_MSBS
  13197. * Bits 31:0
  13198. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13199. * message with its preceding host->target stats request message.
  13200. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13201. *
  13202. * Stats Information Element tag-length header fields:
  13203. * - STAT_TYPE
  13204. * Bits 7:0
  13205. * Purpose: identifies the type of statistics info held in the
  13206. * following information element
  13207. * Value: htt_dbg_ext_stats_type
  13208. * - STATUS
  13209. * Bits 10:8
  13210. * Purpose: indicate whether the requested stats are present
  13211. * Value: htt_dbg_ext_stats_status
  13212. * - DONE
  13213. * Bits 11
  13214. * Purpose:
  13215. * Indicates the completion of the stats entry, this will be the last
  13216. * stats conf HTT segment for the requested stats type.
  13217. * Value:
  13218. * 0 -> the stats retrieval is ongoing
  13219. * 1 -> the stats retrieval is complete
  13220. * - LENGTH
  13221. * Bits 31:16
  13222. * Purpose: indicate the stats information size
  13223. * Value: This field specifies the number of bytes of stats information
  13224. * that follows the element tag-length header.
  13225. * It is expected but not required that this length is a multiple of
  13226. * 4 bytes.
  13227. */
  13228. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13229. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13230. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13231. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13232. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13233. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13234. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13235. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13236. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13237. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13238. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13239. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13240. do { \
  13241. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13242. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13243. } while (0)
  13244. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13245. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13246. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13247. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13248. do { \
  13249. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13250. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13251. } while (0)
  13252. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13253. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13254. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13255. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13256. do { \
  13257. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13258. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13259. } while (0)
  13260. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13261. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13262. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13263. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13264. do { \
  13265. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13266. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13267. } while (0)
  13268. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13269. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13270. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13271. typedef enum {
  13272. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13273. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13274. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13275. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13276. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13277. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13278. /* Reserved from 128 - 255 for target internal use.*/
  13279. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13280. } HTT_PEER_TYPE;
  13281. /** macro to convert MAC address from char array to HTT word format */
  13282. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13283. (phtt_mac_addr)->mac_addr31to0 = \
  13284. (((c_macaddr)[0] << 0) | \
  13285. ((c_macaddr)[1] << 8) | \
  13286. ((c_macaddr)[2] << 16) | \
  13287. ((c_macaddr)[3] << 24)); \
  13288. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13289. } while (0)
  13290. /**
  13291. * @brief target -> host monitor mac header indication message
  13292. *
  13293. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13294. *
  13295. * @details
  13296. * The following diagram shows the format of the monitor mac header message
  13297. * sent from the target to the host.
  13298. * This message is primarily sent when promiscuous rx mode is enabled.
  13299. * One message is sent per rx PPDU.
  13300. *
  13301. * |31 24|23 16|15 8|7 0|
  13302. * |-------------------------------------------------------------|
  13303. * | peer_id | reserved0 | msg_type |
  13304. * |-------------------------------------------------------------|
  13305. * | reserved1 | num_mpdu |
  13306. * |-------------------------------------------------------------|
  13307. * | struct hw_rx_desc |
  13308. * | (see wal_rx_desc.h) |
  13309. * |-------------------------------------------------------------|
  13310. * | struct ieee80211_frame_addr4 |
  13311. * | (see ieee80211_defs.h) |
  13312. * |-------------------------------------------------------------|
  13313. * | struct ieee80211_frame_addr4 |
  13314. * | (see ieee80211_defs.h) |
  13315. * |-------------------------------------------------------------|
  13316. * | ...... |
  13317. * |-------------------------------------------------------------|
  13318. *
  13319. * Header fields:
  13320. * - msg_type
  13321. * Bits 7:0
  13322. * Purpose: Identifies this is a monitor mac header indication message.
  13323. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13324. * - peer_id
  13325. * Bits 31:16
  13326. * Purpose: Software peer id given by host during association,
  13327. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13328. * for rx PPDUs received from unassociated peers.
  13329. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13330. * - num_mpdu
  13331. * Bits 15:0
  13332. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13333. * delivered within the message.
  13334. * Value: 1 to 32
  13335. * num_mpdu is limited to a maximum value of 32, due to buffer
  13336. * size limits. For PPDUs with more than 32 MPDUs, only the
  13337. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13338. * the PPDU will be provided.
  13339. */
  13340. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13341. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13342. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13343. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13344. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13345. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13346. do { \
  13347. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13348. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13349. } while (0)
  13350. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13351. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13352. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13353. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13354. do { \
  13355. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13356. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13357. } while (0)
  13358. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13359. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13360. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13361. /**
  13362. * @brief target -> host flow pool resize Message
  13363. *
  13364. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13365. *
  13366. * @details
  13367. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13368. * the flow pool associated with the specified ID is resized
  13369. *
  13370. * The message would appear as follows:
  13371. *
  13372. * |31 16|15 8|7 0|
  13373. * |---------------------------------+----------------+----------------|
  13374. * | reserved0 | Msg type |
  13375. * |-------------------------------------------------------------------|
  13376. * | flow pool new size | flow pool ID |
  13377. * |-------------------------------------------------------------------|
  13378. *
  13379. * The message is interpreted as follows:
  13380. * b'0:7 - msg_type: This will be set to 0x21
  13381. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13382. *
  13383. * b'0:15 - flow pool ID: Existing flow pool ID
  13384. *
  13385. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13386. *
  13387. */
  13388. PREPACK struct htt_flow_pool_resize_t {
  13389. A_UINT32 msg_type:8,
  13390. reserved0:24;
  13391. A_UINT32 flow_pool_id:16,
  13392. flow_pool_new_size:16;
  13393. } POSTPACK;
  13394. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13395. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13396. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13397. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13398. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13399. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13400. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13401. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13402. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13403. do { \
  13404. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13405. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13406. } while (0)
  13407. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13408. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13409. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13410. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13411. do { \
  13412. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13413. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13414. } while (0)
  13415. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13416. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13417. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13418. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13419. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13420. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13421. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13422. /*
  13423. * The read and write indices point to the data within the host buffer.
  13424. * Because the first 4 bytes of the host buffer is used for the read index and
  13425. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13426. * The read index and write index are the byte offsets from the base of the
  13427. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13428. * Refer the ASCII text picture below.
  13429. */
  13430. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13431. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13432. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13433. /*
  13434. ***************************************************************************
  13435. *
  13436. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13437. *
  13438. ***************************************************************************
  13439. *
  13440. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13441. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13442. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13443. * written into the Host memory region mentioned below.
  13444. *
  13445. * Read index is updated by the Host. At any point of time, the read index will
  13446. * indicate the index that will next be read by the Host. The read index is
  13447. * in units of bytes offset from the base of the meta-data buffer.
  13448. *
  13449. * Write index is updated by the FW. At any point of time, the write index will
  13450. * indicate from where the FW can start writing any new data. The write index is
  13451. * in units of bytes offset from the base of the meta-data buffer.
  13452. *
  13453. * If the Host is not fast enough in reading the CFR data, any new capture data
  13454. * would be dropped if there is no space left to write the new captures.
  13455. *
  13456. * The last 4 bytes of the memory region will have the magic pattern
  13457. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13458. * not overrun the host buffer.
  13459. *
  13460. * ,--------------------. read and write indices store the
  13461. * | | byte offset from the base of the
  13462. * | ,--------+--------. meta-data buffer to the next
  13463. * | | | | location within the data buffer
  13464. * | | v v that will be read / written
  13465. * ************************************************************************
  13466. * * Read * Write * * Magic *
  13467. * * index * index * CFR data1 ...... CFR data N * pattern *
  13468. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13469. * ************************************************************************
  13470. * |<---------- data buffer ---------->|
  13471. *
  13472. * |<----------------- meta-data buffer allocated in Host ----------------|
  13473. *
  13474. * Note:
  13475. * - Considering the 4 bytes needed to store the Read index (R) and the
  13476. * Write index (W), the initial value is as follows:
  13477. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13478. * - Buffer empty condition:
  13479. * R = W
  13480. *
  13481. * Regarding CFR data format:
  13482. * --------------------------
  13483. *
  13484. * Each CFR tone is stored in HW as 16-bits with the following format:
  13485. * {bits[15:12], bits[11:6], bits[5:0]} =
  13486. * {unsigned exponent (4 bits),
  13487. * signed mantissa_real (6 bits),
  13488. * signed mantissa_imag (6 bits)}
  13489. *
  13490. * CFR_real = mantissa_real * 2^(exponent-5)
  13491. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13492. *
  13493. *
  13494. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13495. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13496. *
  13497. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13498. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13499. * .
  13500. * .
  13501. * .
  13502. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13503. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13504. */
  13505. /* Bandwidth of peer CFR captures */
  13506. typedef enum {
  13507. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13508. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13509. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13510. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13511. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13512. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13513. } HTT_PEER_CFR_CAPTURE_BW;
  13514. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13515. * was captured
  13516. */
  13517. typedef enum {
  13518. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13519. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13520. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13521. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13522. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13523. } HTT_PEER_CFR_CAPTURE_MODE;
  13524. typedef enum {
  13525. /* This message type is currently used for the below purpose:
  13526. *
  13527. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13528. * wmi_peer_cfr_capture_cmd.
  13529. * If payload_present bit is set to 0 then the associated memory region
  13530. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13531. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13532. * message; the CFR dump will be present at the end of the message,
  13533. * after the chan_phy_mode.
  13534. */
  13535. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13536. /* Always keep this last */
  13537. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13538. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13539. /**
  13540. * @brief target -> host CFR dump completion indication message definition
  13541. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13542. *
  13543. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13544. *
  13545. * @details
  13546. * The following diagram shows the format of the Channel Frequency Response
  13547. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13548. * the channel capture of a peer is copied by Firmware into the Host memory
  13549. *
  13550. * **************************************************************************
  13551. *
  13552. * Message format when the CFR capture message type is
  13553. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13554. *
  13555. * **************************************************************************
  13556. *
  13557. * |31 16|15 |8|7 0|
  13558. * |----------------------------------------------------------------|
  13559. * header: | reserved |P| msg_type |
  13560. * word 0 | | | |
  13561. * |----------------------------------------------------------------|
  13562. * payload: | cfr_capture_msg_type |
  13563. * word 1 | |
  13564. * |----------------------------------------------------------------|
  13565. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13566. * word 2 | | | | | | | | |
  13567. * |----------------------------------------------------------------|
  13568. * | mac_addr31to0 |
  13569. * word 3 | |
  13570. * |----------------------------------------------------------------|
  13571. * | unused / reserved | mac_addr47to32 |
  13572. * word 4 | | |
  13573. * |----------------------------------------------------------------|
  13574. * | index |
  13575. * word 5 | |
  13576. * |----------------------------------------------------------------|
  13577. * | length |
  13578. * word 6 | |
  13579. * |----------------------------------------------------------------|
  13580. * | timestamp |
  13581. * word 7 | |
  13582. * |----------------------------------------------------------------|
  13583. * | counter |
  13584. * word 8 | |
  13585. * |----------------------------------------------------------------|
  13586. * | chan_mhz |
  13587. * word 9 | |
  13588. * |----------------------------------------------------------------|
  13589. * | band_center_freq1 |
  13590. * word 10 | |
  13591. * |----------------------------------------------------------------|
  13592. * | band_center_freq2 |
  13593. * word 11 | |
  13594. * |----------------------------------------------------------------|
  13595. * | chan_phy_mode |
  13596. * word 12 | |
  13597. * |----------------------------------------------------------------|
  13598. * where,
  13599. * P - payload present bit (payload_present explained below)
  13600. * req_id - memory request id (mem_req_id explained below)
  13601. * S - status field (status explained below)
  13602. * capbw - capture bandwidth (capture_bw explained below)
  13603. * mode - mode of capture (mode explained below)
  13604. * sts - space time streams (sts_count explained below)
  13605. * chbw - channel bandwidth (channel_bw explained below)
  13606. * captype - capture type (cap_type explained below)
  13607. *
  13608. * The following field definitions describe the format of the CFR dump
  13609. * completion indication sent from the target to the host
  13610. *
  13611. * Header fields:
  13612. *
  13613. * Word 0
  13614. * - msg_type
  13615. * Bits 7:0
  13616. * Purpose: Identifies this as CFR TX completion indication
  13617. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13618. * - payload_present
  13619. * Bit 8
  13620. * Purpose: Identifies how CFR data is sent to host
  13621. * Value: 0 - If CFR Payload is written to host memory
  13622. * 1 - If CFR Payload is sent as part of HTT message
  13623. * (This is the requirement for SDIO/USB where it is
  13624. * not possible to write CFR data to host memory)
  13625. * - reserved
  13626. * Bits 31:9
  13627. * Purpose: Reserved
  13628. * Value: 0
  13629. *
  13630. * Payload fields:
  13631. *
  13632. * Word 1
  13633. * - cfr_capture_msg_type
  13634. * Bits 31:0
  13635. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13636. * to specify the format used for the remainder of the message
  13637. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13638. * (currently only MSG_TYPE_1 is defined)
  13639. *
  13640. * Word 2
  13641. * - mem_req_id
  13642. * Bits 6:0
  13643. * Purpose: Contain the mem request id of the region where the CFR capture
  13644. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13645. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13646. this value is invalid)
  13647. * - status
  13648. * Bit 7
  13649. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13650. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13651. * - capture_bw
  13652. * Bits 10:8
  13653. * Purpose: Carry the bandwidth of the CFR capture
  13654. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13655. * - mode
  13656. * Bits 13:11
  13657. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13658. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13659. * - sts_count
  13660. * Bits 16:14
  13661. * Purpose: Carry the number of space time streams
  13662. * Value: Number of space time streams
  13663. * - channel_bw
  13664. * Bits 19:17
  13665. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13666. * measurement
  13667. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13668. * - cap_type
  13669. * Bits 23:20
  13670. * Purpose: Carry the type of the capture
  13671. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13672. * - vdev_id
  13673. * Bits 31:24
  13674. * Purpose: Carry the virtual device id
  13675. * Value: vdev ID
  13676. *
  13677. * Word 3
  13678. * - mac_addr31to0
  13679. * Bits 31:0
  13680. * Purpose: Contain the bits 31:0 of the peer MAC address
  13681. * Value: Bits 31:0 of the peer MAC address
  13682. *
  13683. * Word 4
  13684. * - mac_addr47to32
  13685. * Bits 15:0
  13686. * Purpose: Contain the bits 47:32 of the peer MAC address
  13687. * Value: Bits 47:32 of the peer MAC address
  13688. *
  13689. * Word 5
  13690. * - index
  13691. * Bits 31:0
  13692. * Purpose: Contain the index at which this CFR dump was written in the Host
  13693. * allocated memory. This index is the number of bytes from the base address.
  13694. * Value: Index position
  13695. *
  13696. * Word 6
  13697. * - length
  13698. * Bits 31:0
  13699. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13700. * Value: Length of the CFR capture of the peer
  13701. *
  13702. * Word 7
  13703. * - timestamp
  13704. * Bits 31:0
  13705. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13706. * clock used for this timestamp is private to the target and not visible to
  13707. * the host i.e., Host can interpret only the relative timestamp deltas from
  13708. * one message to the next, but can't interpret the absolute timestamp from a
  13709. * single message.
  13710. * Value: Timestamp in microseconds
  13711. *
  13712. * Word 8
  13713. * - counter
  13714. * Bits 31:0
  13715. * Purpose: Carry the count of the current CFR capture from FW. This is
  13716. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13717. * in host memory)
  13718. * Value: Count of the current CFR capture
  13719. *
  13720. * Word 9
  13721. * - chan_mhz
  13722. * Bits 31:0
  13723. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13724. * Value: Primary 20 channel frequency
  13725. *
  13726. * Word 10
  13727. * - band_center_freq1
  13728. * Bits 31:0
  13729. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13730. * Value: Center frequency 1 in MHz
  13731. *
  13732. * Word 11
  13733. * - band_center_freq2
  13734. * Bits 31:0
  13735. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13736. * the VDEV
  13737. * 80plus80 mode
  13738. * Value: Center frequency 2 in MHz
  13739. *
  13740. * Word 12
  13741. * - chan_phy_mode
  13742. * Bits 31:0
  13743. * Purpose: Carry the phy mode of the channel, of the VDEV
  13744. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13745. */
  13746. PREPACK struct htt_cfr_dump_ind_type_1 {
  13747. A_UINT32 mem_req_id:7,
  13748. status:1,
  13749. capture_bw:3,
  13750. mode:3,
  13751. sts_count:3,
  13752. channel_bw:3,
  13753. cap_type:4,
  13754. vdev_id:8;
  13755. htt_mac_addr addr;
  13756. A_UINT32 index;
  13757. A_UINT32 length;
  13758. A_UINT32 timestamp;
  13759. A_UINT32 counter;
  13760. struct htt_chan_change_msg chan;
  13761. } POSTPACK;
  13762. PREPACK struct htt_cfr_dump_compl_ind {
  13763. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13764. union {
  13765. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13766. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13767. /* If there is a need to change the memory layout and its associated
  13768. * HTT indication format, a new CFR capture message type can be
  13769. * introduced and added into this union.
  13770. */
  13771. };
  13772. } POSTPACK;
  13773. /*
  13774. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13775. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13776. */
  13777. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13778. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13779. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13780. do { \
  13781. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13782. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13783. } while(0)
  13784. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13785. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13786. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13787. /*
  13788. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13789. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13790. */
  13791. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13792. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13793. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13794. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13795. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13796. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13797. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13798. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13799. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13800. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13801. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13802. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13803. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13804. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13805. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13806. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13807. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13808. do { \
  13809. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13810. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13811. } while (0)
  13812. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13813. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13814. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13815. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13816. do { \
  13817. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13818. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13819. } while (0)
  13820. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13821. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13822. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13823. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13824. do { \
  13825. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13826. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13827. } while (0)
  13828. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13829. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13830. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13831. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13832. do { \
  13833. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13834. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13835. } while (0)
  13836. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13837. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13838. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13839. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13840. do { \
  13841. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13842. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13843. } while (0)
  13844. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13845. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13846. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13847. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13848. do { \
  13849. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13850. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13851. } while (0)
  13852. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13853. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13854. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13855. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13856. do { \
  13857. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13858. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13859. } while (0)
  13860. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13861. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13862. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13863. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13864. do { \
  13865. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13866. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13867. } while (0)
  13868. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13869. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13870. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13871. /**
  13872. * @brief target -> host peer (PPDU) stats message
  13873. *
  13874. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13875. *
  13876. * @details
  13877. * This message is generated by FW when FW is sending stats to host
  13878. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13879. * This message is sent autonomously by the target rather than upon request
  13880. * by the host.
  13881. * The following field definitions describe the format of the HTT target
  13882. * to host peer stats indication message.
  13883. *
  13884. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13885. * or more PPDU stats records.
  13886. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13887. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13888. * then the message would start with the
  13889. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13890. * below.
  13891. *
  13892. * |31 16|15|14|13 11|10 9|8|7 0|
  13893. * |-------------------------------------------------------------|
  13894. * | reserved |MSG_TYPE |
  13895. * |-------------------------------------------------------------|
  13896. * rec 0 | TLV header |
  13897. * rec 0 |-------------------------------------------------------------|
  13898. * rec 0 | ppdu successful bytes |
  13899. * rec 0 |-------------------------------------------------------------|
  13900. * rec 0 | ppdu retry bytes |
  13901. * rec 0 |-------------------------------------------------------------|
  13902. * rec 0 | ppdu failed bytes |
  13903. * rec 0 |-------------------------------------------------------------|
  13904. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13905. * rec 0 |-------------------------------------------------------------|
  13906. * rec 0 | retried MSDUs | successful MSDUs |
  13907. * rec 0 |-------------------------------------------------------------|
  13908. * rec 0 | TX duration | failed MSDUs |
  13909. * rec 0 |-------------------------------------------------------------|
  13910. * ...
  13911. * |-------------------------------------------------------------|
  13912. * rec N | TLV header |
  13913. * rec N |-------------------------------------------------------------|
  13914. * rec N | ppdu successful bytes |
  13915. * rec N |-------------------------------------------------------------|
  13916. * rec N | ppdu retry bytes |
  13917. * rec N |-------------------------------------------------------------|
  13918. * rec N | ppdu failed bytes |
  13919. * rec N |-------------------------------------------------------------|
  13920. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13921. * rec N |-------------------------------------------------------------|
  13922. * rec N | retried MSDUs | successful MSDUs |
  13923. * rec N |-------------------------------------------------------------|
  13924. * rec N | TX duration | failed MSDUs |
  13925. * rec N |-------------------------------------------------------------|
  13926. *
  13927. * where:
  13928. * A = is A-MPDU flag
  13929. * BA = block-ack failure flags
  13930. * BW = bandwidth spec
  13931. * SG = SGI enabled spec
  13932. * S = skipped rate ctrl
  13933. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13934. *
  13935. * Header
  13936. * ------
  13937. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13938. * dword0 - b'8:31 - reserved : Reserved for future use
  13939. *
  13940. * payload include below peer_stats information
  13941. * --------------------------------------------
  13942. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13943. * @tx_success_bytes : total successful bytes in the PPDU.
  13944. * @tx_retry_bytes : total retried bytes in the PPDU.
  13945. * @tx_failed_bytes : total failed bytes in the PPDU.
  13946. * @tx_ratecode : rate code used for the PPDU.
  13947. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13948. * @ba_ack_failed : BA/ACK failed for this PPDU
  13949. * b00 -> BA received
  13950. * b01 -> BA failed once
  13951. * b10 -> BA failed twice, when HW retry is enabled.
  13952. * @bw : BW
  13953. * b00 -> 20 MHz
  13954. * b01 -> 40 MHz
  13955. * b10 -> 80 MHz
  13956. * b11 -> 160 MHz (or 80+80)
  13957. * @sg : SGI enabled
  13958. * @s : skipped ratectrl
  13959. * @peer_id : peer id
  13960. * @tx_success_msdus : successful MSDUs
  13961. * @tx_retry_msdus : retried MSDUs
  13962. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13963. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13964. */
  13965. /**
  13966. * @brief target -> host backpressure event
  13967. *
  13968. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13969. *
  13970. * @details
  13971. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13972. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13973. * This message will only be sent if the backpressure condition has existed
  13974. * continuously for an initial period (100 ms).
  13975. * Repeat messages with updated information will be sent after each
  13976. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13977. * This message indicates the ring id along with current head and tail index
  13978. * locations (i.e. write and read indices).
  13979. * The backpressure time indicates the time in ms for which continous
  13980. * backpressure has been observed in the ring.
  13981. *
  13982. * The message format is as follows:
  13983. *
  13984. * |31 24|23 16|15 8|7 0|
  13985. * |----------------+----------------+----------------+----------------|
  13986. * | ring_id | ring_type | pdev_id | msg_type |
  13987. * |-------------------------------------------------------------------|
  13988. * | tail_idx | head_idx |
  13989. * |-------------------------------------------------------------------|
  13990. * | backpressure_time_ms |
  13991. * |-------------------------------------------------------------------|
  13992. *
  13993. * The message is interpreted as follows:
  13994. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13995. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13996. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13997. * 1, 2, 3 indicates pdev_id 0,1,2 and
  13998. the msg is for LMAC ring.
  13999. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14000. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14001. * htt_backpressure_lmac_ring_id. This represents
  14002. * the ring id for which continous backpressure is seen
  14003. *
  14004. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14005. * the ring indicated by the ring_id
  14006. *
  14007. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14008. * the ring indicated by the ring id
  14009. *
  14010. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14011. * backpressure has been seen in the ring
  14012. * indicated by the ring_id.
  14013. * Units = milliseconds
  14014. */
  14015. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14016. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14017. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14018. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14019. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14020. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14021. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14022. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14023. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14024. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14025. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14026. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14027. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14028. do { \
  14029. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14030. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14031. } while (0)
  14032. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14033. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14034. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14035. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14036. do { \
  14037. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14038. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14039. } while (0)
  14040. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14041. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14042. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14043. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14044. do { \
  14045. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14046. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14047. } while (0)
  14048. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14049. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14050. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14051. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14052. do { \
  14053. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14054. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14055. } while (0)
  14056. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14057. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14058. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14059. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14060. do { \
  14061. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14062. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14063. } while (0)
  14064. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14065. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14066. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14067. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14068. do { \
  14069. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14070. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14071. } while (0)
  14072. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14073. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14074. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14075. enum htt_backpressure_ring_type {
  14076. HTT_SW_RING_TYPE_UMAC,
  14077. HTT_SW_RING_TYPE_LMAC,
  14078. HTT_SW_RING_TYPE_MAX,
  14079. };
  14080. /* Ring id for which the message is sent to host */
  14081. enum htt_backpressure_umac_ringid {
  14082. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14083. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14084. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14085. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14086. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14087. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14088. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14089. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14090. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14091. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14092. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14093. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14094. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14095. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14096. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14097. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14098. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14099. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14100. HTT_SW_UMAC_RING_IDX_MAX,
  14101. };
  14102. enum htt_backpressure_lmac_ringid {
  14103. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14104. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14105. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14106. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14107. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14108. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14109. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14110. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14111. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14112. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14113. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14114. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14115. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14116. HTT_SW_LMAC_RING_IDX_MAX,
  14117. };
  14118. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14119. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14120. pdev_id: 8,
  14121. ring_type: 8, /* htt_backpressure_ring_type */
  14122. /*
  14123. * ring_id holds an enum value from either
  14124. * htt_backpressure_umac_ringid or
  14125. * htt_backpressure_lmac_ringid, based on
  14126. * the ring_type setting.
  14127. */
  14128. ring_id: 8;
  14129. A_UINT16 head_idx;
  14130. A_UINT16 tail_idx;
  14131. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14132. } POSTPACK;
  14133. /*
  14134. * Defines two 32 bit words that can be used by the target to indicate a per
  14135. * user RU allocation and rate information.
  14136. *
  14137. * This information is currently provided in the "sw_response_reference_ptr"
  14138. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14139. * "rx_ppdu_end_user_stats" TLV.
  14140. *
  14141. * VALID:
  14142. * The consumer of these words must explicitly check the valid bit,
  14143. * and only attempt interpretation of any of the remaining fields if
  14144. * the valid bit is set to 1.
  14145. *
  14146. * VERSION:
  14147. * The consumer of these words must also explicitly check the version bit,
  14148. * and only use the V0 definition if the VERSION field is set to 0.
  14149. *
  14150. * Version 1 is currently undefined, with the exception of the VALID and
  14151. * VERSION fields.
  14152. *
  14153. * Version 0:
  14154. *
  14155. * The fields below are duplicated per BW.
  14156. *
  14157. * The consumer must determine which BW field to use, based on the UL OFDMA
  14158. * PPDU BW indicated by HW.
  14159. *
  14160. * RU_START: RU26 start index for the user.
  14161. * Note that this is always using the RU26 index, regardless
  14162. * of the actual RU assigned to the user
  14163. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14164. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14165. *
  14166. * For example, 20MHz (the value in the top row is RU_START)
  14167. *
  14168. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14169. * RU Size 1 (52): | | | | | |
  14170. * RU Size 2 (106): | | | |
  14171. * RU Size 3 (242): | |
  14172. *
  14173. * RU_SIZE: Indicates the RU size, as defined by enum
  14174. * htt_ul_ofdma_user_info_ru_size.
  14175. *
  14176. * LDPC: LDPC enabled (if 0, BCC is used)
  14177. *
  14178. * DCM: DCM enabled
  14179. *
  14180. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14181. * |---------------------------------+--------------------------------|
  14182. * |Ver|Valid| FW internal |
  14183. * |---------------------------------+--------------------------------|
  14184. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14185. * |---------------------------------+--------------------------------|
  14186. */
  14187. enum htt_ul_ofdma_user_info_ru_size {
  14188. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14189. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14190. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14191. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14192. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14193. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14194. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14195. };
  14196. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14197. struct htt_ul_ofdma_user_info_v0 {
  14198. A_UINT32 word0;
  14199. A_UINT32 word1;
  14200. };
  14201. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14202. A_UINT32 w0_fw_rsvd:30; \
  14203. A_UINT32 w0_valid:1; \
  14204. A_UINT32 w0_version:1;
  14205. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14206. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14207. };
  14208. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14209. A_UINT32 w1_nss:3; \
  14210. A_UINT32 w1_mcs:4; \
  14211. A_UINT32 w1_ldpc:1; \
  14212. A_UINT32 w1_dcm:1; \
  14213. A_UINT32 w1_ru_start:7; \
  14214. A_UINT32 w1_ru_size:3; \
  14215. A_UINT32 w1_trig_type:4; \
  14216. A_UINT32 w1_unused:9;
  14217. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14218. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14219. };
  14220. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14221. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14222. union {
  14223. A_UINT32 word0;
  14224. struct {
  14225. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14226. };
  14227. };
  14228. union {
  14229. A_UINT32 word1;
  14230. struct {
  14231. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14232. };
  14233. };
  14234. } POSTPACK;
  14235. enum HTT_UL_OFDMA_TRIG_TYPE {
  14236. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14237. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14238. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14239. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14240. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14241. };
  14242. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14243. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14244. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14245. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14246. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14247. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14248. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14249. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14250. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14251. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14252. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14253. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14254. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14255. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14256. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14257. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14258. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14259. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14260. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14261. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14262. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14263. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14264. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14265. /*--- word 0 ---*/
  14266. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14267. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14268. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14269. do { \
  14270. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14271. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14272. } while (0)
  14273. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14274. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14275. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14276. do { \
  14277. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14278. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14279. } while (0)
  14280. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14281. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14282. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14283. do { \
  14284. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14285. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14286. } while (0)
  14287. /*--- word 1 ---*/
  14288. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14289. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14290. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14291. do { \
  14292. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14293. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14294. } while (0)
  14295. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14296. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14297. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14298. do { \
  14299. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14300. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14301. } while (0)
  14302. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14303. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14304. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14305. do { \
  14306. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14307. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14308. } while (0)
  14309. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14310. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14311. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14312. do { \
  14313. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14314. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14315. } while (0)
  14316. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14317. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14318. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14319. do { \
  14320. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14321. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14322. } while (0)
  14323. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14324. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14325. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14326. do { \
  14327. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14328. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14329. } while (0)
  14330. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14331. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14332. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14333. do { \
  14334. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14335. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14336. } while (0)
  14337. /**
  14338. * @brief target -> host channel calibration data message
  14339. *
  14340. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14341. *
  14342. * @brief host -> target channel calibration data message
  14343. *
  14344. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14345. *
  14346. * @details
  14347. * The following field definitions describe the format of the channel
  14348. * calibration data message sent from the target to the host when
  14349. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14350. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14351. * The message is defined as htt_chan_caldata_msg followed by a variable
  14352. * number of 32-bit character values.
  14353. *
  14354. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14355. * |------------------------------------------------------------------|
  14356. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14357. * |------------------------------------------------------------------|
  14358. * | payload size | mhz |
  14359. * |------------------------------------------------------------------|
  14360. * | center frequency 2 | center frequency 1 |
  14361. * |------------------------------------------------------------------|
  14362. * | check sum |
  14363. * |------------------------------------------------------------------|
  14364. * | payload |
  14365. * |------------------------------------------------------------------|
  14366. * message info field:
  14367. * - MSG_TYPE
  14368. * Bits 7:0
  14369. * Purpose: identifies this as a channel calibration data message
  14370. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14371. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14372. * - SUB_TYPE
  14373. * Bits 11:8
  14374. * Purpose: T2H: indicates whether target is providing chan cal data
  14375. * to the host to store, or requesting that the host
  14376. * download previously-stored data.
  14377. * H2T: indicates whether the host is providing the requested
  14378. * channel cal data, or if it is rejecting the data
  14379. * request because it does not have the requested data.
  14380. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14381. * - CHKSUM_VALID
  14382. * Bit 12
  14383. * Purpose: indicates if the checksum field is valid
  14384. * value:
  14385. * - FRAG
  14386. * Bit 19:16
  14387. * Purpose: indicates the fragment index for message
  14388. * value: 0 for first fragment, 1 for second fragment, ...
  14389. * - APPEND
  14390. * Bit 20
  14391. * Purpose: indicates if this is the last fragment
  14392. * value: 0 = final fragment, 1 = more fragments will be appended
  14393. *
  14394. * channel and payload size field
  14395. * - MHZ
  14396. * Bits 15:0
  14397. * Purpose: indicates the channel primary frequency
  14398. * Value:
  14399. * - PAYLOAD_SIZE
  14400. * Bits 31:16
  14401. * Purpose: indicates the bytes of calibration data in payload
  14402. * Value:
  14403. *
  14404. * center frequency field
  14405. * - CENTER FREQUENCY 1
  14406. * Bits 15:0
  14407. * Purpose: indicates the channel center frequency
  14408. * Value: channel center frequency, in MHz units
  14409. * - CENTER FREQUENCY 2
  14410. * Bits 31:16
  14411. * Purpose: indicates the secondary channel center frequency,
  14412. * only for 11acvht 80plus80 mode
  14413. * Value: secondary channel center frequeny, in MHz units, if applicable
  14414. *
  14415. * checksum field
  14416. * - CHECK_SUM
  14417. * Bits 31:0
  14418. * Purpose: check the payload data, it is just for this fragment.
  14419. * This is intended for the target to check that the channel
  14420. * calibration data returned by the host is the unmodified data
  14421. * that was previously provided to the host by the target.
  14422. * value: checksum of fragment payload
  14423. */
  14424. PREPACK struct htt_chan_caldata_msg {
  14425. /* DWORD 0: message info */
  14426. A_UINT32
  14427. msg_type: 8,
  14428. sub_type: 4 ,
  14429. chksum_valid: 1, /** 1:valid, 0:invalid */
  14430. reserved1: 3,
  14431. frag_idx: 4, /** fragment index for calibration data */
  14432. appending: 1, /** 0: no fragment appending,
  14433. * 1: extra fragment appending */
  14434. reserved2: 11;
  14435. /* DWORD 1: channel and payload size */
  14436. A_UINT32
  14437. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14438. payload_size: 16; /** unit: bytes */
  14439. /* DWORD 2: center frequency */
  14440. A_UINT32
  14441. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14442. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14443. * valid only for 11acvht 80plus80 mode */
  14444. /* DWORD 3: check sum */
  14445. A_UINT32 chksum;
  14446. /* variable length for calibration data */
  14447. A_UINT32 payload[1/* or more */];
  14448. } POSTPACK;
  14449. /* T2H SUBTYPE */
  14450. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14451. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14452. /* H2T SUBTYPE */
  14453. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14454. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14455. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14456. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14457. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14458. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14459. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14460. do { \
  14461. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14462. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14463. } while (0)
  14464. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14465. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14466. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14467. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14468. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14469. do { \
  14470. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14471. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14472. } while (0)
  14473. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14474. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14475. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14476. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14477. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14478. do { \
  14479. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14480. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14481. } while (0)
  14482. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14483. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14484. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14485. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14486. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14487. do { \
  14488. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14489. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14490. } while (0)
  14491. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14492. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14493. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14494. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14495. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14496. do { \
  14497. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14498. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14499. } while (0)
  14500. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14501. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14502. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14503. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14504. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14505. do { \
  14506. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14507. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14508. } while (0)
  14509. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14510. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14511. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14512. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14513. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14514. do { \
  14515. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14516. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14517. } while (0)
  14518. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14519. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14520. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14521. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14522. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14523. do { \
  14524. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14525. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14526. } while (0)
  14527. /**
  14528. * @brief target -> host FSE CMEM based send
  14529. *
  14530. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14531. *
  14532. * @details
  14533. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14534. * FSE placement in CMEM is enabled.
  14535. *
  14536. * This message sends the non-secure CMEM base address.
  14537. * It will be sent to host in response to message
  14538. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14539. * The message would appear as follows:
  14540. *
  14541. * |31 24|23 16|15 8|7 0|
  14542. * |----------------+----------------+----------------+----------------|
  14543. * | reserved | num_entries | msg_type |
  14544. * |----------------+----------------+----------------+----------------|
  14545. * | base_address_lo |
  14546. * |----------------+----------------+----------------+----------------|
  14547. * | base_address_hi |
  14548. * |-------------------------------------------------------------------|
  14549. *
  14550. * The message is interpreted as follows:
  14551. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14552. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14553. * b'8:15 - number_entries: Indicated the number of entries
  14554. * programmed.
  14555. * b'16:31 - reserved.
  14556. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14557. * CMEM base address
  14558. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14559. * CMEM base address
  14560. */
  14561. PREPACK struct htt_cmem_base_send_t {
  14562. A_UINT32 msg_type: 8,
  14563. num_entries: 8,
  14564. reserved: 16;
  14565. A_UINT32 base_address_lo;
  14566. A_UINT32 base_address_hi;
  14567. } POSTPACK;
  14568. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14569. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14570. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14571. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14572. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14573. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14574. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14575. do { \
  14576. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14577. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14578. } while (0)
  14579. /**
  14580. * @brief - HTT PPDU ID format
  14581. *
  14582. * @details
  14583. * The following field definitions describe the format of the PPDU ID.
  14584. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14585. *
  14586. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14587. * +--------------------------------------------------------------------------
  14588. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14589. * +--------------------------------------------------------------------------
  14590. *
  14591. * sch id :Schedule command id
  14592. * Bits [11 : 0] : monotonically increasing counter to track the
  14593. * PPDU posted to a specific transmit queue.
  14594. *
  14595. * hwq_id: Hardware Queue ID.
  14596. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14597. *
  14598. * mac_id: MAC ID
  14599. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14600. *
  14601. * seq_idx: Sequence index.
  14602. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14603. * a particular TXOP.
  14604. *
  14605. * tqm_cmd: HWSCH/TQM flag.
  14606. * Bit [23] : Always set to 0.
  14607. *
  14608. * seq_cmd_type: Sequence command type.
  14609. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14610. * Refer to enum HTT_STATS_FTYPE for values.
  14611. */
  14612. PREPACK struct htt_ppdu_id {
  14613. A_UINT32
  14614. sch_id: 12,
  14615. hwq_id: 5,
  14616. mac_id: 2,
  14617. seq_idx: 2,
  14618. reserved1: 2,
  14619. tqm_cmd: 1,
  14620. seq_cmd_type: 6,
  14621. reserved2: 2;
  14622. } POSTPACK;
  14623. #define HTT_PPDU_ID_SCH_ID_S 0
  14624. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14625. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14626. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14627. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14628. do { \
  14629. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14630. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14631. } while (0)
  14632. #define HTT_PPDU_ID_HWQ_ID_S 12
  14633. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14634. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14635. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14636. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14637. do { \
  14638. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14639. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14640. } while (0)
  14641. #define HTT_PPDU_ID_MAC_ID_S 17
  14642. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14643. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14644. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14645. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14646. do { \
  14647. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14648. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14649. } while (0)
  14650. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14651. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14652. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14653. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14654. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14655. do { \
  14656. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14657. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14658. } while (0)
  14659. #define HTT_PPDU_ID_TQM_CMD_S 23
  14660. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14661. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14662. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14663. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14664. do { \
  14665. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14666. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14667. } while (0)
  14668. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14669. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14670. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14671. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14672. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14673. do { \
  14674. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14675. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14676. } while (0)
  14677. /**
  14678. * @brief target -> RX PEER METADATA V0 format
  14679. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14680. * message from target, and will confirm to the target which peer metadata
  14681. * version to use in the wmi_init message.
  14682. *
  14683. * The following diagram shows the format of the RX PEER METADATA.
  14684. *
  14685. * |31 24|23 16|15 8|7 0|
  14686. * |-----------------------------------------------------------------------|
  14687. * | Reserved | VDEV ID | PEER ID |
  14688. * |-----------------------------------------------------------------------|
  14689. */
  14690. PREPACK struct htt_rx_peer_metadata_v0 {
  14691. A_UINT32
  14692. peer_id: 16,
  14693. vdev_id: 8,
  14694. reserved1: 8;
  14695. } POSTPACK;
  14696. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14697. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14698. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14699. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14700. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14701. do { \
  14702. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14703. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14704. } while (0)
  14705. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14706. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14707. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14708. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14709. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14710. do { \
  14711. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14712. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14713. } while (0)
  14714. /**
  14715. * @brief target -> RX PEER METADATA V1 format
  14716. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14717. * message from target, and will confirm to the target which peer metadata
  14718. * version to use in the wmi_init message.
  14719. *
  14720. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14721. *
  14722. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14723. * |-----------------------------------------------------------------------|
  14724. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14725. * |-----------------------------------------------------------------------|
  14726. */
  14727. PREPACK struct htt_rx_peer_metadata_v1 {
  14728. A_UINT32
  14729. peer_id: 13,
  14730. ml_peer_valid: 1,
  14731. reserved1: 2,
  14732. vdev_id: 8,
  14733. lmac_id: 2,
  14734. chip_id: 3,
  14735. reserved2: 3;
  14736. } POSTPACK;
  14737. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14738. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14739. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14740. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14741. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14742. do { \
  14743. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14744. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14745. } while (0)
  14746. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14747. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14748. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14749. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14750. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14751. do { \
  14752. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14753. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14754. } while (0)
  14755. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14756. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14757. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14758. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14759. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14760. do { \
  14761. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14762. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14763. } while (0)
  14764. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14765. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14766. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14767. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14768. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14769. do { \
  14770. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14771. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14772. } while (0)
  14773. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14774. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14775. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14776. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14777. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14778. do { \
  14779. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14780. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14781. } while (0)
  14782. /*
  14783. * In some systems, the host SW wants to specify priorities between
  14784. * different MSDU / flow queues within the same peer-TID.
  14785. * The below enums are used for the host to identify to the target
  14786. * which MSDU queue's priority it wants to adjust.
  14787. */
  14788. /*
  14789. * The MSDUQ index describe index of TCL HW, where each index is
  14790. * used for queuing particular types of MSDUs.
  14791. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14792. */
  14793. enum HTT_MSDUQ_INDEX {
  14794. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14795. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14796. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14797. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14798. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14799. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14800. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14801. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14802. HTT_MSDUQ_MAX_INDEX,
  14803. };
  14804. /* MSDU qtype definition */
  14805. enum HTT_MSDU_QTYPE {
  14806. /*
  14807. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14808. * relative priority. Instead, the relative priority of CRIT_0 versus
  14809. * CRIT_1 is controlled by the FW, through the configuration parameters
  14810. * it applies to the queues.
  14811. */
  14812. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14813. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14814. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14815. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14816. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14817. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  14818. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  14819. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  14820. /* New MSDU_QTYPE should be added above this line */
  14821. /*
  14822. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14823. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14824. * any host/target message definitions. The QTYPE_MAX value can
  14825. * only be used internally within the host or within the target.
  14826. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14827. * it must regard the unexpected value as a default qtype value,
  14828. * or ignore it.
  14829. */
  14830. HTT_MSDU_QTYPE_MAX,
  14831. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14832. };
  14833. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14834. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14835. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14836. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14837. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14838. };
  14839. /**
  14840. * @brief target -> host mlo timestamp offset indication
  14841. *
  14842. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14843. *
  14844. * @details
  14845. * The following field definitions describe the format of the HTT target
  14846. * to host mlo timestamp offset indication message.
  14847. *
  14848. *
  14849. * |31 16|15 12|11 10|9 8|7 0 |
  14850. * |----------------------------------------------------------------------|
  14851. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14852. * |----------------------------------------------------------------------|
  14853. * | Sync time stamp lo in us |
  14854. * |----------------------------------------------------------------------|
  14855. * | Sync time stamp hi in us |
  14856. * |----------------------------------------------------------------------|
  14857. * | mlo time stamp offset lo in us |
  14858. * |----------------------------------------------------------------------|
  14859. * | mlo time stamp offset hi in us |
  14860. * |----------------------------------------------------------------------|
  14861. * | mlo time stamp offset clocks in clock ticks |
  14862. * |----------------------------------------------------------------------|
  14863. * |31 26|25 16|15 0 |
  14864. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14865. * | | compensation in clks | |
  14866. * |----------------------------------------------------------------------|
  14867. * |31 22|21 0 |
  14868. * | rsvd 3 | mlo time stamp comp timer period |
  14869. * |----------------------------------------------------------------------|
  14870. * The message is interpreted as follows:
  14871. *
  14872. * dword0 - b'0:7 - msg_type: This will be set to
  14873. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14874. * value: 0x28
  14875. *
  14876. * dword0 - b'9:8 - pdev_id
  14877. *
  14878. * dword0 - b'11:10 - chip_id
  14879. *
  14880. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14881. *
  14882. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14883. *
  14884. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14885. * which last sync interrupt was received
  14886. *
  14887. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14888. * which last sync interrupt was received
  14889. *
  14890. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14891. *
  14892. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14893. *
  14894. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14895. *
  14896. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14897. *
  14898. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14899. * for sub us resolution
  14900. *
  14901. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14902. *
  14903. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14904. * is applied, in us
  14905. *
  14906. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14907. */
  14908. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14909. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14910. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14911. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14912. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14913. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14914. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14915. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14916. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14917. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14918. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14919. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14920. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14921. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14922. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14923. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14924. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14925. do { \
  14926. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14927. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14928. } while (0)
  14929. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14930. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14931. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14932. do { \
  14933. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14934. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14935. } while (0)
  14936. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14937. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14938. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14939. do { \
  14940. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14941. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14942. } while (0)
  14943. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14944. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14945. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14946. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14947. do { \
  14948. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14949. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14950. } while (0)
  14951. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14952. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14953. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14954. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14955. do { \
  14956. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14957. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14958. } while (0)
  14959. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14960. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14961. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14962. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14963. do { \
  14964. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14965. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14966. } while (0)
  14967. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14968. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14969. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14970. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14971. do { \
  14972. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14973. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14974. } while (0)
  14975. typedef struct {
  14976. A_UINT32 msg_type: 8, /* bits 7:0 */
  14977. pdev_id: 2, /* bits 9:8 */
  14978. chip_id: 2, /* bits 11:10 */
  14979. reserved1: 4, /* bits 15:12 */
  14980. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14981. A_UINT32 sync_timestamp_lo_us;
  14982. A_UINT32 sync_timestamp_hi_us;
  14983. A_UINT32 mlo_timestamp_offset_lo_us;
  14984. A_UINT32 mlo_timestamp_offset_hi_us;
  14985. A_UINT32 mlo_timestamp_offset_clks;
  14986. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14987. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14988. reserved2: 6; /* bits 31:26 */
  14989. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14990. reserved3: 10; /* bits 31:22 */
  14991. } htt_t2h_mlo_offset_ind_t;
  14992. /*
  14993. * @brief target -> host VDEV TX RX STATS
  14994. *
  14995. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  14996. *
  14997. * @details
  14998. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  14999. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15000. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15001. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15002. * periodically by target even in the absence of any further HTT request
  15003. * messages from host.
  15004. *
  15005. * The message is formatted as follows:
  15006. *
  15007. * |31 16|15 8|7 0|
  15008. * |---------------------------------+----------------+----------------|
  15009. * | payload_size | pdev_id | msg_type |
  15010. * |---------------------------------+----------------+----------------|
  15011. * | reserved0 |
  15012. * |-------------------------------------------------------------------|
  15013. * | reserved1 |
  15014. * |-------------------------------------------------------------------|
  15015. * | reserved2 |
  15016. * |-------------------------------------------------------------------|
  15017. * | |
  15018. * | VDEV specific Tx Rx stats info |
  15019. * | |
  15020. * |-------------------------------------------------------------------|
  15021. *
  15022. * The message is interpreted as follows:
  15023. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15024. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15025. * b'8:15 - pdev_id
  15026. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15027. * message header fields (msg_type through reserved2)
  15028. * dword1 - b'0:31 - reserved0.
  15029. * dword2 - b'0:31 - reserved1.
  15030. * dword3 - b'0:31 - reserved2.
  15031. */
  15032. typedef struct {
  15033. A_UINT32 msg_type: 8,
  15034. pdev_id: 8,
  15035. payload_size: 16;
  15036. A_UINT32 reserved0;
  15037. A_UINT32 reserved1;
  15038. A_UINT32 reserved2;
  15039. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15040. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15041. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15042. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15043. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15044. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15045. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15046. do { \
  15047. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15048. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15049. } while (0)
  15050. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15051. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15052. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15053. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15054. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15055. do { \
  15056. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15057. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15058. } while (0)
  15059. /* SOC related stats */
  15060. typedef struct {
  15061. htt_tlv_hdr_t tlv_hdr;
  15062. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15063. * This can be due to either the peer is deleted or deletion is ongoing
  15064. * */
  15065. A_UINT32 inv_peers_msdu_drop_count_lo;
  15066. A_UINT32 inv_peers_msdu_drop_count_hi;
  15067. } htt_t2h_soc_txrx_stats_common_tlv;
  15068. /* VDEV HW Tx/Rx stats */
  15069. typedef struct {
  15070. htt_tlv_hdr_t tlv_hdr;
  15071. A_UINT32 vdev_id;
  15072. /* Rx msdu byte cnt */
  15073. A_UINT32 rx_msdu_byte_cnt_lo;
  15074. A_UINT32 rx_msdu_byte_cnt_hi;
  15075. /* Rx msdu cnt */
  15076. A_UINT32 rx_msdu_cnt_lo;
  15077. A_UINT32 rx_msdu_cnt_hi;
  15078. /* tx msdu byte cnt */
  15079. A_UINT32 tx_msdu_byte_cnt_lo;
  15080. A_UINT32 tx_msdu_byte_cnt_hi;
  15081. /* tx msdu cnt */
  15082. A_UINT32 tx_msdu_cnt_lo;
  15083. A_UINT32 tx_msdu_cnt_hi;
  15084. /* tx excessive retry discarded msdu cnt*/
  15085. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15086. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15087. /* TX congestion ctrl msdu drop cnt */
  15088. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15089. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15090. /* discarded tx msdus cnt coz of time to live expiry */
  15091. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15092. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15093. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15094. #endif